XNA Game Studio 4.0
CollapseAll image

XNA Game Studio 4.0 is a programming environment that allows you to use Visual Studio to create games for Windows Phone, the Xbox 360 console, and Windows-based computers. XNA Game Studio includes the XNA Framework, which is a set of managed libraries designed for game development based on Microsoft .NET Framework 2.0. This documentation collection contains technology overviews, tutorials, and reference material related to XNA Game Studio.

In This Section

Introduction to XNA Game Studio 4.0
Provides helpful prerequisities for installing and using Microsoft XNA Game Studio 4.0.
Getting Started with XNA Game Studio Development
Provides introductory documentation for developing games with XNA Game Studio.
Writing Game Code
Describes how to use XNA Game Studio and the XNA Framework to develop multiplatform games for Windows, Xbox 360, and Windows Phone.
Adding Art, Music, and Other Game Assets
Describes game assets, such as bitmaps, models, textures, and sounds. These assets, a collection of data files used to support gameplay, are managed by the XNA Framework Content Pipeline.
Packing and Distributing Your Game
Describes how to share and distribute your game to XNA Game Studio users and others.
Advanced Topics
Describes how XNA Game Studio provides numerous feature extensions to Visual Studio and Visual C# Express to help create eye-popping games.
XNA Framework Class Library
The XNA Framework class library is a library of classes, interfaces, and value types that are included in XNA Game Studio.
Content Pipeline Class Library
The Content Pipeline class library is a library of classes, interfaces, and value types that are included in XNA Game Studio. This library provides access to XNA Framework Content Pipeline functionality and is designed to be the foundation on which Content Pipeline–related applications, components, and controls are built.
XNA Creators Club Online Web Site
More samples and tutorials, as well as developer community forums, are available at the XNA Creators Club Online Web site.

© 2010 Microsoft Corporation. All rights reserved.
Send feedback to xnags@microsoft.com.
Version: 4.0.20823.0


Introduction to XNA Game Studio 4.0

Introduction to XNA Game Studio 4.0

This section provides helpful prerequisities for installing and using Microsoft XNA Game Studio 4.0.

In This Section

What's New in XNA Game Studio 4.0
Describes new features and changes in XNA Game Studio 4.0.
Hardware and Operating System Requirements
Describes the operating systems that fully support XNA Game Studio, and the computing hardware you need to use XNA Game Studio.
Software Install Requirements
Describes the software required to use XNA Game Studio 4.0.
Software Installation Notes
Describes various scenarios under which XNA Game Studio 4.0 may be installed.
Setting up your Firewall
Describes required settings for third-party firewall products.
Getting Additional Help
Describes additional resources for developing with the XNA Framework.


What's New in XNA Game Studio 4.0

What's New in XNA Game Studio 4.0

Describes new features and changes in XNA Game Studio 4.0.
  • Overview of New Features
  • New Classes and Methods
  • New In the XNA Game Studio Preview Refresh

Overview of New Features

  • Develop Games for Windows Phone 7
  • Leverage Windows Phone-specific Features Through Silverlight
  • Simplified Graphics Interfaces
  • Configurable Effects
  • Built-in State Objects
  • System Support for Scalars and Orientation
  • Cross-Platform Input API
  • Enhanced Audio Support
  • Music and Picture Enumeration and Video Playback

Develop Games for Windows Phone 7

XNA Game Studio and the XNA Framework are designed for cross-platform gaming scenarios with support for Windows Phone 7, Xbox 360, and Windows-based PCs. This allows you to target more platforms from the same code base. It also allows developers to focus game design for each platform on real device differences such as the device capabilities and experience, as opposed to writing with different frameworks for each targeted device.

Tasks

Developing Windows Phone Games
Describes how to develop games for Windows Phone.
Migrating from Zune to Windows Phone
Discusses how to migrate games written for Zune and Zune HD on XNA Game Studio 3.1 to Windows Phone with XNA Game Studio 4.0.

Leverage Windows Phone-specific Features Through Silverlight

When you develop games for Windows Phone 7, you can leverage platform-specific features such as location, accelerometer, and vibration interfaces that are provided through Silverlight 4.0. Similarly, most of the XNA Framework can be accessed from Silverlight applications.

Tasks

Retrieving Accelerometer Input (Windows Phone)
Demonstrates how to detect and use accelerometer input in an XNA Game Studio game on Windows Phone.

On Windows Phone, writable user storage is handled by Silverlight, not by XNA Game Studio. You can use the XNA Game Studio content pipeline to preprocess read-only game assets that are accessed by the content manager at run time.

Concepts

What Is Storage?
Storage refers to memory locations used for reading and writing data.

Tasks

Writing Data (Windows Phone)
Describes how to save game data on Windows Phone.
Adding Game Data Files to Title Storage
Describes how to add game data files to the title storage location.
Reading Game Data from Title Storage
Describes how to load game data from the title storage location.
XML Elements for XMLImporter
Describes the elements of an XML file that can be processed by the XmlImporter Class.
Adding an XML Content File to a Visual Studio Project
Describes how to add custom game data as an XML file through the Content Pipeline.
Loading XML Content at Runtime
Describes how to load custom game data at game runtime through the Content Pipeline.
Using an XML File to Specify Content
Describes how to use XML files for custom game data through the Content Pipeline.
Creating an XML File
Describes how to use IntermediateSerializer from a Windows application to generate XML content to add to a XNA Game Studio application.

Simplified Graphics Interfaces

XNA Game Studio 4.0 introduces the concept of XNA Framework profiles. These profiles (Reach and HiDef) allow you to create a clear development environment while targeting broad or specific platform releases. The Reach profile is designed for compatibility across the largest possible range of devices, including Windows Phone 7, Windows-based PCs, and Xbox 360 consoles. Choosing the HiDef platform in your development environment allows you to use platform showcase features.

Both the Reach and HiDef profiles are hardware accelerated.

Concepts

What Is a Profile?
A profile is a feature set that is implemented in hardware. The Reach profile implements high-level shader language (HLSL) Shader Model 2.0 and the HiDef profile implements HLSL Shader Model 3.0.

Reference

GraphicsDeviceInformation.GraphicsProfile Property
Gets the graphics profile, which determines the graphics feature set.
GraphicsDeviceManager.GraphicsProfile Property
Gets the graphics profile, which determines the graphics feature set.
GraphicsAdapter.IsProfileSupported Method
Tests to see if the adapter supports the requested profile.
ContentWriter.TargetProfile Property
Gets or sets the target graphics profile.
ContentProcessorContext.TargetProfile Property
Gets the current content build target profile.
BuildContent.TargetProfile Property
Gets or sets the target graphics profile.
BuildXact.TargetProfile Property
Gets or sets the target graphics profile.
CleanContent.TargetProfile Property
Gets or sets the target graphics profile.

Configurable Effects

Game Studio 4.0 introduces new and updated configurable effects that will add more variety to your rendering options. These configurable effects are available for both Reach and HiDef profiles and for all platforms, including Windows Phone 7, Windows-based PCs, and Xbox 360 consoles.

  • Basic Effects—A basic effect includes transforms and basic lighting for Blinn-Phong shading. You have the option of adding up to three more directional lights, fog, and a texture. Use one light for the fastest performance, and use three lights for more interesting 3D lighting.
  • Dual Texture Effects—A dual texture effect uses two textures with two independent sets of texture coordinates. When you blend the two textures, you generate a lot more visual complexity if the first texture contains the basic color or detail, and the second texture contains complex lighting.
  • Alpha Test Effects—An alpha test effect uses a reference alpha and an alpha function to implement alpha testing. This can greatly improve rendering performance by only updating pixels where objects are being drawn in a scene. Alpha testing is common when depth/stencil buffers are not used.
  • Skinned Effects—A skinned effect uses bones and weights to influence vertex positions, that is, to move or deform an object. This works very well for character animation and instancing. The effect supports up to 72 bones, with up to 4 weights per bone.
  • Environment Map Effects—An environment map effect uses a diffuse texture to color or detail an object, and a cube map texture containing an environment map to shade the object due to the environment. Because the object reflects the scene, this makes the object look more like it is in a real scene. Also, you can use the fresnel parameter to tune the amount of light reflected (shininess) based on the geometry of the surface.

Concepts

What Is a Configurable Effect?
A configurable effect is an optimized rendering effect designed for Windows, Xbox 360, and Windows Phone. A configurable effect is created using a built-in object with options for user configuration.
What Is an Effect?
An effect initializes the graphics pipeline for performing transforms, lighting, applying textures, and adding per-pixel visual effects such as a glow or a lens flare. Under the covers, an effect implements at least one shader for processing vertices and at least one shader for processing pixels.

Tasks

Creating a Custom Effect
Demonstrates how to create a custom effect that transforms an object and applies a texture.

Reference

BasicEffect Class
Contains a basic rendering effect.
SkinnedEffect Class
Contains a configurable effect for rendering skinned character models.
EnvironmentMapEffect Class
Contains a configurable effect that supports environment mapping.
DualTextureEffect Class
Contains a configurable effect that supports two-layer multitexturing.
AlphaTestEffect Class
Contains a configurable effect that supports alpha testing.

Built-in State Objects

Many of the individual state properties have been replaced with a more organized set of immutable state objects. There are fewer states to manage.

Tasks

Creating a State Object
Demonstrates how to create a state object using any of the state object classes: BlendState, DepthStencilState, RasterizerState, or SamplerState.

ConceptsReference

What Is Blend State?
Blend state controls how color and alpha values are blended when combining rendered data with existing render target data.
What Is Depth Stencil State?
Depth stencil state controls how the depth buffer and the stencil buffer are used.
BlendState Class
Contains blend state for the device.
DepthStencilState Class
Contains depth-stencil state for the device.
GraphicsDevice.RasterizerState Property
Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
SamplerState Class
Contains sampler state, which determines how to sample texture data.

System Support for Scalars and Orientation

With new system support for scalars and orientation, you can write your game without worrying about native resolution or orientation. Scalars can significantly improve game performance. This support comes automatically when you use the XNA Framework.

Reference

DisplayOrientation Enumeration
Defines the display orientation.
PresentationParameters.DisplayOrientation Property
Gets or sets the orientation of the display. The default value is DisplayOrientation.Default, which means orientation is determined automatically from your BackBufferWidth and BackBufferHeight.
GraphicsDeviceManager.SupportedOrientations Property
Gets or sets the display orientations that are available if automatic rotation and scaling is enabled.
GraphicsDeviceManager.DefaultBackBufferHeight Field
Specifies the default minimum back-buffer height.
GameWindow.CurrentOrientation Property
Gets the current display orientation, which reflects the physical orientation of the phone in the user's hand.
GameWindow.OrientationChanged Event
Describes the event raised when the display orientation of the GameWindow changes. When this event occurs, the XNA Framework automatically adjusts the game orientation based on the value specified by the developer with SupportedOrientations.
GameWindow.OnOrientationChanged Method
Called when the GameWindow display orientation changes.
GameWindow.SetSupportedOrientations Method
Sets the supported display orientations.
TouchPanel.DisplayOrientation Property
Gets or sets the display orientation of the touch panel.
TouchPanel.DisplayWidth Property
Gets or sets the display width of the touch panel.
TouchPanel.DisplayHeight Property
Gets or sets the display height of the touch panel.

Cross-Platform Input API

While the design of an input strategy for your game is likely to be highly specific to a particular game or device experience, the XNA Framework provides a cross-platform input interface where an input capability is likely to be available across multiple platforms. In this release, multitouch support has been added for Windows and Windows Phone-based applications that use the XNA Framework. The XNA Framework input classes are orientation-aware and resolution-aware, allowing for greater portability of code and fewer #ifdefs in your game design.

Tasks

Working with Touch Input (Windows Phone)
Demonstrates how to detect and use multitouch input in an XNA game.

Reference

Microsoft.Xna.Framework.Input.Touch
Contains classes that enable access to touch-based input on devices that support it.
TouchPanel
Provides methods for retrieving touch panel device information.
TouchPanelCapabilities
Provides access to information about the capabilities of the touch input device.
TouchLocation
Provides methods and properties for interacting with a touch location on a touch screen device.
TouchLocationState
Defines the possible states of a touch location.

Enhanced Audio Support

The XNA Framework Audio namespace now allows for audio capture and playback through the Microphone and DynamicSoundEffect classes. You now have the ability to play back synthesized or buffered audio, capturing audio through a microphone or Bluetooth headset, and playing it through a headset or speakers.

Reference

Microphone Class
Provides properties, methods, and fields and events for capturing audio data with microphones.
DynamicSoundEffectInstance Class
Provides properties, methods, and events for play back of the audio buffer.

Music and Picture Enumeration and Video Playback

You can now do the following:

  • Use a uniform resource location to play songs.

  • Select, edit, and publish photos.

  • Play back video using an interface that allows you to show or hide the video controls.

Tasks

Playing a Song from a URI
Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).

Reference

Song.FromUri Method
Constructs a new Song object based on the specified URI.
MediaLibrary.SavePicture Method
Saves the image to the media library.

New Classes and Methods

Microsoft.Xna.Framework

Color has moved from the Microsoft.Xna.Framework.Graphics namespace to Microsoft.Xna.Framework.

Color Structure
Represents a four-component color using red, green, blue, and alpha data.
GraphicsDeviceInformation.GraphicsProfile Property
Gets the graphics profile, which determines the graphics feature set.
GraphicsDeviceManager.GraphicsProfile Property
Gets the graphics profile, which determines the graphics feature set.
TitleContainer Class
Provides file stream access to the title's default storage location.

Microsoft.Xna.Framework.Audio

DynamicSoundEffectInstance Class
Provides properties, methods, and events for play back of the audio buffer.
Microphone Class
Provides properties, methods, and fields and events for capturing audio data with microphones.
NoMicrophoneConnectedException Class
The exception that is thrown when Microphone API calls are made on a disconnected microphone.
AudioChannels Enumeration
Defines the number of channels in the audio data.
MicrophoneState Enumeration
Current state of the Microphone audio capture (started or stopped).
SoundEffect.FromStream Method
Creates a SoundEffect object based on the specified data stream.
SoundEffect.GetSampleDuration Method
Returns the sample duration based on the specified sample size and sample rate.
SoundEffect.GetSampleSizeInBytes Method
Returns the size of the audio sample based on duration, sample rate, and audio channels.

Microsoft.Xna.Framework.Input.Touch

Microsoft.Xna.Framework.Input.Touch Namespace
Contains classes that enable access to touch-based input on devices that support it.

Microsoft.Xna.Framework.Media

Album.GetAlbumArt Method
Returns the stream that contains the album art image data.
MediaLibrary.SavePicture Method
Saves the image to the media library.
Picture.GetImage Method
Returns the stream that contains the image data.
Picture.GetThumbnail Method
Returns the stream that contains the picture's thumbnail image data.
Song.FromUri Method
Constructs a new Song object based on the specified URI.

Microsoft.Xna.Framework.Graphics.PackedVector

Bgra4444 Structure
Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 4 bits each for x, y, z, and w.

Microsoft.Xna.Framework.Storage

Storage device selection has moved from the GamerServices namespace to the Storage namespace.

StorageDevice.BeginShowSelector Method
Overloaded methods for showing the storage device selector asynchronously.
StorageDevice.EndShowSelector Method
Ends the display of the storage selector user interface.

Microsoft.Xna.Framework.Content.Pipeline

Effect compilation from the Framework to the Content Pipeline.

In This Section

ContentWriter.TargetProfile Property
Gets or sets the target graphics profile.
AlphaTestMaterialContent Class
Provides properties for modifying an effect that supports alpha testing.
DualTextureMaterialContent Class
Provides properties for modifying an effect that supports two-layer multitexturing.
EffectMaterialContent.CompiledEffect Property
Gets or sets the compiled Effect.
EnvironmentMapMaterialContent Class
Provides properties for modifying an effect that supports environment mapping.
SkinnedMaterialContent Class
Provides properties for modifying an effect for rendering skinned character models.
ContentImporterContext Constructor
Initializes a new instance of ContentImporterContext.
ContentProcessorContext Constructor
Initializes a new instance of ContentProcessorContext.
ContentProcessorContext.TargetProfile Property
Gets the current content build target profile.
EffectImporter Class
Provides methods for reading effect (.fx) files for use in the Content Pipeline.
FbxImporter Class
Provides methods for reading AutoDesk (.fbx) files for use in the Content Pipeline.
Mp3Importer Class
Provides methods for reading MP3 audio files for use in the Content Pipeline.
TextureImporter Class
Provides methods for reading texture files for use in the Content Pipeline.
WavImporter Class
Provides methods for reading .wav audio files for use in the Content Pipeline.
WmaImporter Class
Provides methods for reading Windows Media Audio (.wma) files for use in the Content Pipeline.
WmvImporter Class
Provides methods for reading Windows Media Video (.wmv) files for use in the Content Pipeline.
XImporter Class
Provides methods for reading DirectX Object (.x) files for use in the Content Pipeline.
TargetPlatform Enumeration
Identifiers for the target platform.
CompiledEffectContent Class
Represents a compiled Effect.
EffectProcessor.DebugMode Property
The debug mode for compiling effects.
EffectProcessor.Defines Property
Define assignments for the effect.
FontTextureProcessor.PremultiplyAlpha Property
Specifies whether alpha premultiply of font textures is enabled.
MaterialProcessor.DefaultEffect Property
The default effect type for this instance of MaterialProcessor.
MaterialProcessor.PremultiplyTextureAlpha Property
Specifies whether alpha premultiply of textures is enabled.
ModelMeshPartContent.IndexBuffer Property
Gets the index buffer associated with this mesh part.
ModelMeshPartContent.VertexBuffer Property
Gets the vertex buffer associated with this mesh part.
ModelMeshPartContent.VertexOffset Property
Gets the offset, in bytes, from the first index of the of vertex buffer for this mesh part.
ModelProcessor.DefaultEffect Property
The default effect type for this instance of ModelProcessor.
ModelProcessor.PremultiplyTextureAlpha Property
Specifies whether alpha premultiply of textures is enabled.
TextureProcessor.PremultiplyAlpha Property
Specifies whether alpha premultiply of textures is enabled.
VertexBufferContent.VertexDeclaration Property
Gets the associated VertexDeclarationContent object.
BuildContent.TargetProfile Property
Gets or sets the target graphics profile.
BuildXact.TargetProfile Property
Gets or sets the target graphics profile.
CleanContent.TargetProfile Property
Gets or sets the target graphics profile.

Microsoft.Xna.Framework.Graphics

  • New overloads to SpriteBatch.Begin provide an explicit way to draw sprites with a custom pixel shader.
  • VertexBuffers are now strongly typed. VertexDeclaration usage has changed in XNA Game Studio 4.0. Each VertexBuffer now has an associated VertexDeclaration, which becomes immutable after the buffer has been created, allowing for the XNA Framework to automatically adjust the bit layout of vertex data as required for different platforms.

BlendState Class
Contains blend state for the device.
DepthStencilState Class
Contains depth-stencil state for the device.
GraphicsDevice.RasterizerState Property
Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
SamplerState Class
Contains sampler state, which determines how to sample texture data.
AlphaTestEffect Class
Contains a configurable effect that supports alpha testing.
BasicEffect Class
Contains a basic rendering effect.
DirectionalLight Class
Creates a DirectionalLight object.
DualTextureEffect Class
Contains a configurable effect that supports two-layer multitexturing.
Effect.Clone Method
Copies data from an existing object to this object.
Effect.OnApply Method
Applies the effect state just prior to rendering the effect.
EffectMaterial Class
Contains an effect subclass which is used to load data for an EffectMaterialContent type.
EffectPass.Apply Method
Begins this pass.
EnvironmentMapEffect Class
Contains a configurable effect that supports environment mapping.
GraphicsAdapter.IsProfileSupported Method
Tests to see if the adapter supports the requested profile.
GraphicsAdapter.QueryBackBufferFormat Method
Queries the adapter for support for the requested back buffer format.
GraphicsAdapter.QueryRenderTargetFormat Method
Queries the adapter for support for the requested render target format.
GraphicsAdapter.UseNullDevice Property
Gets or sets a NULL device.
GraphicsAdapter.UseReferenceDevice Property
Gets or sets a reference device.
GraphicsDevice.Clear Method
Clears resource buffers.
GraphicsDevice.DrawInstancedPrimitives Method
Draws a series of instanced models.
GraphicsDevice.DrawUserIndexedPrimitives Method
Renders geometric primitives.
GraphicsDevice.DrawUserPrimitives Method
Renders geometric primitives.
GraphicsDevice.GetBackBufferData Method
Gets the contents of the back buffer.
GraphicsDevice.GetRenderTargets Method
Gets a render target surface.
GraphicsDevice.GetVertexBuffers Method
Gets the vertex buffers.
GraphicsDevice.SetRenderTargets Method
Sets an array of render targets.
GraphicsDevice.SetVertexBuffer Method
Sets or binds a vertex buffer to a device.
GraphicsDevice.SetVertexBuffers Method
Sets the vertex buffers.
GraphicsDevice.Adapter Property
Gets the graphics adapter.
GraphicsDevice.BlendFactor Property
Gets or sets the color used for a constant-blend factor during alpha blending. The default value is Color.White.
GraphicsDevice.BlendState Property
Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is BlendState.Opaque.
GraphicsDevice.DepthStencilState Property
Gets or sets a system-defined instance of a depth-stencil state object. The default value is DepthStencilState.Default.
GraphicsDevice.GraphicsProfile Property
Gets the graphics profile. The default value is GraphicsProfile.Reach.
GraphicsDevice.MultiSampleMask Property
Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff).
GraphicsDevice.ReferenceStencil Property
Gets or sets a reference value for stencil testing. The default value is zero.
IEffectFog Interface
Gets or sets fog parameters for the current effect.
IEffectLights Interface
Gets or sets lighting parameters for the current effect.
IEffectMatrices Interface
Gets or sets transformation matrix parameters for the current effect.
IndexBuffer.IndexCount Property
Gets the number of indices in this buffer.
IVertexType Interface
Vertex type interface which is implemented by a custom vertex type structure.
Model.Draw Method
Render a model after applying the matrix transformations.
ModelMeshPart.IndexBuffer Property
Gets the index buffer for this mesh part.
ModelMeshPart.VertexBuffer Property
Gets the vertex buffer for this mesh part.
ModelMeshPart.VertexOffset Property
Gets the offset (in vertices) from the top of vertex buffer.
NoSuitableGraphicsDeviceException Class
Thrown when no available graphics device fits the given device preferences.
PresentationParameters.Bounds Property
Gets the size of this resource.
PresentationParameters.DepthStencilFormat Property
Gets or sets the depth stencil data format.
PresentationParameters.MultiSampleCount Property
Gets or sets a value indicating the number of sample locations during multisampling.
RasterizerState Class
Contains rasterizer state, which determines how to convert vector data (shapes) into raster data (pixels).
RenderTarget2D Class
Contains a 2D texture that can be used as a render target.
RenderTargetBinding Structure
Binds an array of render targets.
RenderTargetCube Class
Represents a cubic texture resource that will be written to at the end of a render pass.
SkinnedEffect Class
Contains a configurable effect for rendering skinned character models.
SpriteBatch.Begin Method
Begins a sprite batch operation.
SpriteBatch.Dispose Method
Releases unmanaged resources used by this object.
SpriteBatch.DrawString Method
Adds a string to a batch of sprites to be rendered.
SpriteBatch.Draw Method
Adds a sprite to a batch of sprites to be rendered.
SpriteFont Class
Represents a font texture.
Texture.Format Property
Gets the format of the texture data.
Texture2D Constructor
Creates an uninitialized Texture2D resource of the specified dimensions. To initialize a Texture2D from an existing file, see the static method ContentManager.Load.
Texture2D.FromStream Method
Methods for loading an image.
Texture2D.SaveAsJpeg Method
Saves texture data as a .jpg.
Texture2D.SaveAsPng Method
Saves texture data as a .png.
Texture2D.SetData Method
Sets data to the texture.
Texture2D.Bounds Property
Gets the size of this resource.
Texture3D Constructor
Creates a new instance of this object.
Texture3D.SetData Method
Sets data.
VertexBuffer Constructor
Creates an instance of this object.
VertexBuffer.VertexCount Property
Gets the number of vertices.
VertexBuffer.VertexDeclaration Property
Defines per-vertex data in a buffer.
VertexBufferBinding Structure
Binding structure that specifies a vertex buffer and other per-vertex parameters (such as offset and instancing) for a graphics device.
VertexDeclaration Class
A vertex declaration, which defines per-vertex data.
VertexElement Constructor
Initializes a new instance of the VertexElement class.
VertexPositionColor Constructor
Initializes a new instance of the VertexPositionColor class.
VertexPositionColor.Color Field
The vertex color.
VertexPositionColor.Position Field
XYZ position.
VertexPositionColor.VertexDeclaration Field
Vertex declaration, which defines per-vertex data.
VertexPositionColorTexture Structure
Describes a custom vertex format structure that contains position, color, and one set of texture coordinates.
VertexPositionNormalTexture Structure
Describes a custom vertex format structure that contains position, normal data, and one set of texture coordinates.
VertexPositionTexture Structure
Describes a custom vertex format structure that contains position and one set of texture coordinates.
Viewport Constructor
Creates an instance of this class.
Viewport.Bounds Property
Gets the size of this resource.
GraphicsProfile Enumeration
Identifies the set of supported devices for the game based on device capabilities.

New In the XNA Game Studio Preview Refresh

  • New Code Samples, Conceptual Content, and Tutorials
  • New Samples Upgraded to XNA Game Studio 4.0

New Code Samples, Conceptual Content, and Tutorials

Media

Playing a Song from a URI
Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).

Storage and Content Pipeline

Writing Data (Windows Phone)
Describes how to save game data on Windows Phone.
Adding Game Data Files to Title Storage
Describes how to add game data files to the title storage location.
Reading Game Data from Title Storage
Describes how to load game data from the title storage location.
XML Elements for XMLImporter
Describes the elements of an XML file that can be processed by the XmlImporter Class.
Adding an XML Content File to a Visual Studio Project
Describes how to add custom game data as an XML file through the Content Pipeline.
Loading XML Content at Runtime
Describes how to load custom game data at game runtime through the Content Pipeline.
Using an XML File to Specify Content
Describes how to use XML files for custom game data through the Content Pipeline.
Creating an XML File
Describes how to use IntermediateSerializer from a Windows application to generate XML content to add to a XNA Game Studio application.

Graphics

What Is Blend State?
Blend state controls how color and alpha values are blended when combining rendered data with existing render target data.
What Is Depth Stencil State?
Depth stencil state controls how the depth buffer and the stencil buffer are used.
What Is a Back Buffer?
A back buffer is a render target whose contents will be sent to the device when GraphicsDevice.Present is called.
What Is a Configurable Effect?
A configurable effect is an optimized rendering effect designed for Windows, Xbox 360, and Windows Phone. A configurable effect is created using a built-in object with options for user configuration.
What Is an Effect?
An effect initializes the graphics pipeline for performing transforms, lighting, applying textures, and adding per-pixel visual effects such as a glow or a lens flare. Under the covers, an effect implements at least one shader for processing vertices and at least one shader for processing pixels.
What Is a Profile?
A profile is a feature set that is implemented in hardware. The Reach profile implements high-level shader language (HLSL) Shader Model 2.0 and the HiDef profile implements HLSL Shader Model 3.0.
What Is Rasterizer State?
Rasterizer state determines how to render 3D data such as position, color, and texture onto a 2D surface.
What Is a Render Target?
A render target is a memory buffer for rendering pixels. One common use for a render target is offscreen rendering.
What Is Sampler State?
Sampler state determines how texture data is sampled using texture addressing modes, filtering, and level of detail.
What Is a View Frustum?
A view frustum is a 3D volume that defines how models are projected from camera space to projection space. Objects must be positioned within the 3D volume to be visible.
What Is a Viewport?
A viewport is a 2D rectangle that defines the size of the rendering surface onto which a 3D scene is projected.

New Samples Upgraded to XNA Game Studio 4.0

Drawing 3D Primitives using Lists or Strips
Demonstrates how to draw 3D primitives using lines and triangles arranged as strips or lists.
Using a Basic Effect with Texturing
Demonstrates how to create and draw a simple quad—two triangles that form a rectangle or square—using DrawUserIndexedPrimitives.
Creating a Custom Effect
Demonstrates how to create a custom effect that transforms an object and applies a texture.
Loading Content from a Game Library
Demonstrates how to load content from a game library.
Animating a Sprite
Demonstrates how to animate a sprite from a texture using a custom class.
What Is a Sprite?
Summarizes the basics of using sprites.
Drawing a Masked Sprite over a Background
Demonstrates how to draw a foreground and background sprite using the SpriteBatch class, where only part of the foreground sprite masks the background.
Drawing Text with a Sprite
Demonstrates how to import a SpriteFont into a project and to draw text using DrawString.
Making a Scrolling Background
Demonstrates how to draw a scrolling background sprite using the SpriteBatch class.
Rotating a Sprite
Demonstrates how to rotate a sprite around its center.
Rotating a Group of Sprites
Demonstrates how to rotate a group of sprites around a single point using a rotation Matrix.
Scaling a Sprite
Demonstrates how to scale a sprite using a uniform scale.
Scaling Sprites Based On Screen Size
Demonstrates how to scale sprites using a matrix that is created based on the viewport width.
Tinting a Sprite
Demonstrates how to tint a sprite using a Color value.
Dynamically Updating Vertices
Describes several techniques for implementing dynamic vertex buffers in an XNA Framework game.


Hardware and Operating System Requirements

Hardware and Operating System Requirements

This topic describes the operating systems that fully support XNA Game Studio, and the computing hardware you need to use XNA Game Studio.

Supported Operating Systems

The following operating systems fully support XNA Game Studio.

Operating system Supported versions
Windows XP (see remarks below)
  • Home Edition
  • Professional
  • Media Center Edition
  • Tablet PC Edition
Windows Vista
  • Home Basic
  • Home Premium
  • Business
  • Enterprise
  • Ultimate
Windows 7
  • Home Basic
  • Home Premium
  • Professional
  • Enterprise
  • Ultimate

Remarks

  • Microsoft Windows Phone Developer Tools does not support Windows XP.
  • Windows Vista requires, at a minimum, Service Pack 2.
  • Although XNA Game Studio itself is available only in English, it is supported under any of the available language settings on Windows.
  • Administrator permissions are not required to run XNA Game Studio, but they are to install it. For Windows 7 and Windows Vista, elevated administrator permissions are required.

Hardware Requirements

To run XNA Framework games on a computer running a Windows operating system, you need a graphics card that supports, at a minimum, Shader Model 1.1 and DirectX 9.0c. We recommend using a graphics card that supports Shader Model 2.0, which is required by some samples and starter kits.

To execute and debug XNA Framework games for Windows Phone with the Windows Phone emulator, you need a graphics card that supports, at minimum, DirectX 10, with a supporting WDDM 1.1 driver.

Ensure your graphics card is using the latest driver. Check with your hardware vendor or access Microsoft Update to find the latest version of a driver.

To develop XNA Framework games for Xbox 360, you will need to have a hard drive installed on your Xbox 360 console.

Other hardware requirements for XNA Game Studio are identical to those for Microsoft Visual Studio 2010. For information on Microsoft Windows Phone Developer Tools requirements, see the Microsoft Windows Phone Developer Tools documentation..


Software Install Requirements

Software Install Requirements

This topic describes the software required to use XNA Game Studio 4.0.

XNA Game Studio 4.0

To download XNA Game Studio 4.0 itself, go to the Creators Club Online.

Microsoft Visual Studio 2010

XNA Game Studio 4.0 leverages the Microsoft Visual Studio 2010 development environment, extending it for game development. XNA Game Studio 4.0 works with any of the following Microsoft Visual Studio 2010 products.

  • Microsoft Visual Studio 2010 Express for Windows Phone
  • Microsoft Visual C# 2010 Express Edition
  • Microsoft Visual Studio 2010 Standard Edition
  • Microsoft Visual Studio 2010 Professional Edition

Microsoft Visual Studio 2010 Express for Windows Phone and XNA Game Studio 4.0 are only available as part of the Microsoft Windows Phone Developer Tools. You can install Microsoft Windows Phone Developer Tools from the Microsoft Windows Phone Developer Tools website.

Note
Only members of the Microsoft Visual Studio 2010 product line support XNA Game Studio 4.0. XNA Game Studio 4.0 is incompatible with Visual Studio 2008 or previous editions.

Microsoft .NET Framework 4.0

XNA Game Studio requires the Microsoft .NET Framework 4.0. The setup program for Microsoft Windows Phone Developer Tools installs the .NET Framework if it is not installed already on your computer. You also can install the .NET Framework from the Microsoft .NET Framework Developer Center.

Additional Required Software Installed by Setup

The XNA Game Studio setup program also installs the following required software.

DirectX Runtime

XNA Game Studio setup installs the DirectX runtime, which is required to use the XNA Framework Game API.

Microsoft Cross-platform Audio Creation Tool

XNA Game Studio Setup installs multiple versions of the Microsoft Cross-platform Audio Creation Tool (XACT). You can use XACT to author audio content for your game. Games written using XNA Framework 3.1 and later are required to use XACT 3 projects, which are not backward compatible. Games written using XNA Framework 3.0 are required to use XACT 2 projects.

Games for Windows - LIVE

XNA Game Studio Setup installs Microsoft Games for Windows – LIVE Redistributable, version 2.0.687.0. This software provides support for various gamer services such as retrieving player preferences for local accounts, as well as programmatically displaying various LIVE Guide user interface screens.


Software Installation Notes

Software Installation Notes

XNA Game Studio 4.0 leverages the Microsoft Visual Studio 2010 development environment, extending it for game development. It can be installed as a discrete setup component, or as part of the Microsoft Windows Phone Developer Tools setup.

Microsoft Windows Phone Developer Tools Setup

The Microsoft Windows Phone Developer Tools provide a complete development package for Windows Phone. It includes Microsoft Visual Studio 2010 Express edition, as well as all project templates and assemblies for developing Windows Phone applications.

Microsoft Windows Phone Developer Tools setup also installs XNA Game Studio 4.0. In addition to the XNA Game Studio 4.0 components for developing Windows and Xbox 360 games and game libraries, the Microsoft Windows Phone Developer Tools install extensions to develop games and game libraries for Windows Phone.

After the Microsoft Windows Phone Developer Tools package is installed, all supported versions of Visual Studio 2010 will include XNA Game Studio project templates for the following platforms:

  • Windows Games
  • Windows Game Libraries
  • Xbox 360 Games
  • Xbox 360 Game Libraries
  • Windows Phone Games
  • Windows Phone Game Libraries
  • Content Pipeline Libraries

These XNA Game Studio 4.0 project templates will also be available in all installed editions of Microsoft Visual Studio 2010.

Multiple Editions of Microsoft Visual Studio 2010

Windows will support multiple editions (Professional or Express) of Microsoft Visual Studio 2010 installed on the same computer. This includes the Express edition of Visual Studio installed as part of the Microsoft Windows Phone Developer Tools.

After XNA Game Studio 4.0 or the Microsoft Windows Phone Developer Tools package is installed, associated project templates and assemblies are available in all installed versions of Microsoft Visual Studio 2010.

Side-by-side Installations of XNA Game Studio

It is possible to have both XNA Game Studio 4.0 and previous versions of XNA Game Studio (such as XNA Game Studio 3.1) installed on the same computer without conflict.

This is possible in part because XNA Game Studio 4.0 is compatible only with Visual Studio 2010, while earlier versions of XNA Game Studio are compatible only with a previous edition of Visual Studio. To install (or retain) an earlier version of XNA Game Studio, the compatible edition of Visual Studio must also be (or remain) installed. The project templates and assemblies for the older version of XNA Game Studio will only be available in that edition of Visual Studio.

For example, XNA Game Studio 3.1 requires Visual Studio 2008. To create and build XNA Game Studio 3.1 games, you will use Visual Studio 2008. Creating and building XNA Game Studio 4.0 games can be performed only within Visual Studio 2010.


Setting up your Firewall

Setting up your Firewall

The XNA Game Studio setup program adjusts Windows Firewall settings to allow the XnaTransX.exe application to send and receive network traffic. This is necessary for your Windows-based development computer to communicate with the Xbox 360 console. Similarly, the setup program adjusts Windows Firewall settings for the XnaLiveProxy.exe application to enable network communications for networked games.

If you are using a firewall product other than Windows Firewall—that is, any third-party firewall—you will need to configure this firewall to allow XnaTransX.exe and XnaLiveProxy.exe to send and receive network traffic. Some firewall products enable you to unblock entire applications, some enable you to unblock specific ports, and some, such as Windows Firewall, enable you to do both.

To unblock the entire XnaTransX.exe application, specify the following executable:

<install dir>\Common Files\Microsoft Shared\XNA\XnaTrans\v4.0\XnaTransX.exe

For the XnaLiveProxy.exe application, specify the following executable:

<install dir>\Microsoft XNA\XNA Game Studio\v4.0\Bin\XnaLiveProxy.exe
Note
In the above paths, <install dir> refers to the directory in which XNA Game Studio is installed. By default, this directory is %ProgramFiles%.

To unblock specific ports, configure your firewall using the following information.

Application | Port | Protocol | Inbound or outbound
XnaTransX.exe | 1001 | TCP | outbound
XnaTransX.exe | 1001 | UDP | inbound/outbound
XnaTransX.exe | 3825 | UDP | inbound/outbound
XnaTransX.exe | 3835 | UDP | inbound/outbound
XnaLiveProxy.exe | 1000 | UDP | inbound/outbound
XnaLiveProxy.exe | 3074 | UDP | inbound/outbound

Firewall Settings for Connectivity to Xbox LIVE

You may also need to unblock ports on firewall devices between your Xbox 360 console and the external network to allow the console to connect to the Xbox LIVE service. For more information, see the following Knowledge Base article: Xbox 360: Port settings for Xbox LIVE.


Getting Additional Help

Getting Additional Help

If you need more help in developing with the XNA Framework, here are some additional resources.

Setting Up Your Xbox 360 Console to Run Games Created with XNA Game Studio

For help with obtaining XNA Game Studio Connect and an XNA Creators Club membership, or with connecting your computer to an Xbox 360 console, contact Xbox 360 customer support.

http://www.xbox.com/support/contact

Xbox 360 customer support for help developing games in XNA Game Studio is not provided.

Developing Games with XNA Game Studio

There are many resources available for help developing games with XNA Game Studio.

Resource | Description
XNA Creators Club Online | Your primary information source for developing games with XNA Game Studio.
XNA Creators Club Online Forums

Ask questions and exchange ideas with other game developers. The game development forums include forums specifically for XNA Game Studio and the XNA Framework, and for game design and other topics.

XNA Developer Center on MSDN | The MSDN site for XNA Game Studio.
XNA Game Studio blog

The XNA Game Studio blog is a great place to keep up to date with the latest information from the XNA Game Studio team. Learn about:

  • What the team is working on, including feature roadmaps.
  • Insights into the people on the XNA Game Studio team.
  • Why and how decisions are made about the product.
  • Responses to questions and comments from the community.
  • Pointers to cool articles and information about XNA Game Studio and Xbox LIVE Indie Games.
  • Tips and tricks for using XNA Game Studio.
MSDN Library | The MSDN Library is an essential resource for developers using Microsoft tools, products, and technologies. It contains technical programming information, sample code, documentation, technical articles, and reference guides.

Reporting Issues and Making Suggestions

To report an issue with XNA Game Studio or the XNA Framework, or to suggest how these products could be improved, use the appropriate link available at Microsoft Connect: XNA Game Studio.


Getting Started with XNA Game Studio Development

Getting Started with XNA Game Studio Development

XNA Game Studio is an integrated development environment designed to make it easier to develop games for Microsoft Windows, Xbox 360, and Windows Phone. XNA Game Studio extends Microsoft Visual Studio with support for the XNA Game Studio Framework and tools. The XNA Game Studio Framework is a managed-code class library that contains features targeted specifically at game development. In addition, XNA Game Studio includes tools for adding graphic and audio content to your game.

The XNA Game Studio Framework is designed to follow the .NET Framework in its design patterns and idioms. With XNA Game Studio, you can use both the XNA Game Studio Framework and the more general .NET Framework for game development.

This section provides introductory information about developing games with XNA Game Studio.

In This Section

Your First Game - XNA Game Studio in 2D
Describes the steps necessary to create a simple sprite-based game by using XNA Game Studio.
Creating a Windows Game or Library Project
Describes how XNA Game Studio includes a set of project templates that will help you to develop Windows-based projects using the XNA Framework.
Developing Cross-Platform Games
Describes how XNA Game Studio and the XNA Framework facilitate the development of games that work on several platforms.
Developing Xbox 360 Games
Describes how to develop games for the Xbox 360. Although there are several notable differences, Xbox 360 game development is similar to Windows game development.
Developing Windows Phone Games
Describes how to develop games for Windows Phone.
How to: Change the Game Name
Describes how to change the name of the game that is displayed on the platform device.
Troubleshooting XNA Game Studio Projects
Provides some helpful troubleshooting tips for XNA Game Studio projects.
Upgrading XNA Game Studio Projects
Describes supported and unsupported XNA Game Studio project versions, provides guides for upgrade scenarios, and offers advice on troubleshooting upgrade issues.


Your First Game - XNA Game Studio in 2D

Your First Game - XNA Game Studio in 2D

Follow these steps to create a simple sprite-based game by using XNA Game Studio. This sample code works on all platforms, including Windows Phone.

Note
A sprite is a simple 2D graphic (such as a bitmap) that is displayed on the screen using a call to SpriteBatch.Draw.
  • Step 1: Install Your Software
  • Step 2: Create a New Project
  • Step 3: View the Code
  • Step 4: Add a Sprite
  • Step 5: Make the Sprite Move and Bounce
  • Step 6: Explore!

The Complete Sample

The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

Download MyFirstGame_Tutorial_Sample.zip.

Step 1: Install Your Software

Before you begin, make sure that you have installed all the necessary software, including a supported version of Microsoft Visual Studio tools and XNA Game Studio. See Software Install Requirements for a list of required programs.

Step 2: Create a New Project

  1. From the Start menu, click All Programs, click the XNA Game Studio 4.0 folder, and then click your supported version of Microsoft Visual Studio tools.

  2. When the Start Page appears, click the File menu, and then click New Project.

    A dialog box appears with a tree list on the left pane, marked Project Types.

  3. Select the XNA Game Studio 4.0 tree node underneath the Visual C# node.

    A set of available projects appears in the right pane.

  4. In the right pane of the dialog box that appears, click Windows Game (4.0), and then type a title for your project (such as "MyFirstGame") in the Name box.

  5. Type a path where you'd like to save your project in the Location box, and then click OK.

    After creating a new project, you'll be presented with the code view of your game.

Step 3: View the Code

Some of the hard work has already been done for you. If you build and run your game now, the GraphicsDeviceManager will set up your screen size and render a blank screen. Your game will run and update all by itself. It's up to you to insert your own code to make the game more interesting.

Much of the code to start and run your game has already been written for you. You can insert your own code now.

  • The Initialize method is where you can initialize any assets that do not require a GraphicsDevice to be initialized.
  • The LoadContent method is where you load any necessary game assets such as models and textures.
  • The UnloadContent method is where any game assets can be released. Generally, no extra code is required here, as assets will be released automatically when they are no longer needed.
  • The Update loop is the best place to update your game logic: move objects around, take player input, decide the outcome of collisions between objects, and so on.
  • The Draw loop is the best place to render all of your objects and backgrounds on the screen.

Step 4: Add a Sprite

The next step is to add a graphic that can be drawn on the screen. Use a small graphics file, such as a small .bmp or .jpg file. Be creative—you can even make your own. You can even skip ahead a bit and make a sprite that "hides" parts that should not be seen (such as edges or corners) so that it looks even better.

Once you have a graphic picked out on your computer, follow these steps.

  1. Make sure you can see the Solution Explorer for your project on the right side of the window. If you cannot see it, click the View menu, and then click Solution Explorer.

    When it appears, you will see files associated with your project in a tree structure. Inside the tree, you will see a node named Content.

  2. Right-click the Content node, click Add, click Existing Item, and then browse to your graphic.

    If you can't see any files, make sure you change the Files of type selection box to read Texture Files.

  3. Click the graphic file, and then click Add.

    An entry for the graphic file will appear in Solution Explorer.

  4. Click the entry for the graphic in the Solution Explorer. If you do not see the entry, ensure the Content node is expanded by clicking the small plus sign (+) to the left of the node, and then click on the entry that appears underneath the Content node.

    When you add a graphic file, it is added automatically to the XNA Framework Content Pipeline. This allows you to quickly and easily load the graphic into your game.

    In the Properties window below Solution Explorer, look for the "Asset Name" property. Note the name; you'll use it in your code to load the graphic so it can be displayed in your game.

  5. If the Properties window is not visible, press F4, or click the View menu, and then click Properties Window.

    Now, you must write code that loads and displays the sprite on the screen.

  6. Back in the Code view of your game, find the LoadContent method, and add the following lines in and above the method so it looks similar to this:

    C#
    // This is a texture we can render.
Texture2D myTexture;

// Set the coordinates to draw the sprite at.
Vector2 spritePosition = Vector2.Zero;

protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);
    myTexture = Content.Load<Texture2D>("mytexture");
}

    The Content property of the parent Game class offers the ContentManager class through which your game assets can be loaded.

    Make sure the call to Content.Load is using the "Asset Name" you saw in the Properties window in the previous step. This code will load and prepare your graphic to be drawn, and will reload your graphic if the graphics device is reset (such as in the case of the game window being resized).

  7. Now, add code to the Draw loop so it looks like this:

    C#
    protected override void Draw(GameTime gameTime)
{
    graphics.GraphicsDevice.Clear(Color.CornflowerBlue);

    // Draw the sprite.
    spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
    spriteBatch.Draw(myTexture, spritePosition, Color.White);
    spriteBatch.End();

    base.Draw(gameTime);
}

    This code draws the sprite on the screen each frame.

    Notice the parameter passed by the Begin method, BlendState.AlphaBlend. This parameter tells the Draw method to use the alpha channel of the source color to create a transparency effect so that the destination color appears through the source color.

  8. Build and run your game.

    The sprite appears.

Now, it's time to give it some motion.

Step 5: Make the Sprite Move and Bounce

  • Change the lines of code in the Update method to read this way:

    C#
    void UpdateSprite(GameTime gameTime)
{
    // Move the sprite by speed, scaled by elapsed time.
    spritePosition +=
        spriteSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;

    int MaxX =
        graphics.GraphicsDevice.Viewport.Width - myTexture.Width;
    int MinX = 0;
    int MaxY =
        graphics.GraphicsDevice.Viewport.Height - myTexture.Height;
    int MinY = 0;

    // Check for bounce.
    if (spritePosition.X > MaxX)
    {
        spriteSpeed.X *= -1;
        spritePosition.X = MaxX;
    }

    else if (spritePosition.X < MinX)
    {
        spriteSpeed.X *= -1;
        spritePosition.X = MinX;
    }

    if (spritePosition.Y > MaxY)
    {
        spriteSpeed.Y *= -1;
        spritePosition.Y = MaxY;
    }

    else if (spritePosition.Y < MinY)
    {
        spriteSpeed.Y *= -1;
        spritePosition.Y = MinY;
    }
}

This adds a little bit of logic that will move the sprite around each frame and cause the sprite to change direction if it hits the edges of the game window.

  • Build and run your game.

The sprite moves across the screen and changes direction when it encounters the edges of the game window.

Step 6: Explore!

From here, you can do just about anything.

Here are some more ideas to extend this sample:

  • Add a second sprite, and use BoundingBox objects to detect collisions.
  • Use Keyboard, Mouse, or GamePad to make the sprite respond to movements of an input device. (See Overview of User Input and Input Devices.)
  • Create some audio events so that the sprite makes sounds as it moves. (See Adding a Sound File (XACT) and Playing Sounds from an XACT Project.)
  • Get more ideas and resources at XNA Creators Club Online.


Creating a Windows Game or Library Project

Creating a Windows Game or Library Project
See Also
CollapseAll image

Describes how XNA Game Studio includes a set of project templates that will help you to develop Windows-based projects using the XNA Framework.

Starting a New Project

To start a new project

  • To begin a new Windows-based project, click File, and then click New Project.

    A dialog box appears and lists a number of project templates.

XNA Game Studio provides template types for XNA Framework game development in the XNA Game Studio 4.0 section of the Visual C# project types. The templates offered for developing XNA Framework games for Windows are:

  • Windows Game (4.0)–A project for creating an XNA Framework 4.0 game application for Windows.
  • Windows Game Library (4.0)–A project for creating an XNA Framework 4.0 game library for Windows.
  • Content Pipeline Extension Library (4.0)–A project for creating an XNA Framework 4.0 Content Pipeline Extension Library.

Windows Game (4.0)

XNA Game Studio provides a Windows Game (4.0) template that creates and loads a set of starter files. This new project contains basic code that implements a simple, framed window with a colored background.

To create a Windows Game (4.0) project

  1. On the File menu, click New Project.

  2. Select the Windows Game (4.0) project type.

  3. Type the name for the game project in the Name box.

    You can also modify the default values for the Location and Solution Name controls.

  4. Click OK to create and load the new project.

Results

The new starter project contains the following important features.

Project Properties

These properties control many aspects of your current project. Some examples include general application settings, debug settings, and additional project resources. You can use the Project Designer to modify the values for these properties.

In addition to these properties, assembly information (such as the game title) is stored in the AssemblyInfo.cs file. You can use the Assembly Information dialog box to modify this information, or you can manually edit the .cs file.

References

References to the following assemblies are added automatically to a new game project.

  • Microsoft.Xna.Framework
  • Microsoft.Xna.Framework.Avatar
  • Microsoft.Xna.Framework.Game
  • Microsoft.Xna.Framework.GamerServices
  • Microsoft.Xna.Framework.Graphics
  • Microsoft.Xna.Framework.Net
  • Microsoft.Xna.Framework.Storage
  • Microsoft.Xna.Framework.Video
  • Microsoft.Xna.Framework.Xact
  • mscorlib
  • System
  • System.Core
  • System.Xml
  • System.Xml.Linq

In addition to these standard assemblies, you can add assemblies as needed for your project.

Content References

The content references node specifies the content projects whose assets will be used by the game on this platform. For more information, see Game Content Project.

Game.ico File

A 32 × 32 default icon representing your game.

Game1.cs File

This file is a good starting point for adding simple game logic and basic features. It implements a single class (derived from Game and called Game1), and it overrides five methods: LoadContent, UnloadContent, Initialize, Draw, and Update. In addition, the Game1 constructor is defined. Use these methods to initialize your game components, to load and render your game content, and to handle any input from the user or changes to the game environment.

GameThumbnail.png

The icon appears in the Games Library, and when a game is packed for distribution as a .ccgame.

For more information about distribution, see Sharing Your Game Package.

Program.cs File

This file also implements a single class (called Program) that provides an entry point to game execution. Usually, little code is added to this file unless the game is fairly advanced.

Content Project

The content project occupies a parallel position with the game project in the solution, and it stores and builds art assets for the game. For more information, see Game Content Project.

Windows Game Library (4.0)

XNA Game Studio provides a Windows Game Library (4.0) template that creates and loads a set of starter files. Typically, projects of this type contain managed classes that implement basic or advanced features used by a game engine or 3D renderer. Once completed, these class libraries can be referenced by other Windows projects. They provide common functionality without having that code reside within the game project.

The new project contains basic code that implements an empty library, usable by other Windows Game projects or Windows Game libraries.

Results

The new starter project contains the following important features.

Project Properties

These properties control many aspects of your current project. Some examples include general application settings, debug settings, and additional project resources. You can use the Project Designer to modify the values for these properties.

In addition to these properties, assembly information (such as the library title) is stored in the AssemblyInfo.cs file. This information can be modified using the Assembly Information dialog box or by manually editing the .cs file.

References

References to the following assemblies are added automatically to a new Windows Game Library project:

  • Microsoft.Xna.Framework
  • Microsoft.Xna.Framework.Avatar
  • Microsoft.Xna.Framework.Game
  • Microsoft.Xna.Framework.GamerServices
  • Microsoft.Xna.Framework.Graphics
  • Microsoft.Xna.Framework.Net
  • Microsoft.Xna.Framework.Storage
  • Microsoft.Xna.Framework.Video
  • Microsoft.Xna.Framework.Xact
  • mscorlib
  • System
  • System.Core
  • System.Xml
  • System.Xml.Linq

In addition to these standard assemblies, you can add other assemblies as needed for your project.

Content

The nested content project stores and builds content that is to be included in the game library. This is useful for including reusable content assets that support the classes and methods in the game library. For more information, see Game Content Project.

Class1.cs File

This file implements an empty C# class within a namespace. This provides a starting point for the class library.

To create a Windows Game Library (4.0) project

  1. On the File menu, click New Project.

  2. Select the Windows Game Library (4.0) project type.

  3. Type the name for the library project in the Name box.

    You can also modify the default values for the Location and Solution Name controls.

  4. Click OK to create and load the new project.

Content Pipeline Extension Library (4.0)

XNA Game Studio provides a Content Pipeline Extension Library (4.0) template that creates and loads a set of starter files. The template provides a starting point for developers wishing to create their own custom importers and processors for their game content. For more information about the XNA Framework Content Pipeline, and about content processors in general, see Adding Content to a Game.

Note
Content Pipeline Extension Library projects require .NET Framework 3.5. This version of the .NET Framework must be selected in the combo box in the upper-right corner of the New Project dialog box. Otherwise, the Content Pipeline Extension Library (4.0) template will not be presented. The .NET Framework 3.5 is the default selection.

The new project contains basic code that implements an empty processor, usable by the XNA Framework Content Pipeline. Solution configurations for all available platforms are created automatically. This means that the Content Pipeline extension project builds processors and importers for any available platform without any change to the project.

Note
A solution configuration determines which project configurations are active, as well as which projects are built and deployed when you invoke the Build and Run commands. By default, if a project does not have a configuration that matches the active solution configuration, the solution build will skip that project.

In addition to the project template, there are additional code templates related to projects of this type. You can use the Add New Item dialog box to add these items to your project. Here are some basic descriptions:

Content Processor item

An item template comprised of a single code file (called ContentProcessorN.cs). The numerical suffix (N) guarantees uniqueness within the project. This file is similar to the ContentProcessor1.cs file created for the Content Pipeline Extension Library (4.0) template. The file declares a class derived from ContentProcessor with an override of the abstract Process method.

Content Importer item

An item template comprised of a single code file called ContentImporterN.cs. The numerical suffix (N) guarantees uniqueness within the project. The file declares a class derived from ContentImporter with an override of the abstract Import method.

Content Type Writer item

An item template comprised of a single code file called ContentTypeWriterN.cs. The numerical suffix (N) guarantees uniqueness within the project. The file declares a class derived from ContentTypeWriter with overrides of the abstract Write and GetRuntimeReader methods.

Content Type Reader item

An item template comprised of a single code file called ContentTypeReaderN.cs. The numerical suffix (N) guarantees uniqueness within the project. The file declares a class derived from ContentTypeReader with an override of the abstract Read method.

Unlike the Content Type Writer item, this item is unavailable when adding a new item to a Content Pipeline Extensions Library project. It is only available for game or game library projects.

Whenever items of this type are added to a project, references to any dependent assemblies are added automatically. These references include assemblies that are likely to be required when customizing the newly-added class.

Results

The new starter project contains the following important features.

Project Properties

These properties control many aspects of your current project. Some examples include general application settings, debug settings, and additional project resources. You can modify the values for these properties using the Project Designer.

In addition to these properties, assembly information (such as the library title) is stored in the AssemblyInfo.cs file. This information can be modified using the Assembly Information dialog box or manually editing the .cs file.

References

References to the following assemblies are added automatically to a new Content Pipeline Extension Library project:

  • Microsoft.Xna.Framework
  • Microsoft.Xna.Framework.Content.Pipeline
  • Microsoft.Xna.Framework.Game
  • System
  • System.Core
  • System.Xml
  • System.Xml.Linq

In addition to these standard assemblies, you can add other assemblies as needed for your project.

ContentProcessor1.cs File

This file implements an empty C# processor within a namespace, providing a starting point for the custom content processor.

To create a Content Pipeline Extension Library (4.0) project

  1. On the File menu, click New Project.

  2. Select the Content Pipeline Extension Library (4.0) project type.

  3. Type the name for the library project in the Name box.

    You can also modify the default values for the Location and Solution Name controls.

  4. Click OK to create and load the new project.

Expand image See Also

Getting Started with XNA Game Studio Development
Sharing Your Game Package


Developing Cross-Platform Games

Developing Cross-Platform Games

Describes how XNA Game Studio and the XNA Framework facilitate the development of games that work on several platforms.

This section discusses how you can use the features of XNA Game Studio to develop cross-platform games.

In This Section

Creating Cross-Platform Games
Describes how Game Studio facilitates developing a game that will run on multiple platforms.
Cross-Platform Game Project Converter
Describes how XNA Game Studio facilitates the process of converting a game for Windows, Xbox 360, or Windows Phone to any of the other two game platforms.
Managing Cross-Platform Builds and Deployment
Describes how to build and deploy individual projects within a cross-platform solution.
Cross-Platform Conditional Compilation Symbols
Describes the conditional compilation variables available for maintaining common source code in XNA Game Studio cross-platform projects.
Platform Defaults
Describes the default properties for projects on each platform.
How to: Create a Cross-Platform Game Solution
Demonstrates how to create a cross-platform solution and manage game assets between platform projects.

Expand image See Also

Getting Started with XNA Game Studio Development


Creating Cross-Platform Games

Creating Cross-Platform Games

The XNA Framework makes it easy to develop a game with rich play on any Microsoft platform. Even better, once your game works on one platform, it can run on any other platform supported by the XNA Framework by using the same base source code with minimal changes. For example, the same XNA Framework game could be built for multiple platforms: to be played on a computer running Windows, to be downloaded to an Xbox 360 console, and to load onto a Windows Phone device.

XNA Game Studio provides several features that facilitate development and management of games designed to run on multiple platforms.

Structure of a Cross-Platform Game in Game Studio

When you develop a game to run on multiple platforms, there must be a separate project for each platform. Each project may reference the same source code files and game asset files, but building each project creates an executable that can run on its designated platform.

Method 1: A Solution File for Each Platform.

One approach to maintaining separate projects for each platform might be to create a solution file for each supported platform, with each having its own single project. If the projects in each solution reference the same source and game asset files, changes to those files are reflected in each solution.

A drawback to this method is that each solution must be maintained separately. When you make changes—such as adding new source and game asset files, and renaming or removing items—to a project in one solution, those same changes are not reflected automatically in other solutions.

Method 2: A Solution File with Multiple Projects

A cross-platform game is best maintained as multiple projects within a single solution so that Game Studio can more easily synchronize changes across all platforms.

For example, the Game Studio solution for MyGame might include a project folder for a:

  1. Windows version of MyGame.
  2. Xbox 360 version of MyGame.
  3. Windows Phone version of MyGame.

Each project references the same C# code files and game asset file, but each builds a version that can execute on the intended platform.

When you use the Cross-Platform Conversion Wizards to create these parallel projects, the project created is linked to the original project.

Managing Platform-Specific Content

Source code and game asset files should be shared for all platforms as much as possible. However, some files may need to have unique versions for different platforms. This requirement occurs most frequently for game assets in the Content Pipeline. For example, to produce the highest quality images, graphic files for a game designed to run on the Xbox 360 platform may be high-resolution bitmaps. The Windows Phone platform, however, has a smaller screen and supports lower-resolution graphics. For this reason, your game projects are likely to reference differing game assets that are appropriate to each platform—large, high-resolution graphics for the Xbox 360, and small, low-resolution graphics for Windows Phone.

At the same time, your game may still have content assets, such as menus, that are shared across all platforms. For these assets, it is still useful for each project to maintain a content project folder that is synchronized across all platform projects. To accommodate this, a Game Studio solution may contain multiple content projects. One content project folder might contain the shared assets. Subsequent content project folders may contain game assets specific to a platform.

Which content project folders each platform uses is specified in its code project's Content References folder. In this example, the Content References folder for all code projects references the content project folder that contains all shared content. The Content References folders for the Xbox 360 and Windows Phone code projects each reference only the content projects that hold content specific to their platforms.

The topic How to: Create a Cross-Platform Game Solution demonstrates how this can be used to manage platform-specific content across multiple platforms.

You can create several content project folders within an XNA Game Studio solution. You are not restricted to the two described in our example. If you find it convenient to maintain more, Game Studio permits it.

Expand image See Also

Developing Cross-Platform Games


Cross-Platform Game Project Converter

Cross-Platform Game Project Converter

The conversion process creates a new game project of the appropriate type. The new game project is created in the same folder as the source project and shares content and settings from the original game project.

  • Limitations of Game Conversion
  • Cross-Platform Game Conversion
  • Changes Made to a Project During Conversion
  • Linked Projects After Conversion
  • References the Conversion Utility Cannot Replace
  • Changes that May Be Necessary After Conversion

Limitations of Game Conversion

The conversion utility is not meant to be an end-to-end conversion, but it greatly simplifies the process of converting a game to the corresponding platform. Specific code changes, however, are still required. For example, if a Windows game is controlled by the keyboard and mouse, the converted game is not changed to respond to an Xbox 360 game controller. You can use the cross-platform conditional compilation symbols to create sections of code that execute only on the appropriate platform.

Cross-Platform Game Conversion

To convert a game for another platform

  1. Load the game into a supported version of Visual Studio tools.

  2. On the Project menu, select the Create Copy of [project name] item (where the [project name] is the name of the game project).

    The presented items in the Project menu vary according to the designated platform of the currently selected project:

    Windows Xbox 360 Windows Phone

    Create Copy of [Project Name] for Xbox 360

    Create Copy of [Project Name] for Windows Phone

    Create Copy of [Project Name] for Windows

    Create Copy of [Project Name] for Windows Phone

    Create Copy of [Project Name] for Windows

    Create Copy of [Project Name] for Xbox 360

    When complete, a new version of the game project is added to your solution. It is named for the platform (for example, Xbox 360 Copy of [Project Name] or Windows Copy of [Project Name]). The new game project is selected.

  3. Press F2 if you want to rename the project from the name given by the conversion utility.
Note

The solution may only contain one copy of a project for each platform. Nonconforming solutions are unable to correctly synchronize projects and produce an error message during conversion.

Changes Made to a Project During Conversion

  • All references to XNA Framework assemblies are replaced by their equivalents for the other platform.
  • All original configurations are replaced by default configurations for the new platform.
  • The XnaPlatform project property changes to that of the new platform.
  • The Content Build Compression properties are set to the default values for the new platform.
  • The ProjectGuid property is replaced. This is not the same as the GUID assembly attribute (usually found in AssemblyInfo.cs), which is not changed.
  • The default Platform property and project output type settings are replaced with values for the appropriate target platform.
  • Establishes the Game Profile and C# version settings for each game project according to the platform defaults.

Linked Projects After Conversion

The new project created by the conversion wizard shares code, content, and settings from the original game project through links.

Projects copied through the conversion wizard are linked so that:

  • An item or folder added to any project is also added to the other projects.
  • An item or folder renamed in any project is also renamed in the other projects.
  • An item or folder deleted from any project is also deleted from the other projects.

All other actions not specifically cited above are not synchronized between projects. Of particular note, this includes the following actions:

  • Excluding an item from a project has no effect on other projects. This is useful for items that are inappropriate for one or more platforms, yet needed for another platform (or platforms). For an example, see How to: Create a Cross-Platform Game Solution.

  • Changing properties in a project or folder has no effect on other projects.
  • Adding or deleting references to content projects in the Content References folder has no effect on other projects.
    Tip

    Folders that are empty (as when they are first created) are not synchronized between projects. Once items are placed into a folder (so that it is no longer empty), the folder is synchronized across all other projects.

References the Conversion Utility Cannot Replace

  • HintPath metadata (added using browse-to-file) and strong name references are changed into simple-named references.

  • Project references to non-XNA Framework projects are deleted.

    Note

    Unlike references to non-XNA Framework projects, all referenced XNA Framework game or game library projects are recursively converted. This means that if an XNA Framework project references another in the solution (with a project-to-project reference), conversion of the referencing project automatically converts the referenced project. The result is the converted copy of the first project referencing the converted copy of the second project.

    For example, if you are converting a Windows game to the Xbox 360 that references a Windows game library in the same solution, conversion also occurs for the Windows game library. After a completed conversion, the result is an Xbox 360 game (a converted copy of the Windows game) that references an Xbox 360 game library (a converted copy of the Windows game library).

  • COM references are deleted. The conversion wizard sends a warning to the output window when this occurs.
  • COM file references are deleted. The conversion wizard sends a warning to the output window when this occurs.

  • Web references are removed, possibly resulting in compile time errors for the converted project. For example, any code that instantiates a Web reference-related class or invokes its methods causes compile-time errors. The conversion wizard sends a warning to the output window when this occurs.

    Caution
    If you need to remove a file from only one project, use the Exclude from Project command rather than the Delete command. The Delete command removes the file from disk, making it inaccessible to the other project.

Changes that May Be Necessary After Conversion

  • In some cases, a converted reference (for example, a strong name reference) may fail to resolve. If this happens, either delete the reference or replace it with a reference to an assembly version for the correct platform. For example, if a reference to System.Data (often added automatically to Windows projects) was converted for the Xbox 360, you must remove it because System.Data are not supported on Xbox 360. However, if the converted reference was to something like a third-party game engine, you might be able to change the reference to an Xbox 360 version of the engine instead.

    If a converted reference is deleted, ensure that any platform-specific code does not depend on that reference.

  • Any code specific to one target platform, for example, mouse-based user input in a Windows game, will not be converted for the other platform. You must manually change this code to use an Xbox 360-compatible input device.

    Other common examples include any settings files (due to missing types), code generated from any Windows Forms in the project, and certain types of resources. For example, string or binary resources are fine, but bitmap resources fail.

  • Usage of APIs that may be incompatible with the Game Profile capabilities of the new platform. For example, a Windows game that calls graphics APIs that function for the HiDef profile will not work after being converted for the platform, which only supports the Reach profile. In this case, further conversion of the code design is needed to use APIs compatible with the lower-capability Reach profile.

  • References to content projects in the Content References folder of the project, if they contain content that is incompatible with the project's platform. For example, an Xbox 360 project may reference content that is too complex for use on Windows Phone. You may wish to create a new content project that contains lower-resolution versions of the same assets for Windows Phone. After copying the Xbox 360 project to a Windows Phone project, change the items in the Content References so that the project uses the content project containing the lower-resolution assets.

Expand image See Also

Developing Cross-Platform Games
Creating a Windows Game or Library Project
Creating an Xbox 360 Game or Library Project
Creating a Windows Phone Game or Library Project


Managing Cross-Platform Builds and Deployment

Managing Cross-Platform Builds and Deployment

When you develop a cross-platform game in XNA Game Studio, your solution is composed of a project for each possible platform. You need to understand how to use the features within Visual Studio that control the particular projects that are built and deployed following the Start (F5) key and Build commands. For example, if you are developing a cross-platform project for both Windows and Xbox 360, you will want to limit game build and deployment solely to the Xbox 360 project when you are trying to develop and debug the Xbox 360 version of the game.

You need to know how to:

  1. Set deployment options to limit builds and deployment to the startup project.
  2. Set one of the projects in your cross-platform solution as the startup project.

You can also use Solution Configuration to control the characteristics of the build.

Setting Deployment Options

You can use the Build and Run settings to limit Start and Build commands to the startup project.

To set Build and Run options

  1. On the Tools menu, click Options.
  2. If you are using Visual C# Express, in the Options dialog box select the Show all settings check box.
  3. In the Options dialog box, expand the Projects and Solutions node, and select Build and Run.

  4. Select the Only build startup projects and dependencies on Run check box (it is cleared by default).

    This setting limits build and deployment to the startup project.

In addition, you may want to set the option that automatically uses the currently selected project as the startup project.

To automatically set the startup project

  • Select the For new solutions use the currently selected project as the startup project check box (it is cleared by default).

    This setting establishes that the currently selected project is the startup project. This option only takes effect for new solutions.

Setting the Startup Project Manually

The startup project is the project (or projects) that are run by Visual Studio when you start the debugger. If you select the Build and Run settings previously described, the Start command (also initiated by the F5 key) is limited to the startup project (or projects). Further, if the startup project is set automatically to the currently selected project, it is not necessary to manually set the startup project.

The startup project name always appears bold in Solution Explorer.

To set the startup project manually

  1. In Solution Explorer, right-click the project you want to set as the startup project.
  2. In the context menu, click Set as StartUp Project.

You also can use Solution Explorer to select the project or, on the Project menu, click Set as StartUp Project to select the project.

Using Solution Configurations

Solution configurations store solution level properties that direct which style of object and executable output are produced by the Start (F5) key and Build commands. In a cross-platform solution in XNA Game Studio, the solution configuration platform setting is a composite of the platform settings for each project in the solution.

The Solution Configuration control in the Visual Studio toolbar establishes the Active (or default) configuration for all projects in the solution. For example, the active configuration may be set to the Debug configuration, which includes all symbol information and minimal compiler optimization, or it may be set to the Release configuration. Changing this setting affects the build of all projects set to the active configuration.

The Solution Platforms control in the Visual Studio toolbar establishes which platform version of the projects in a solution are built and deployed. In a cross-platform solution, options may be Mixed Platforms (that is, all that are specified in the solution configuration), x86 (for Windows), Xbox 360, or Windows Phone. For example, if you set the solution platform to Windows Phone, only the Windows Phone projects in the solution are built and deployed. Xbox 360 or Windows projects are not affected.

Note
This differs from the startup project, which determines which project is run, but not which project is built and deployed. If the Windows project is set as the startup project, but the solution platform is set to Mixed Platforms, all projects are built when you press the F5 key, but only the Windows project executes. Using the previous example, if you change the solution platform setting to Windows Phone, only the Windows Phone project is built, but it does not run. The Windows project is not built, and Visual Studio runs the last built (and perhaps out of date) Windows executable.

To limit Visual Studio to both building and running only the platform version you are currently working on, the solution platform setting should match the platform of the startup project.

To limit action to a specific project

  • In Solution Explorer, right-click the project, and then select the desired action (such as Build, Deploy, or Debug) that appears in the context menu.

Each project may have its own configuration settings, which may override the active configuration. The project's configurations also will specify the target platform (for example, Windows, Xbox 360, or Windows Phone). The platform settings are set automatically for a project when you use the Create Copy command to create the synchronized project for a new platform.

To change project configuration settings

  • In Solution Explorer, right-click the solution, and then click Configuration Manager on the context menu.

    Tip
    You can also start the Configuration Manager by selecting it on the Solution Configurations menu on the toolbar.

Expand image See Also

How to: Add a Game Content Project
Developing Cross-Platform Games


Cross-Platform Conditional Compilation Symbols

Cross-Platform Conditional Compilation Symbols

Describes the conditional compilation variables available for maintaining common source code in XNA Game Studio cross-platform projects.

XNA Game Studio projects define symbols for each compatible platform for use with conditional compilation directives such as #if. You can use this to maintain source code that acts differently on Windows, Xbox 360, or Windows Phone when that source is shared between projects.

The conditonal compilation symbols for each compatible platform are identified in the following table.

Windows platform | Xbox 360 platform | Windows Phone platform
WINDOWS | XBOX or XBOX360 | WINDOWS_PHONE

Usage

Where source code needs to support different actions when executing on different platforms, it should use the XNA Game Studio conditional compilation symbols with the #if, #else and #elif directives.

For example, a game that needs to execute on Windows, Xbox 360, and Windows Phone, but calls different services (such as for input devices) for each platform, might use the directives in a style similar to this:

      #if WINDOWS

      // Execute code that is specific to Windows

      #elif XBOX

      // Execute code that is specific to Xbox 360

      #elif WINDOWS_PHONE

      // Execute code that is specific to Windows Phone

      #else

      // Print a compile-time error message
         #error The platform is not specified or is unsupported by this game.

      #endif

Definition

The Conditional compilation symbols are defined in the Build tab of the Project Designer properties for each project. These symbols are properly established when the XNA Game Studio project is first created or converted for another platform through the conversion wizard.

Expand image See Also

Windows Phone Programming
Xbox 360 Programming Considerations
Developing Cross-Platform Games
EffectProcessor.Process


Platform Defaults

Platform Defaults

This topic describes the default properties for projects on each platform.

When a new project is created from an XNA Game Studio project template, its properties are set according to the platform type:

Platform | Game profile | C# version
Windows | HiDef | 4.0
Xbox 360 | HiDef | 3.0
Windows Phone | Reach | 3.0

When the Create Copy of Project command is used, default properties in the original project are applied to the new, copied project. For example, when a Windows project using the default Game Profile property of HiDef is copied to a Windows Phone project, the Game Profile property of the new Windows Phone project is set to Reach.

Changing Default Properties

The Game Profile property can be changed in the XNA Game Studio Properties Page.

The C# version property can be changed from the Project Properties Designer page as follows:

To change the C# version property

  1. In Solution Explorer, double-click the Properties.

    Or

    On the Project menu, click [project name] Properties.

  2. In the Project Properties Designer dialog box, click the Build tab.

  3. Click the Advanced button at the bottom of the tabbed page.

  4. In the Advanced Build Settings dialog box, change the Language Version setting to the default, and then click OK.

Expand image See Also

Developing Cross-Platform Games


How to: Create a Cross-Platform Game Solution

How to: Create a Cross-Platform Game Solution

This tutorial shows how to create a solution with multiple synchronized projects where each project holds the same base source code, but the object generated from each is targeted to execute on a different XNA Game Studio-compatible platform. It also shows how to create game content projects within each platform project that hold nonsynchronized or partially synchronized content specific to each platform.

The scope of the tutorial is limited to demonstrating how to use the synchronized project features of Visual Studio to manage a cross-platform solution. It does not demonstrate changes to the source code that would likely be needed in order to execute effectively on different platforms.

Creating a Cross-Platform Solution

To create a game solution with multiple projects for Windows, Xbox 360, and Windows Phone

  1. In Solution Explorer, select the MyFirstGame project.

  2. On the Project menu, click Create Copy of MyFirstGame for Xbox 360.

    When complete, a new version of the game project named Xbox 360 Copy of MyFirstGame is added to your solution.

  3. In Solution Explorer, select the MyFirstGame project once again.

  4. On the Project menu, click Create Copy of MyFirstGame for Windows Phone.

    Important

    The menu option to create a copy of a game project for Windows Phone is available only if Microsoft Windows Phone Developer Tools is installed.

    When complete, a new version of the game project named Windows Phone Copy of MyFirstGame is added to your solution.

Creating Platform-Specific Content

Because different devices have different characteristics, you may need to maintain different content that is specific to each platform. In the example below, we create a content project for the Windows Phone project that will contain low-resolution textures compatible with that device. We will also create a content project that contains assets that are shared between the Windows project and the Xbox 360 project. These projects hold high-resolution textures that are compatible with both platforms, but are not part of the Windows Phone project.

To create content projects exclusive to each platform project

  1. In Solution Explorer, right-click the top-level Solution node, select Add, and then click New Project.

  2. In the Add New Project dialog box, select Empty Content Project (4.0), enter PhoneContent as the name for the new content project, and then click OK.

    A new PhoneContent project is added to the solution's root node.

  3. In Solution Explorer, right-click the top-level Solution node, select Add, and then click New Project.

  4. In the Add New Project dialog box, select Empty Content Project (4.0), enter NonPhoneContent as the name for the new content project, and then click OK.

    A new NonPhoneContent project is added to the solution's root node.

  5. The solution now has a NonPhoneContent project that will hold assets for the Windows and Xbox 360 projects, and a PhoneContent project that will hold assets for the Windows Phone project.

To connect platform-specific content projects with their game projects

  1. In Solution Explorer, right-click the Windows Phone Copy of MyFirstGame project, and then click Add Content Reference.

  2. In the Add Content Reference dialog box, select PhoneContent, and then click OK.

    The Windows Phone game project now refers to the PhoneContent project for its game assets.

  3. In Solution Explorer, right-click the MyFirstGame project and then click Add Content Reference.

  4. In the Add Content Reference dialog, select NonPhoneContent, and then click OK.

  5. In Solution Explorer, right-click the Xbox 360 Copy of MyFirstGame project and then click Add Content Reference.

  6. In the Add Content Reference dialog box, select NonPhoneContent, and then click OK.

    Both the Windows and Xbox 360 game projects now commonly refer to the NonPhoneContent project for its game assets.

To populate platform-specific content projects

  1. In Solution Explorer, click and drag the bitmap asset (for example, mytexture.tga) from the Content project to the NonPhoneContent project.

  2. In the MyFirstGameContent project, right-click the bitmap asset (mytexture.tga), and select Exclude From Project.

    The bitmap asset should now be in the NonPhoneContent project referenced by both MyFirstGame and Xbox 360 Copy of My First Game, and no longer in the MyFirstGameContent project.

  3. In Solution Explorer, right-click the PhoneContent project, select Add, and then click Existing Item.

  4. In the Add Existing Item dialog box, select a bitmap file to add (for example, myPhonetexture.tga).

    This bitmap should be of appropriate resolution for the Windows Phone device. You should now have the bitmap asset (mytexture.tga) common to the Windows and Xbox 360 projects in NonPhoneContent and the bitmap asset (myPhonetexture.tga) for Windows Phone in PhoneContent.

  5. Right-click the newly-added file (myPhonetexture.tga), and click Properties.

  6. In the Properties pane, rename the AssetName property to match the same property (for example, mytexture) in the NonPhoneContent project .

    Setting this property to the same value helps the common source code to load the correct asset for the project's platform.

Expand image See Also

Developing Cross-Platform Games


Developing Xbox 360 Games

Developing Xbox 360 Games

Describes how to develop games for the Xbox 360. Although there are several notable differences, Xbox 360 game development is similar to Windows game development.

This section discusses developing Xbox 360 game titles by using the XNA Game Studio development environment.

In This Section

Creating an Xbox 360 Game or Library Project
Describes how XNA Game Studio includes a set of project templates that will help you to develop game projects for Xbox 360 using the XNA Framework.
Deploying an Xbox 360 Game
Describes how XNA Game Studio can copy executable and media files to the Xbox 360 retail console once you are ready to deploy them.
Debugging an Xbox 360 Game
Discusses issues that apply to debugging Xbox 360 games on your retail console.
Using XNA Game Studio Device Center
Describes how to use the XNA Game Studio Device Center.
Connecting to Your Xbox 360 Console with XNA Game Studio 4.0
Describes how to use XNA Game Studio Connect to connect and deploy a game to your Xbox 360 console.
Troubleshooting Xbox 360 Game Deployment
Provides some helpful troubleshooting tips for Xbox 360 deployment if you are unable to establish a successful connection between your computer and your Xbox 360 console.
Xbox 360 Programming
Provides detailed information about the capabilities of the Xbox 360 hardware, and issues to consider when programming games for the Xbox 360 platform.

Expand image See Also

Xbox 360 Programming Considerations
Getting Started with XNA Game Studio Development
Cross-Platform Conditional Compilation Symbols
Firewall


Creating an Xbox 360 Game or Library Project

Creating an Xbox 360 Game or Library Project

Describes how XNA Game Studio includes a set of project templates that will help you to develop game projects for Xbox 360 using the XNA Framework.

Starting a New Project

To start a new project

  • To begin a new Xbox 360 project, click File, and then click New Project.

    You’ll be presented with a dialog box that lists a number of project templates.

XNA Game Studio provides template types for XNA Framework game development in the XNA Game Studio 4.0 section of the Visual C# project types. The templates offered for developing XNA Framework games for Xbox 360 are:

  • Xbox 360 Game (4.0)—A project for creating an XNA Framework 4.0 game application for Xbox 360.
  • Xbox 360 Game Library (4.0)—A project for creating an XNA Framework 4.0 game library for Xbox 360.
  • Content Pipeline Extension Library (4.0)—A project for creating an XNA Framework 4.0 Content Pipeline Extension Library. For more information, see Creating a Windows Game or Library Project.

Xbox 360 Game (4.0)

XNA Game Studio provides an Xbox 360 Game template that creates and loads a set of starter files. This new project contains basic code that renders a colored background.

To create an Xbox 360 game (4.0) project

  1. From the File menu, click New Project.

  2. Select the Xbox 360 Game (4.0) project type.

  3. Type the name for the game project in the Name text box.

    You can also modify the default values for the Location and Solution Name controls.

  4. Click OK to create and load the new project.

Results

The new starter project contains the following important features.

Project Properties

These properties control many aspects of your current project. Some examples include general application settings, debug settings, and additional project resources. You can use the Project Designer to modify the values for these properties.

In addition to these properties, assembly information (such as the game title) is stored in the AssemblyInfo.cs file. You can use the Assembly Information dialog box to modify this information, or you can manually edit the .cs file.

References

References to the following assemblies are added automatically to a new game project.

  • Microsoft.Xna.Framework
  • Microsoft.Xna.Framework.Avatar
  • Microsoft.Xna.Framework.Game
  • Microsoft.Xna.Framework.GamerServices
  • Microsoft.Xna.Framework.Graphics
  • Microsoft.Xna.Framework.Net
  • Microsoft.Xna.Framework.Storage
  • Microsoft.Xna.Framework.Video
  • Microsoft.Xna.Framework.Xact
  • mscorlib
  • System
  • System.Core
  • System.Xml
  • System.Xml.Linq

In addition to these standard assemblies, you can add assemblies as needed for your project.

Content References

The content references node specifies the content projects whose assets will be used by the game on this platform. For more information, see Game Content Project.

Game.ico File

A 32 × 32 default icon representing your game.

Game1.cs File

This file is a good starting point for adding simple game logic and basic features. It implements a single class (derived from Game and called Game1), and it overrides five methods: LoadContent, UnloadContent, Initialize, Draw, and Update. In addition, the Game1 constructor is defined. Use these methods to initialize your game components, to load and render your game content, and to handle any input from the user or changes to the game environment.

GameThumbnail.png

The icon appears in the Games Library, and when a game is packed for distribution as a .ccgame.

For more information about distribution, see Sharing Your Game Package.

Program.cs File

This file also implements a single class (called Program) that provides an entry point to game execution. Usually, little code is added to this file unless the game is fairly advanced.

Content Project

The content project occupies a parallel position with the game project in the solution, and it stores and builds art assets for the game. For more information, see Game Content Project.

Xbox 360 Game Library (4.0)

XNA Game Studio provides an Xbox 360 Game Library (4.0) template that creates and loads a set of starter files. Typically, projects of this type contain managed classes that implement basic or advanced features used by a game engine or 3D renderer. Once completed, these class libraries can be referenced by other Xbox 360 projects, and they provide common functionality without having that code reside within the game project.

The new project contains basic code that implements an empty library, usable by other Xbox 360 Game projects or Xbox 360 Game libraries.

Results

The new starter project contains the following important features.

Project Properties

These properties control many aspects of your current project. Some examples include general application settings, debug settings, and additional project resources. You can use the Project Designer to modify the values for these properties.

In addition to these properties, assembly information (such as the library title) is stored in the AssemblyInfo.cs file. You can use the Assembly Information dialog box to modify this information, or you can manually edit the .cs file.

References

References to the following assemblies are added automatically to a new Xbox 360 Game Library project:

  • Microsoft.Xna.Framework
  • Microsoft.Xna.Framework.Avatar
  • Microsoft.Xna.Framework.Game
  • Microsoft.Xna.Framework.GamerServices
  • Microsoft.Xna.Framework.Graphics
  • Microsoft.Xna.Framework.Net
  • Microsoft.Xna.Framework.Storage
  • Microsoft.Xna.Framework.Video
  • Microsoft.Xna.Framework.Xact
  • mscorlib
  • System
  • System.Core
  • System.Xml
  • System.Xml.Linq

In addition to these standard assemblies, you can add other assemblies as needed for your project.

Content

The nested Content project stores and builds content that is to be included in the game library. This is useful for including reusable content assets that support the classes and methods in the game library. For more information, see Game Content Project.

Class1.cs File

This file implements an empty C# class within a namespace. It provides a starting point for the class library.

To create an Xbox 360 Game Library (4.0) project

  1. From the File menu, click New Project.

  2. Select the Xbox 360 Game Library (4.0) project type.

  3. Type the name for the library project in the Name text box.

    You can also modify the default values for the Location and Solution Name controls.

  4. Click OK to create and load the new project.

Expand image See Also

Developing Xbox 360 Games


Deploying an Xbox 360 Game

Deploying an Xbox 360 Game

Describes how XNA Game Studio can copy executable and media files to the Xbox 360 retail console once you are ready to deploy them. As you develop your Xbox 360 game, it is convenient to deploy your game executable to your console for testing purposes.

However, before deploying, you need to use the XNA Game Studio Device Center dialog box to establish a connection between the console and your computer. For a detailed explanation of this process, see Connecting to Your Xbox 360 Console with XNA Game Studio 4.0.

Note
For more information about troubleshooting deployment to your console, see Troubleshooting Xbox 360 Game Deployment.

Deploying Your Game

This procedure shows you how to deploy your Xbox 360 game from XNA Game Studio to a console. This assumes you established a connection between that console and your computer.

Note
An XNA Framework game deployed to the Xbox 360 console cannot exceed 2 GB. Also, this means that any single file you deploy must be smaller than 2 GB.

To deploy your Xbox 360 game

  1. Load an Xbox 360 Game project into XNA Game Studio.

    Make sure the Output window is visible so you can follow the progress of your deployment in detail, and so you can tell where a problem occurred, if one does.

  2. To display the Output window, from the View menu, click Output, or press CTRL+W, and then press the letter O key.

  3. From the Xbox 360 dashboard, go to the My Xbox menu, select Game Library, and press the A controller button.

    Note
    Also, you have the option of using the Xbox 360 Guide: From the Games page, select Game Library, and press the A controller button.
  4. From the Game Library page, select Community Games on the Collections tab, and press the A controller button.
  5. Select XNA Game Studio Connect, and press the A controller button.

  6. Select Launch, and press the A controller button.

    The Waiting for computer connection page appears.

  7. In XNA Game Studio, deploy the game by either right-clicking the solution name and then selecting Deploy Solution, or, from the Build menu, selecting Deploy Solution.

    During this process, both the Output window of XNA Game Studio and the Connect to Computer screen show the deployment progress. You can view a list of the deployed files and some additional information.

  8. Press B to return to the Game Library.

    Your deployed game appears in the list of Recent Games.

  9. Select the game you just deployed from this menu, and press the A controller button.

  10. Choose Play Game, and press the A controller button again to start the game.

Incremental Deployment

Incremental deployment is enabled automatically for XNA Game Studio projects. This means that the IDE tracks which files have been deployed already to your Xbox 360 console. Subsequently, it only deploys updated files. Also, if a file that was part of the previous deployment is no longer in the game, that file is deleted from the console during deployment. (This only applies to previously-deployed files, not to files that were generated on the console.) The output window reflects exactly what actions were taken during deployment.

A full deployment, which deletes any previous game files and copies the entire game to the console, is triggered by the following conditions:

  • This is the first time the project has been deployed.
  • A different configuration is used than in the last deployment to this device.
  • The game was deleted from the Xbox 360 console since the last deployment.
  • The solution has been cleaned since the last deployment. (For more information about cleaning the solution, see the "Cleaning the Solution Before You Build" section that follows.)
  • The last deployment to the device was from a different source than the currently loaded solution, such as a copy on another Windows-based computer or a .ccgame package.

If you cancel during a deployment, some files may not have transferred. This leaves the game in an indeterminate state. The next incremental deployment will behave as if the last deployment never occurred. It will update the correct files on the Xbox 360 console.

Cleaning the Solution Before You Build

Cleaning your game solution before you build removes all intermediate and output files generated by the build. This forces the next build to regenerate everything.

If you select Rebuild on the Build menu, the build automatically regenerates everything, but you may also want to clean your solution before you do a build. This is particularly true if you are experiencing unexpected build errors.

In Microsoft Visual C# Express Edition, the Clean Solution option is not included in the Build menu by default. However, it is easy to add it if you want to make cleaning your solution convenient.

To add the Clean Solution option

  1. In XNA Game Studio, right-click the menu or toolbar at the top of the window, and click Customize.

  2. In the Customize dialog box, click the Build menu (or any other menu where you want to add the command).

    This opens the menu, and leaves it open.

  3. From the Customize dialog box, click the Commands tab, and select Build from the Categories pane on the left.

  4. From the Commands pane on the right, drag the Clean Solution command into the open Build menu, and then drop it where you want it.

  5. Close the dialog box.

Now, whenever you want to clean the solution, you can click Clean Solution from the menu where you added it.

Managing Several Xbox 360 Consoles with XNA Game Studio Device Center

Using the XNA Game Studio Device Center dialog box, XNA Game Studio supports deployment and debugging on multiple Xbox 360s.

The XNA Game Studio Device Center does the following:

  • Creates connections between your Windows-based computer and each of your Xbox 360 console devices. If you have more than one Xbox 360, you can use XNA Game Studio Device Center to create connections between your Windows-based computer and each of your Xbox 360 console devices. Each connection allows you to deploy and debug XNA Framework 4.0 games to a specific Xbox 360 console device.
  • Manages the list of available Xbox 360 console devices. This allows you to add and delete devices from the list of devices available for deployment.
  • Allows you to set the default Xbox 360 console device to use for deployment. Similar to the default printer in Microsoft Windows, the default Xbox 360 console device is the device to which XNA Game Studio will deploy, unless you specifically select a different Xbox 360 console device for deployment. If there is only one Xbox 360 console device, it is set as the default device.
  • Stores the list of Xbox 360 console devices on a per-user basis. Each user has a different list of Xbox 360 console devices to which he or she can deploy, and a different default device to use for deployment.

XNA Game Studio installs the XNA Game Studio Device Management Toolbar into Visual Studio. The XNA Game Studio Device Management Toolbar does the following:

  • When you click the Launch XNA Game Studio Device Center button, provides easy access to the XNA Game Studio Device Center dialog box.
  • Allows you to choose a specific Xbox 360 console device for deployment. Use the XNA Game Studio Deployment Device drop-down list. Also, do this if you want to deploy to a different Xbox 360 console device than your default device.

The XNA Game Studio Device Management Toolbar automatically appears within Visual Studio when an Xbox 360 Game project or Xbox 360 Library project is loaded in supported versions of Visual Studio tools.

Note
If your startup project is not an Xbox 360 or Windows Phone project, most of the toolbar buttons will be unavailable. To make these buttons available, change your startup project to an Xbox 360 Game or Library project.

For more information about how to add Xbox 360 console devices to the XNA Game Studio Device Center dialog box, see Connecting to Your Xbox 360 Console with XNA Game Studio 4.0. For more information about using the features of XNA Game Studio Device Center, see Using XNA Game Studio Device Center.

Managing Multiple Xbox 360 Deployments

As noted previously, XNA Game Studio Device Center gives you the option to choose a specific Xbox 360 console device for deployment. This enables you to deploy your game to multiple Xbox 360s. Also, this supports testing and debug of networked games.

If you want to execute the same game instance on all Xbox 360 consoles, you can deploy the same build to all consoles.

However, if you want to debug and modify one instance of the game while the game continues to execute on all other consoles, you can do this by using a unique configuration to build and deploy the instance you want to modify. This is an advanced scenario, but one that is common for debugging networked games.

Deployment Troubleshooting

If you are unable to deploy your Xbox 360 game successfully, see Troubleshooting Xbox 360 Game Deployment.

Expand image See Also

Connecting to Your Xbox 360 Console with XNA Game Studio 4.0
Using XNA Game Studio Device Center
Developing Xbox 360 Games


Debugging an Xbox 360 Game

Debugging an Xbox 360 Game

Discusses issues that apply to debugging Xbox 360 games on your retail console.

Debugging an Xbox 360 game is similar to the process for deploying your game, with one exception. Instead of clicking Deploy Solution, click Start Debugging on the Debug menu. To run the game without actually debugging it, click Start Without Debugging on the Debug menu.

The following features are not available when debugging an Xbox 360 game with XNA Game Studio:

Feature | Description
Interop Debugging | Debugging both managed and native code simultaneously.
Assembly Debugging | Debugging only your assemblies and not system assemblies.
Edit and Continue | Editing the binary content of your game without interrupting your debugging session.
Exception Interrupting | Stopping unhandled exceptions before they unwind, so the user can make changes and retry the operation.
Debugger Visualizers | Displaying a more informative view of a specific data type, such as XML data.
Exception Assistant Support | The additional features provided by Exception Assistant are not available when debugging Xbox 360 games. Information on exceptions is provided by the standard Exceptions dialog box within XNA Game Studio.
Debugging a Running Process | Attaching the debugger to a process that is currently executing.

Expand image See Also

Developing Xbox 360 Games


Using XNA Game Studio Device Center

Using XNA Game Studio Device Center

Describes how to use the XNA Game Studio Device Center. The XNA Game Studio Device Center enables you make one or more game devices available for deployment of your games. These can be Xbox 360 consoles. XNA Game Studio Device Center also lets you set the default device for deployment.

Accessing the XNA Game Studio Device Center

To access the XNA Game Studio Device Center, you can click the Launch XNA Game Studio Device Center on the XNA Game Studio Device Management toolbar from within Visual Studio.

Another way to access the XNA Game Studio Device Center is to use the Start menu.

  • From the Start menu, choose Programs, choose XNA Game Studio 4.0 , and then click XNA Game Studio Device Center.

When XNA Game Studio Device Center appears, it shows a list of game devices available for deploying and debugging XNA Game Studio games.

Adding a Game Device to the List of Devices Available for Deployment

You can use the XNA Game Studio Device Center to add a game device (an Xbox 360 console).

To add a game device

  • Perform one of the following steps:

    • On the left-hand side of the screen, click Add Device.

      • -or-

    • From the Visual Studio XNA Game Studio Device Management toolbar, click Add a New Device.

Either action brings up the XNA Game Studio Devices dialog box. This enables you to create a connection between your Windows-based computer and your game device.

You can find detailed step-by-step instructions on how to create a connection and add a game device to the list of devices in topic Connecting to Your Xbox 360 Console with XNA Game Studio 4.0.

Setting the Default Xbox 360 Console for Deployment

The default Xbox 360 is the console automatically selected for deployment and debugging when developing Xbox 360 console games with XNA Game Studio. The current default device is shared by all instances of XNA Game Studio that are running.

To set an Xbox 360 console as the default Xbox 360 device, right-click the icon for the device, and then click Set as Default Xbox 360.

If you have only one Xbox 360 console, that console automatically is selected as the default device.

Taking a Screen Capture from an Xbox 360 Console

The XNA Game Studio device center provides the ability to take a screen capture of an executing game on an Xbox 360 console. To take a screen capture, the following conditions must be met:

  • The Xbox 360 console must be properly connected to the PC.
  • The Xbox 360 console must be executing a game that was launched from Visual Studio.
  • The game executing must have been built using the Debug configuration.

To take a screen capture through the Device Center

Once your game is deployed and executing on the game device according to the above conditions:

  1. Right-click the icon for the device.
  2. From the context menu, select Take a Screen Capture.

The captured screen will be displayed, and you can save it as a graphics file.

Removing a Game Device from the List of Devices

To remove a game device from the list of devices, either right-click the icon for the device and click Remove, or press the Delete key.

Using the List of Devices

The list of devices in XNA Game Studio Device Center is unique to each user. Each user can have a different list of game devices, and a different default device.

Troubleshooting Your Connection

If you are unable to establish a successful connection between your computer and your game, see the troubleshooting guide:

  • Troubleshooting Xbox 360 Game Deployment

Expand image See Also

General Development Topics

Advanced Topics

Xbox 360 Development

Connecting to Your Xbox 360 Console with XNA Game Studio 4.0
Troubleshooting Xbox 360 Game Deployment
Developing Xbox 360 Games


Connecting to Your Xbox 360 Console with XNA Game Studio 4.0

Connecting to Your Xbox 360 Console with XNA Game Studio 4.0

XNA Game Studio makes it easy for you to create games for both your Windows-based computer and your Xbox 360 console. By joining the XNA Creators Club as a premium member and by downloading XNA Game Studio, you can begin developing for your Windows-based computer. To begin developing for Xbox 360, follow these additional steps.

This guide assumes you have already installed a supported version of Visual Studio tools and XNA Game Studio. You must install these products before you connect to an Xbox 360 console.

  • Step 1: Sign In to Xbox LIVE
  • Step 2: Download XNA Game Studio Connect
  • Step 3: Connect Your Xbox 360 Console and Windows-based Computer
  • Step 4: Create and Deploy an Xbox 360 Project
  • What's Next?

Step 1: Sign In to Xbox LIVE

Turn on your Xbox 360 console, and sign in to Xbox LIVE. At the very least, you will need a Silver Xbox LIVE membership, an XNA Creators Club premium membership, and a hard drive for your Xbox 360 console to be able to develop games for Xbox 360 using XNA Game Studio. While you are in XNA Game Studio Connect or playing an XNA Game Studio game, you need to be connected to Xbox LIVE.

Connections between your Xbox 360 console and XNA Game Studio require a premium membership in XNA Creators Club. To sign up, visit the XNA Creators Club website.

Step 2: Download XNA Game Studio Connect

You must download XNA Game Studio Connect from Xbox LIVE Marketplace, and install it on the Xbox 360 console. Go to the Xbox LIVE Marketplace to find XNA Game Studio Connect. To download XNA Game Studio Connect, choose one of the following options:

Browsing to All Games using the Guide

  • From the Guide, navigate to the Marketplace blade.
  • Select Game Marketplace, then All Games. This brings you to the All Games screen.
  • Continue with Downloading XNA Game Studio Connect from the All Games screen, below.

Browsing to All Games using the New Xbox Experience (NXE) UI

  • Navigate to Game Marketplace, and select Explore Game Content. Press A on the controller.
  • Select Browse, and press A. This brings you to the All Games screen.
  • Continue with Downloading XNA Game Studio Connect from the All Games screen, below.

Once you've arrived at the All Games screen from either the Guide or NXE, use the following procedure to download XNA Game Studio Connect.

Downloading XNA Game Studio Connect from the All Games screen

  • From All Games, browse to the Genre screen, and select Other.

    Note
    You can also do this by scrolling down the Title list, and selecting X.
  • Scroll to XNA Creators Club, and press A.
  • From the XNA Creators Club pane, select All Downloads, then XNA Game Studio Connect.
  • Press the A controller button, and select Confirm Download to begin downloading.

Step 3: Connect Your Xbox 360 Console and Windows-based Computer

When you develop games for Xbox 360, you develop them on your Windows-based computer, then transfer them over your local network to your Xbox 360 console. This requires that your Windows-based computer and Xbox 360 console share the same subnet. Most home networking layouts support this configuration. If your console and computer share a router or hub, it is likely that they share the same subnet.

With your computer and console on the same subnet, follow these steps to set up a connection between your computer and your console.

Step 3A. On Your Xbox 360 Console, Generate a Connection Key:

  1. From the Xbox Dashboard, go to My Xbox, select Game Library, and press the A controller button.

    Also, you have the option of using the Xbox Guide: select the Games tab, then Game Library, and press the A controller button.

  2. From the Game Library, go to the Collections tab, select Community Games, and press A.

  3. Select XNA Game Studio Connect, and press A.

  4. Select Launch, and press A.

    The XNA Game Studio Connect screen appears.

  5. If the XNA Game Studio Connect screen displays a connection key, continue to step 3B.

    If the connection key does not appear, you can generate a new key by pressing the X controller button.

    If the connection key does not appear, the Xbox console could already be connected to this Windows-based computer. XNA Game Studio allows multiple connection keys for multiple users on multiple computers. For more information, see device center. To add a new connection key to the list of connection keys recognized by this Xbox 360 console, press X. To reset all connection keys and generate a new connection key to connect to this Xbox 360 console, press Y.

Step 3B. On Your Windows-Based Computer, Enter the Connection Key and Initiate the Connection

  1. From the Start menu, select Programs, select XNA Game Studio 4.0, and launch the XNA Game Studio Device Center.

    Note
    You can also use the XNA Game Studio Device Management toolbar to directly launch XNA Game Studio Device Center and add a device. Visual Studio 2008 displays the XNA Game Studio Device Management toolbar by default when an Xbox 360 game is open in Visual Studio.

  2. Click Add Device.

  3. Select the type of device you're adding. In this case, click Xbox 360.

  4. Enter a name for this Xbox 360 console, and click Next.

    This name serves only to identify your Xbox 360 console to XNA Game Studio. The name does not need to correspond to any other computer or Xbox 360 name.

  5. Enter the connection key that is displayed in XNA Game Studio Connect on the Xbox 360.

    Note

    The connection key might be somewhat hard to read on a standard television screen. The following guide should help you identify specific letters and numbers:

    • The number "1" has a small tick at its top left; the capital letter "I" does not.
    • The capital letter "B" has a straight line on the left; the number "8" does not.
    • The number "3," sometimes mistaken for a "B," also has no straight side on the left.
    • The number "0" and the capital letter "O" are so similar that XNA Game Studio Connect treats these characters as the same. Therefore, the number "0" and the capital letter "O" are interchangeable.

    If the connection key is still too difficult to read, press X on the Xbox 360 controller to generate a new connection key.

  6. Once you are sure that the two keys match, click Next on the XNA Game Studio Devices dialog box.

    XNA Game Studio Device Center will test the connection with the Xbox 360 console.

    If the connection is successful, the XNA Game Studio Device Center on the Windows-based computer will display "Successfully connected to the Xbox 360 console." XNA Game Studio Connect on the Xbox 360 console will display "Waiting for computer connection," followed by the name you have chosen for your Xbox 360 console in the XNA Game Studio Device Center.

    If the XNA Game Studio Device Center fails to connect to the Xbox 360 console, click Try again to edit the connection key and try again. If the connection continues to fail, make a careful note of the error message displayed at the bottom of the XNA Game Studio Devices dialog box. This error message can help you or a technician diagnose the cause of the connection failure, if it did not result from mismatched keys. For more information about troubleshooting a failed connection, see troubleshooting deployment.

  7. Click Finish.

    The name you gave to your Xbox 360 console will be listed in the XNA Game Studio Device Center. From now on, your computer and your console can connect easily to each other.

Step 4: Create and Deploy an Xbox 360 Project

Try out the Xbox 360 console by deploying a simple, blank XNA Game Studio game to it.

  1. On your Windows-based computer, at the main Visual Studio screen, select the File menu, and then click New Project.

  2. From Project types, expand the Visual C#, and click XNA Game Studio 4.0.

  3. In Templates, select Xbox 360 Game (4.0), and then click OK.

    At this point, you should bring up XNA Game Studio Connect to prepare the Xbox 360 console to receive content from the Windows-based computer.

  4. From the Xbox Dashboard, go to My Xbox, select Game Library, and press A on the controller.

    You can also use the Guide: select the Games tab, select Game Library, and then press A.

  5. From the Game Library, go to the Collections tab, select Community Games, and press A.

  6. Select XNA Game Studio Connect, and press A.

  7. Select Launch, and press A.

    The XNA Game Studio Connect screen appears.

  8. On your Windows-based computer, with your new project open, press the F5 key.

    The project will build, deploy necessary files to the Xbox 360 console, and run.

    At this point, you should see a simple display on your console—just a blue screen. If you see this screen, you have successfully deployed a game to your Xbox 360 console. You can now deploy and play any game you create on your console.

  9. To stop the game and return to the main screen of XNA Game Studio Connect, either press the BACK button on your Xbox 360 gamepad, or press SHIFT+F5 to stop debugging on your computer.

    If the deployment fails, you may need to check your network settings. See troubleshooting deployment for more information.

What's Next?

You have successfully deployed your first Xbox 360 game. This game, like every game you deploy, will now appear in the Recent Games tab in the Game Library on your Xbox 360 console. It can also be found by selecting Community Games in the Collections tab in your Game Library. Using Game Library, you can play any of the games you have deployed to your Xbox 360 console. From Game Library, you can also delete games you do not want to keep.

Once your game is loaded onto the hard disk so that it appears in the Recent Games tab of the Game Library on your Xbox 360 console, it can be transferred to a memory unit if one is installed. From System Settings on your Xbox 360 console, the Memory selection enables you to transfer a game from the hard disk to the memory unit. The memory unit can then be installed on any other Xbox 360 console and played or copied.

Important
Only XNA Framework games built and deployed with XNA Game Studio 3.0 and later can be transferred to a memory unit. If you want to transfer a game developed under an earlier version of XNA Game Studio, you must convert, build, and deploy the project using the current version of XNA Game Studio.

A good next step would be to try some of the tutorials. The code used in the tutorials works on both Windows-based computers and on the Xbox 360 console, so you can try either platform to get a feel for how to develop for both.

Expand image See Also

troubleshooting deployment
deploying Xbox 360
device center
Firewall


Troubleshooting Xbox 360 Game Deployment

Troubleshooting Xbox 360 Game Deployment

Provides some helpful troubleshooting tips for Xbox 360 deployment if you are unable to establish a successful connection between your computer and your Xbox 360 console.

Be Sure Your Console is Correctly Configured

  • You must have an XNA Creators Club membership, which you can purchase from Xbox LIVE Marketplace.
  • XNA Game Studio Connect must be installed on the console.
  • You must be signed in to Xbox LIVE with an Xbox 360 gamer profile associated with your XNA Creators Club membership.
  • XNA Game Studio Connect must be running on the console. This means the connection to Xbox LIVE must remain active. Oherwise, XNA Game Studio Connect closes.

Use a Freshly Generated Key

The key generated by the console in the XNA Game Studio Connect page is good only for connecting one computer to one console under one user profile.

A key is valid until a computer connects to the Xbox 360 using that key, or until a new key is generated by the console. For example, if you delete a console from the list of consoles available for deployment, you cannot add it back again using the same key. Instead, you must generate a new key on the console, and use that new key to connect the computer to the console.

Your Connection Keys Might Have Been Modified

If a connection worked once and is now failing, the connection key for the console may have been changed accidentally. If this is the problem, you can fix it simply by adding a new connection, using a new key.

If You Wish to Reset All Connections

You can reset all connections by pushing Reset All Connections. This invalidates all connections to the Xbox 360 console device, and generates a new key for a new connection.

Note
If you reset all connections, any Windows-based computer with a connection to this Xbox 360 console device will not be able to connect until it reestablishes a new connection to the Xbox 360 console device.

The Computer and the Xbox Console Must Be on the same Subnet

If the computer and Xbox 360 console are on different subnets, they won't establish a proper connection. Typically, you should connect both machines to the same hub or router. It is best not to use a wireless connection—a weak or noisy signal can cause a failure in the connection and deployment.

To determine whether your computer and console are on the same subnet:

  1. On your computer, open a command window (click Start, and then click All Programs , click Accessories, and finally click Command Prompt ).

  2. At the command prompt, type ipconfig, and press ENTER.

    Make note of both the IP address and of the subnet mask in the configuration listing that appears.

  3. On your Xbox 360 dashboard, go to the My Xbox menu, and select System Settings.

    Note
    You can use the Xbox 360 Guide to do the same thing: go to the Settings blade and select System Settings.

  4. From System Settings, select Network Settings, and then click Configure Network.

    Make note of the IP address and subnet mask.

  5. Compare the settings to make sure that the computer and console are on the same subnet.

Check for Firewall Interference

In some cases, your firewall could be blocking communication between your computer and the Xbox 360 console. Verify that the following conditions have been met.

  • The xnatrans.exe executable is not blocked on the computer.
  • Incoming communication for UDP ports 3825 and 3835 is not blocked.
  • Outgoing communication for UDP port 1000 is not blocked.
  • Outgoing communication for TCP port 1001 is not blocked.

See Firewall for more details.

Expand image See Also

Connecting to Your Xbox 360 Console with XNA Game Studio 4.0
Developing Xbox 360 Games
Using XNA Game Studio Device Center


Xbox 360 Programming

Xbox 360 Programming

In This Section

Xbox 360 Programming Considerations
Summarizes several issues that XNA Framework programmers should consider when creating Xbox 360 games.
Predicated Tiling
Describes predicated tiling in Xbox 360 development.In predicated tiling, the commands issued in the Draw method are recorded before execution. The recorded commands, such as DrawPrimitives calls, are then executed for each tile, predicated based on whether the rendered primitives intersect the tile.
.NET Compact Framework for Xbox 360
Provides information about developing XNA Game Studio applications using the C# language and the .NET Compact Framework for Xbox 360.

Expand image See Also

Working with Xbox 360 Controllers


Xbox 360 Programming Considerations

Xbox 360 Programming Considerations

Summarizes several issues that XNA Framework programmers should consider when creating Xbox 360 games.

Graphics Considerations

The most important graphics consideration for programming for the Xbox 360 console is the wide variety of televisions that the Xbox 360 system supports. The Xbox 360 system supports both HDTV and normal television sets, at multiple resolutions (480p, 720p, 1080i, and 1080p), and multiple aspect ratios (4:3, 16:9, and 16:10). The console automatically scales the output of a game to the resolution of the owner's display, and if the game is using a widescreen aspect ratio, the console automatically adds "black bars" (letterboxing) if the owner's display is not widescreen.

There are still two things, however, XNA Framework programmers should consider when programming for the Xbox 360: the title safe region, and aspect ratios.

Title Safe Region

On standard tube televisions, the display area of the television normally is not a perfect rectangle. In fact, a significant amount of the display may not be visible on a CRT tube. In television, the inner 80 percent to 90 percent of the picture is considered the "title safe" region. Any graphics displayed outside of this region on a standard television may be obscured or distorted.

Programmers should ensure that any critical information (score, number of lives, ammo, and so on) is displayed within the title safe region while drawing the background or a 3D scene across the entire display. Critical text should be displayed within the inner 80 percent of the screen. Programmers should also ensure that any text displayed on the screen is large enough to be legible on a standard television.

Aspect Ratio

If the aspect ratio of the back buffer is widescreen and the aspect ratio of the owner's display is not, the Xbox 360 will add black bars at the top of the display so that the entire back buffer is on the screen. To avoid letterboxing, developers must program their games to use both standard and widescreen aspect ratios, and adjust their display to the default aspect ratio offered by the Xbox 360. For this reason, a single widescreen back buffer for Xbox games is recommended.

To detect the console display setting, you can use the DisplayMode property on the GraphicsDevice. This will be valid during or after your game's Initialize method. Some common display modes are listed here.

Xbox display setting | DisplayMode width and height
AV (composite) | 640×480
480p (normal) | 640×480
480p (widescreen) | 640×480
720p (widescreen) | 1280×720
1080i/1080p (widescreen) | 1920×1080

Multisampling

Because 4×AA multisampling is provided for free by the Xbox 360, it is recommended. Developers should be aware that this will often activate predicated tiling.

Multiple Render Targets

Render targets function similarly on both Xbox 360 and Windows. By default, the content of a render target is always cleared when the render target is resolved unless persistence is specified during construction of the render target. Developers can avoid problems by rendering fully to each render target before using a new render target, and by rendering their final scene after all the other render targets are resolved.

Input Considerations

The Xbox 360 supports three input devices: the game controller, the Xbox LIVE Vision camera, and an optional USB keyboard. Mice are not supported, and most Xbox 360 users will not have a keyboard connected to their console. The XNA Framework does not support the Vision camera. Games for the Xbox 360 should be programmed to accept all critical input from the gamepad.

Audio Considerations

XACT audio wave banks, sound banks, and settings files are platform-specific. The XNA Framework Content Pipeline will automatically process XACT project files (.xap) into the correct platform type if the project file is added to Solution Explorer. If you are building the XACT project manually, ensure you are using the correct built files for your platform type when you load the built files into your game. Failure to use the correct platform-specific files will result in an error.

Storage Considerations

Accessing a player's storage on Xbox 360 (to let them save a game, for example) requires displaying the Storage Device Guide where the user can choose between the hard drive or memory units. The best way to do this is to use the BeginShowSelector method as demonstrated in Getting a StorageDevice Asynchronously. The largest space available on a memory unit is 52 MB so any saved games must not exceed that size.

The maximum size of an XNA Framework project on an Xbox 360 console is 2 GB so the entire game, including support files (level data, sound, and so on), must not exceed that size.

Source Code Considerations

Xbox 360 projects define an XBOX symbol for use with conditional compilation directives such as #if. You can use this to maintain source code that acts differently on Windows and Xbox 360 if that source is shared between projects.


Predicated Tiling

Predicated Tiling

Describes predicated tiling in Xbox 360 development.

The Xbox 360 has 10 MB (10×1024×1024) of fast embedded dynamic RAM (EDRAM) that is dedicated for use as the back buffer, depth stencil buffer, and other render targets. Depending on the size and format of the render targets and the antialiasing level, it may not be possible to fit all targets in EDRAM at once. For example, 10 MB of EDRAM is enough to hold two 1280×720 32-bit surfaces with no multisample antialiasing (MSAA) or two 640×480 4× MSAA 32-bit surfaces. However, a 1280×720 2× MSAA 32-bits-per-pixel render target is 7,372,800 bytes. Combined with a 32-bit Z/stencil buffer of the same dimensions, it becomes apparent that 10 MB might not be sufficient.

Predicated tiling allows rendering to larger surfaces than can fit into EDRAM at any one time. In predicated tiling, the screen space is broken up into tiles (rectangles). The following figure shows the screen space broken into two tiles.

In predicated tiling, the commands issued in the Draw method are recorded before execution. The recorded commands, such as DrawPrimitives calls, are then executed for each tile, predicated based on whether the rendered primitives intersect the tile. In the preceding figure, both the triangle primitives would be rendered in Tile 0. Once the primitives for a tile are fully rendered, the tile is then resolved into the texture that is used for the front buffer. Each successive tile is handled the same way and is resolved into the same texture.

Triggering Predicated Tiling

Predicated tiling occurs automatically for Xbox 360 games created with XNA Game Studio when the size and format of the render targets exceed the console's available EDRAM. In predicated tiling, the size of the render targets and the depth-stencil are no longer limited by EDRAM memory, although each individual tile has to fit into EDRAM.

Once predicated tiling has been triggered, all rendering commands in Draw are accumulated and played back for each tile in separate passes. An adjusted window offset and clip rectangle are used to render only those portions that intersect with the specified screen-space tile rectangle. Drawing is done only when the primitive drawing call is known to be visible on the given tile. This is determined by using hardware screen–space extent queries, which compute if the geometry lies within the tile. All rendering is then completed using the render target and depth stencil surface that are currently set.

Restrictions Encountered After Predicated Tiling Has Been Triggered

A few restrictions apply when predicated tiling has been triggered.

Resources that are referenced in the command buffer cannot be modified by the CPU, because the command buffer has to be played back more than once to accomplish the tiling. It is okay for the GPU to modify resources and then reuse them in the same pass, because the GPU can appropriately recreate the memory on every pass.

Data from an occlusion query (specifically, a call to IsComplete) on Xbox 360 is not available from within the tiling bracket. Access this data by switching to a different render target or end the frame. This condition does not apply to games targeting the Windows platform.


.NET Compact Framework for Xbox 360

.NET Compact Framework for Xbox 360

The XNA Framework includes the .NET Compact Framework for Xbox 360, which is a version of the .NET Compact Framework designed specifically for the Xbox 360 video game and entertainment system. The .NET Compact Framework for Xbox 360 implements a subset of the .NET Compact Framework, and has been optimized to take advantage of and expose the power of the Xbox 360. XNA Game Studio projects that target Windows-based game machines have access to the full .NET Framework, while projects that target Xbox 360 use the .NET Compact Framework for Xbox 360.

This section provides information about developing XNA Game Studio applications using the C# language and the .NET Compact Framework for Xbox 360.

In This Section

Namespaces and Classes Supported by the .NET Compact Framework for Xbox 360
Describes how to determine the namespaces, types, and members that are supported by the .NET Compact Framework for Xbox 360.
Additions to the .NET Compact Framework for Xbox 360
Identifies namespaces, types, and members unique to the .NET Compact Framework for Xbox 360.
Thread Pools in the .NET Compact Framework for Xbox 360
Discusses the use of thread pools in the .NET Compact Framework for Xbox 360.
Language, Locales, and Cultures in the .NET Compact Framework for Xbox 360
Describes the mapping of console language and locale to managed cultures in the .NET Compact Framework for Xbox 360.
XNA Framework Remote Performance Monitor for Xbox 360
Provides information on the XNA Framework Remote Performance Monitor for Xbox 360.


Namespaces and Classes Supported by the .NET Compact Framework for Xbox 360

Namespaces and Classes Supported by the .NET Compact Framework for Xbox 360
See Also
CollapseAll image

The .NET Compact Framework for Xbox 360 implements a subset of the namespaces, types, and members available in the .NET Compact Framework. This topic discusses that subset and explains how to determine support for specific classes or members.

Determining Supported Namespaces, Types, and Members

The following methods help you determine the specific types and members that are supported by the .NET Compact Framework for Xbox 360.

  • The online MSDN .NET Framework Class Library documentation has been updated to show the types and members that are supported on the Xbox 360. Version information in those topics indicates XNA Framework support. Also, in the member summary pages, members supported on Xbox 360 display the 'Supported by XNA Framework' icon [image] after the .NET Compact Framework icon [image].

  • The Namespaces, Types, and Members topic lists the namespaces, types, and members that are supported by the .NET Compact Framework for Xbox 360.

While working within an Xbox 360 project, the following methods of determining supported types and methods are available.

  • IntelliSense will show only types and members that are available to Xbox 360 projects. For information about IntelliSense, see Using IntelliSense.
  • You will receive compiler errors when you use unsupported types or members within an Xbox 360 project.

For code portability, you may want to use only types and members supported by the .NET Compact Framework for Xbox 360, even though XNA Game Studio projects for Windows have access to the entire .NET Framework. Doing so will make it easier to create single-source applications that compile and run on both Windows and Xbox 360.

Unsupported Classes

The following sections discuss a few of the classes that are not supported by the .NET Compact Framework for Xbox 360.

To determine the full set of namespaces, types, and members that are supported by the .NET Compact Framework for Xbox 360, see Determining Supported Namespace, Types, and Members, preceding.

To see additional members available only in the .NET Compact Framework for Xbox 360, see Additions to the .NET Compact Framework for Xbox 360

Note
The .NET Compact Framework is itself a subset of the full .NET Framework. Those differences are not described here, but you can find information in Differences with the .NET Framework.

User Interface Classes

The .NET Compact Framework for Xbox 360 does not include the System.Windows.Forms namespace or any of its classes. User interface elements in an XNA game are composed of 2D or 3D graphics (or both), created using classes in the Microsoft.Xna.Framework.Graphics Namespace namespace.

Games typically have menus and other user interface elements that are unique and customized to the game, rather than standardized versions that wouldn't adequately express the game's unique feel and flow.

Web and Network Classes

The .NET Compact Framework for Xbox 360 does not include the System.Web namespace. It supports only a small subset of the System.Net namespace. See Determining Supported Namespace, Types, and Members, preceding, for information on determining that subset.

Games developed for Xbox 360 using XNA Game Studio can use the functionality provided in the Microsoft.Xna.Framework.Net namespace to create system link or Xbox LIVE multiplayer games.

Expand image See Also

Concepts

.NET Compact Framework for Xbox 360
Namespaces, Types, and Members in the .NET Compact Framework for Xbox 360
Additions to the .NET Compact Framework for Xbox 360
Differences with the .NET Framework
Using IntelliSense

Reference

Namespaces, Types, and Members in the .NET Compact Framework for Xbox 360
.NET Framework Class Library (MSDN Online)


Namespaces, Types, and Members in the .NET Compact Framework for Xbox 360

Namespaces, Types, and Members in the .NET Compact Framework for Xbox 360
CollapseAll image

This topic lists all of the namespaces, types, and members supported by the .NET Compact Framework for Xbox 360.

You can use this list to browse the supported members or to search for specific members. To search, click in this topic window and then press CTRL+F.

The links for each type or member jump to the corresponding online MSDN documentation. The online MSDN .NET Framework Class Library documentation has been updated to show the types and members that are supported on the Xbox 360. Version information in those topics indicates XNA Framework support. Also, in the member summary pages, members supported on Xbox 360 display the 'Supported by XNA Framework' icon [image] after the .NET Compact Framework icon [image].

For more information, see Namespaces and Classes Supported by the .NET Compact Framework for Xbox 360.

Namespaces

The following namespaces are supported in the .NET Compact Framework for Xbox 360.

System
System.CodeDom.Compiler
System.Collections
System.Collections.Generic
System.Collections.ObjectModel
System.Collections.Specialized
System.ComponentModel
System.Configuration.Assemblies
System.Diagnostics
System.Diagnostics.CodeAnalysis
System.Globalization
System.IO
System.Net
System.Reflection
System.Resources
System.Runtime.CompilerServices
System.Runtime.InteropServices
System.Runtime.Serialization
System.Security
System.Security.Permissions
System.Security.Policy
System.Text
System.Text.RegularExpressions
System.Threading
System.Xml
System.Xml.Schema
System.Xml.Serialization
System.Xml.XPath
System.Xml.Xsl

(These links jump to the corresponding namespace in the list below.)

Namespaces, Types, and Members

The following namespaces, types, and members are supported in the .NET Compact Framework for Xbox 360.

Note
To limit the size of this large list, explicit interface implementations and overloads are not listed.
Note
You can open a link in a new tab within Microsoft Document Explorer by holding down SHIFT while clicking the link.

System namespace

System.Action<T> delegate

System.Activator class
[Activator Methods]
Activator.CreateInstance

System.AppDomain class
[AppDomain Methods]
AppDomain.CreateDomain
AppDomain.ExecuteAssembly
AppDomain.ToString
AppDomain.Unload
[AppDomain Properties]
AppDomain.CurrentDomain
AppDomain.FriendlyName
[AppDomain Events]
AppDomain.UnhandledException

System.AppDomainManager class
AppDomainManager.AppDomainManager
[AppDomainManager Methods]
AppDomainManager.InitializeNewDomain
[AppDomainManager Properties]
AppDomainManager.InitializationFlags

System.AppDomainManagerInitializationOptions enumeration

System.AppDomainSetup class
AppDomainSetup.AppDomainSetup

System.AppDomainUnloadedException class
AppDomainUnloadedException.AppDomainUnloadedException

System.ApplicationException class
ApplicationException.ApplicationException

System.ArgumentException class
ArgumentException.ArgumentException

System.ArgumentNullException class
ArgumentNullException.ArgumentNullException

System.ArgumentOutOfRangeException class
ArgumentOutOfRangeException.ArgumentOutOfRangeException

System.ArithmeticException class
ArithmeticException.ArithmeticException

System.Array class
[Array Methods]
Array.BinarySearch
Array.Clear
Array.Clone
Array.Copy
Array.CopyTo
Array.CreateInstance
Array.GetEnumerator
Array.GetLength
Array.GetLowerBound
Array.GetUpperBound
Array.GetValue
Array.IndexOf
Array.Initialize
Array.LastIndexOf
Array.Resize<T>
Array.Reverse
Array.SetValue
Array.Sort
Array.TrueForAll<T>
[Array Properties]
Array.IsFixedSize
Array.IsReadOnly
Array.IsSynchronized
Array.Length
Array.Rank
Array.SyncRoot

System.ArraySegment<T> structure
ArraySegment<T>.ArraySegment<T>
[ArraySegment<T> Methods]
ArraySegment<T>.Equals
ArraySegment<T>.GetHashCode
ArraySegment<T>.op_Equality
ArraySegment<T>.op_Inequality
[ArraySegment<T> Properties]
ArraySegment<T>.Array
ArraySegment<T>.Count
ArraySegment<T>.Offset

System.ArrayTypeMismatchException class
ArrayTypeMismatchException.ArrayTypeMismatchException

System.AsyncCallback delegate

System.Attribute class
Attribute.Attribute
[Attribute Methods]
Attribute.Equals
Attribute.GetCustomAttribute
Attribute.GetCustomAttributes
Attribute.GetHashCode
Attribute.IsDefined
Attribute.Match

System.AttributeTargets enumeration

System.AttributeUsageAttribute class
AttributeUsageAttribute.AttributeUsageAttribute
[AttributeUsageAttribute Properties]
AttributeUsageAttribute.AllowMultiple
AttributeUsageAttribute.Inherited
AttributeUsageAttribute.ValidOn

System.BadImageFormatException class
BadImageFormatException.BadImageFormatException

System.BitConverter class
[BitConverter Fields]
BitConverter.IsLittleEndian
[BitConverter Methods]
BitConverter.GetBytes
BitConverter.ToBoolean
BitConverter.ToChar
BitConverter.ToDouble
BitConverter.ToInt16
BitConverter.ToInt32
BitConverter.ToInt64
BitConverter.ToSingle
BitConverter.ToString
BitConverter.ToUInt16
BitConverter.ToUInt32
BitConverter.ToUInt64

System.Boolean structure
[Boolean Fields]
Boolean.FalseString
Boolean.TrueString
[Boolean Methods]
Boolean.CompareTo
Boolean.Equals
Boolean.GetHashCode
Boolean.GetTypeCode
Boolean.Parse
Boolean.ToString

System.Buffer class
[Buffer Methods]
Buffer.BlockCopy
Buffer.ByteLength
Buffer.GetByte
Buffer.SetByte

System.Byte structure
[Byte Fields]
Byte.MaxValue
Byte.MinValue
[Byte Methods]
Byte.CompareTo
Byte.Equals
Byte.GetHashCode
Byte.GetTypeCode
Byte.Parse
Byte.ToString

System.CannotUnloadAppDomainException class
CannotUnloadAppDomainException.CannotUnloadAppDomainException

System.Char structure
[Char Fields]
Char.MaxValue
Char.MinValue
[Char Methods]
Char.CompareTo
Char.Equals
Char.GetHashCode
Char.GetNumericValue
Char.GetTypeCode
Char.GetUnicodeCategory
Char.IsControl
Char.IsDigit
Char.IsLetter
Char.IsLetterOrDigit
Char.IsLower
Char.IsNumber
Char.IsPunctuation
Char.IsSeparator
Char.IsSurrogate
Char.IsSurrogatePair
Char.IsSymbol
Char.IsUpper
Char.IsWhiteSpace
Char.ToLower
Char.ToLowerInvariant
Char.ToString
Char.ToUpper

System.CharEnumerator class
[CharEnumerator Methods]
CharEnumerator.Clone
CharEnumerator.MoveNext
CharEnumerator.Reset
[CharEnumerator Properties]
CharEnumerator.Current

System.CLSCompliantAttribute class
CLSCompliantAttribute.CLSCompliantAttribute
[CLSCompliantAttribute Properties]
CLSCompliantAttribute.IsCompliant

System.Comparison<T> delegate

System.Console class
[Console Methods]
Console.ReadLine
Console.SetError
Console.SetIn
Console.SetOut
Console.Write
Console.WriteLine
[Console Properties]
Console.Error
Console.In
Console.Out

System.Convert class
[Convert Fields]
Convert.DBNull
[Convert Methods]
Convert.ChangeType
Convert.FromBase64CharArray
Convert.FromBase64String
Convert.GetTypeCode
Convert.IsDBNull
Convert.ToBase64CharArray
Convert.ToBase64String
Convert.ToBoolean
Convert.ToByte
Convert.ToChar
Convert.ToDateTime
Convert.ToDecimal
Convert.ToDouble
Convert.ToInt16
Convert.ToInt32
Convert.ToInt64
Convert.ToSByte
Convert.ToSingle
Convert.ToString
Convert.ToUInt16
Convert.ToUInt32
Convert.ToUInt64

System.Converter<TInput><TOutput> delegate

System.DateTime structure
DateTime.DateTime
[DateTime Fields]
DateTime.MaxValue
DateTime.MinValue
[DateTime Methods]
DateTime.Add
DateTime.AddDays
DateTime.AddHours
DateTime.AddMilliseconds
DateTime.AddMinutes
DateTime.AddMonths
DateTime.AddSeconds
DateTime.AddTicks
DateTime.AddYears
DateTime.Compare
DateTime.CompareTo
DateTime.DaysInMonth
DateTime.Equals
DateTime.FromFileTime
DateTime.FromFileTimeUtc
DateTime.FromOADate
DateTime.GetDateTimeFormats
DateTime.GetHashCode
DateTime.GetTypeCode
DateTime.IsDaylightSavingTime
DateTime.IsLeapYear
DateTime.op_Addition
DateTime.op_Equality
DateTime.op_GreaterThan
DateTime.op_GreaterThanOrEqual
DateTime.op_Inequality
DateTime.op_LessThan
DateTime.op_LessThanOrEqual
DateTime.op_Subtraction
DateTime.Parse
DateTime.ParseExact
DateTime.SpecifyKind
DateTime.Subtract
DateTime.ToFileTime
DateTime.ToFileTimeUtc
DateTime.ToLocalTime
DateTime.ToLongDateString
DateTime.ToLongTimeString
DateTime.ToOADate
DateTime.ToShortDateString
DateTime.ToShortTimeString
DateTime.ToString
DateTime.ToUniversalTime
[DateTime Properties]
DateTime.Date
DateTime.Day
DateTime.DayOfWeek
DateTime.DayOfYear
DateTime.Hour
DateTime.Kind
DateTime.Millisecond
DateTime.Minute
DateTime.Month
DateTime.Now
DateTime.Second
DateTime.Ticks
DateTime.TimeOfDay
DateTime.Today
DateTime.UtcNow
DateTime.Year

System.DateTimeKind enumeration

System.DayOfWeek enumeration

System.DBNull class
[DBNull Fields]
DBNull.Value
[DBNull Methods]
DBNull.GetTypeCode
DBNull.ToString

System.Decimal structure
Decimal.Decimal
[Decimal Fields]
Decimal.MaxValue
Decimal.MinusOne
Decimal.MinValue
Decimal.One
Decimal.Zero
[Decimal Methods]
Decimal.Add
Decimal.Compare
Decimal.CompareTo
Decimal.Divide
Decimal.Equals
Decimal.Floor
Decimal.GetBits
Decimal.GetHashCode
Decimal.GetTypeCode
Decimal.Multiply
Decimal.Negate
Decimal.op_Addition
Decimal.op_Decrement
Decimal.op_Division
Decimal.op_Equality
Decimal.op_Explicit
Decimal.op_GreaterThan
Decimal.op_GreaterThanOrEqual
Decimal.op_Implicit
Decimal.op_Increment
Decimal.op_Inequality
Decimal.op_LessThan
Decimal.op_LessThanOrEqual
Decimal.op_Modulus
Decimal.op_Multiply
Decimal.op_Subtraction
Decimal.op_UnaryNegation
Decimal.op_UnaryPlus
Decimal.Parse
Decimal.Remainder
Decimal.Round
Decimal.Subtract
Decimal.ToByte
Decimal.ToDouble
Decimal.ToInt16
Decimal.ToInt32
Decimal.ToInt64
Decimal.ToSByte
Decimal.ToSingle
Decimal.ToString
Decimal.ToUInt16
Decimal.ToUInt32
Decimal.ToUInt64
Decimal.Truncate

System.Delegate class
[Delegate Methods]
Delegate.Clone
Delegate.Combine
Delegate.CombineImpl
Delegate.Equals
Delegate.Finalize
Delegate.GetHashCode
Delegate.GetInvocationList
Delegate.op_Equality
Delegate.op_Inequality
Delegate.Remove
Delegate.RemoveImpl

System.DivideByZeroException class
DivideByZeroException.DivideByZeroException

System.Double structure
[Double Fields]
Double.Epsilon
Double.MaxValue
Double.MinValue
Double.NaN
Double.NegativeInfinity
Double.PositiveInfinity
[Double Methods]
Double.CompareTo
Double.Equals
Double.GetHashCode
Double.GetTypeCode
Double.IsInfinity
Double.IsNaN
Double.IsNegativeInfinity
Double.IsPositiveInfinity
Double.Parse
Double.ToString

System.EntryPointNotFoundException class
EntryPointNotFoundException.EntryPointNotFoundException

System.Enum structure
Enum.Enum
[Enum Methods]
Enum.CompareTo
Enum.Equals
Enum.GetHashCode
Enum.GetTypeCode
Enum.GetUnderlyingType
Enum.IsDefined
Enum.Parse
Enum.ToObject
Enum.ToString

System.Environment class
[Environment Methods]
Environment.GetFolderPath
[Environment Properties]
Environment.OSVersion
Environment.ProcessorCount
Environment.TickCount
Environment.Version

System.Environment.SpecialFolder enumeration

System.EventArgs class
EventArgs.EventArgs
[EventArgs Fields]
EventArgs.Empty

System.EventHandler delegate

System.EventHandler<TEventArgs> delegate

System.Exception class
Exception.Exception
[Exception Methods]
Exception.GetBaseException
Exception.ToString
[Exception Properties]
Exception.HResult
Exception.InnerException
Exception.Message
Exception.StackTrace

System.FlagsAttribute class
FlagsAttribute.FlagsAttribute

System.FormatException class
FormatException.FormatException

System.GC class
[GC Methods]
GC.Collect
GC.GetTotalMemory
GC.KeepAlive
GC.ReRegisterForFinalize
GC.SuppressFinalize
GC.WaitForPendingFinalizers
[GC Properties]
GC.MaxGeneration

System.Guid structure
Guid.Guid
[Guid Fields]
Guid.Empty
[Guid Methods]
Guid.CompareTo
Guid.Equals
Guid.GetHashCode
Guid.NewGuid
Guid.op_Equality
Guid.op_Inequality
Guid.ToByteArray
Guid.ToString

System.IAsyncResult interface
[IAsyncResult Properties]
IAsyncResult.AsyncState
IAsyncResult.AsyncWaitHandle
IAsyncResult.CompletedSynchronously
IAsyncResult.IsCompleted

System.ICloneable interface
[ICloneable Methods]
ICloneable.Clone

System.IComparable interface
[IComparable Methods]
IComparable.CompareTo

System.IComparable<T> interface
[IComparable<T> Methods]
IComparable<T>.CompareTo

System.IConvertible interface
[IConvertible Methods]
IConvertible.GetTypeCode
IConvertible.ToBoolean
IConvertible.ToByte
IConvertible.ToChar
IConvertible.ToDateTime
IConvertible.ToDecimal
IConvertible.ToDouble
IConvertible.ToInt16
IConvertible.ToInt32
IConvertible.ToInt64
IConvertible.ToSByte
IConvertible.ToSingle
IConvertible.ToString
IConvertible.ToType
IConvertible.ToUInt16
IConvertible.ToUInt32
IConvertible.ToUInt64

System.ICustomFormatter interface
[ICustomFormatter Methods]
ICustomFormatter.Format

System.IDisposable interface
[IDisposable Methods]
IDisposable.Dispose

System.IEquatable<T> interface
[IEquatable<T> Methods]
IEquatable<T>.Equals

System.IFormatProvider interface
[IFormatProvider Methods]
IFormatProvider.GetFormat

System.IFormattable interface
[IFormattable Methods]
IFormattable.ToString

System.IndexOutOfRangeException class
IndexOutOfRangeException.IndexOutOfRangeException

System.Int16 structure
[Int16 Fields]
Int16.MaxValue
Int16.MinValue
[Int16 Methods]
Int16.CompareTo
Int16.Equals
Int16.GetHashCode
Int16.GetTypeCode
Int16.Parse
Int16.ToString

System.Int32 structure
[Int32 Fields]
Int32.MaxValue
Int32.MinValue
[Int32 Methods]
Int32.CompareTo
Int32.Equals
Int32.GetHashCode
Int32.GetTypeCode
Int32.Parse
Int32.ToString

System.Int64 structure
[Int64 Fields]
Int64.MaxValue
Int64.MinValue
[Int64 Methods]
Int64.CompareTo
Int64.Equals
Int64.GetHashCode
Int64.GetTypeCode
Int64.Parse
Int64.ToString

System.IntPtr structure
IntPtr.IntPtr
[IntPtr Fields]
IntPtr.Zero
[IntPtr Methods]
IntPtr.Equals
IntPtr.GetHashCode
IntPtr.op_Equality
IntPtr.op_Explicit
IntPtr.op_Inequality
IntPtr.ToInt32
IntPtr.ToInt64
IntPtr.ToPointer
IntPtr.ToString
[IntPtr Properties]
IntPtr.Size

System.InvalidCastException class
InvalidCastException.InvalidCastException

System.InvalidOperationException class
InvalidOperationException.InvalidOperationException

System.InvalidProgramException class
InvalidProgramException.InvalidProgramException

System.IServiceProvider interface
[IServiceProvider Methods]
IServiceProvider.GetService

System.LocalDataStoreSlot class

System.MarshalByRefObject class
MarshalByRefObject.MarshalByRefObject

System.Math class
[Math Fields]
Math.E
Math.PI
[Math Methods]
Math.Abs
Math.Acos
Math.Asin
Math.Atan
Math.Atan2
Math.Ceiling
Math.Cos
Math.Cosh
Math.Exp
Math.Floor
Math.IEEERemainder
Math.Log
Math.Log10
Math.Max
Math.Min
Math.Pow
Math.Round
Math.Sign
Math.Sin
Math.Sinh
Math.Sqrt
Math.Tan
Math.Tanh

System.MemberAccessException class
MemberAccessException.MemberAccessException

System.MethodAccessException class
MethodAccessException.MethodAccessException

System.MissingMemberException class
MissingMemberException.MissingMemberException

System.MissingMethodException class
MissingMethodException.MissingMethodException

System.MulticastDelegate class
[MulticastDelegate Methods]
MulticastDelegate.CombineImpl
MulticastDelegate.Equals
MulticastDelegate.GetHashCode
MulticastDelegate.GetInvocationList
MulticastDelegate.op_Equality
MulticastDelegate.op_Inequality
MulticastDelegate.RemoveImpl

System.MulticastNotSupportedException class
MulticastNotSupportedException.MulticastNotSupportedException

System.NotImplementedException class
NotImplementedException.NotImplementedException

System.NotSupportedException class
NotSupportedException.NotSupportedException

System.Nullable class
[Nullable Methods]
Nullable.Compare<T>
Nullable.Equals<T>
Nullable.GetUnderlyingType

System.Nullable<T> structure
Nullable<T>.Nullable<T>
[Nullable<T> Methods]
Nullable<T>.Equals
Nullable<T>.GetHashCode
Nullable<T>.GetValueOrDefault
Nullable<T>.op_Explicit
Nullable<T>.op_Implicit
Nullable<T>.ToString
[Nullable<T> Properties]
Nullable<T>.HasValue
Nullable<T>.Value

System.NullReferenceException class
NullReferenceException.NullReferenceException

System.Object class
Object.Object
[Object Methods]
Object.Equals
Object.Finalize
Object.GetHashCode
Object.GetType
Object.MemberwiseClone
Object.ReferenceEquals
Object.ToString

System.ObjectDisposedException class
ObjectDisposedException.ObjectDisposedException
[ObjectDisposedException Properties]
ObjectDisposedException.ObjectName

System.ObsoleteAttribute class
ObsoleteAttribute.ObsoleteAttribute
[ObsoleteAttribute Properties]
ObsoleteAttribute.IsError
ObsoleteAttribute.Message

System.OperatingSystem class
OperatingSystem.OperatingSystem
[OperatingSystem Methods]
OperatingSystem.Clone
OperatingSystem.ToString
[OperatingSystem Properties]
OperatingSystem.Platform
OperatingSystem.Version

System.OutOfMemoryException class
OutOfMemoryException.OutOfMemoryException

System.OverflowException class
OverflowException.OverflowException

System.ParamArrayAttribute class
ParamArrayAttribute.ParamArrayAttribute

System.PlatformID enumeration

System.PlatformNotSupportedException class
PlatformNotSupportedException.PlatformNotSupportedException

System.Predicate<T> delegate

System.Random class
Random.Random
[Random Methods]
Random.Next
Random.NextBytes
Random.NextDouble
Random.Sample

System.RankException class
RankException.RankException

System.RuntimeFieldHandle structure
[RuntimeFieldHandle Properties]
RuntimeFieldHandle.Value

System.RuntimeMethodHandle structure
[RuntimeMethodHandle Properties]
RuntimeMethodHandle.Value

System.RuntimeTypeHandle structure

System.SByte structure
[SByte Fields]
SByte.MaxValue
SByte.MinValue
[SByte Methods]
SByte.CompareTo
SByte.Equals
SByte.GetHashCode
SByte.GetTypeCode
SByte.Parse
SByte.ToString

System.SerializableAttribute class
SerializableAttribute.SerializableAttribute

System.Single structure
[Single Fields]
Single.Epsilon
Single.MaxValue
Single.MinValue
Single.NaN
Single.NegativeInfinity
Single.PositiveInfinity
[Single Methods]
Single.CompareTo
Single.Equals
Single.GetHashCode
Single.GetTypeCode
Single.IsInfinity
Single.IsNaN
Single.IsNegativeInfinity
Single.IsPositiveInfinity
Single.Parse
Single.ToString

System.StackOverflowException class
StackOverflowException.StackOverflowException

System.String class
String.String
[String Fields]
String.Empty
[String Methods]
String.Clone
String.Compare
String.CompareOrdinal
String.CompareTo
String.Concat
String.Contains
String.Copy
String.CopyTo
String.EndsWith
String.Equals
String.Format
String.GetEnumerator
String.GetHashCode
String.GetTypeCode
String.IndexOf
String.IndexOfAny
String.Insert
String.Intern
String.IsInterned
String.IsNullOrEmpty
String.Join
String.LastIndexOf
String.LastIndexOfAny
String.op_Equality
String.op_Inequality
String.PadLeft
String.PadRight
String.Remove
String.Replace
String.Split
String.StartsWith
String.Substring
String.ToCharArray
String.ToLower
String.ToString
String.ToUpper
String.Trim
String.TrimEnd
String.TrimStart
[String Properties]
String.Chars
String.Length

System.StringComparer class
StringComparer.StringComparer
[StringComparer Methods]
StringComparer.Compare
StringComparer.Create
StringComparer.Equals
StringComparer.GetHashCode
[StringComparer Properties]
StringComparer.CurrentCulture
StringComparer.CurrentCultureIgnoreCase
StringComparer.InvariantCulture
StringComparer.InvariantCultureIgnoreCase
StringComparer.Ordinal
StringComparer.OrdinalIgnoreCase

System.StringComparison enumeration

System.SystemException class
SystemException.SystemException

System.TimeoutException class
TimeoutException.TimeoutException

System.TimeSpan structure
TimeSpan.TimeSpan
[TimeSpan Fields]
TimeSpan.MaxValue
TimeSpan.MinValue
TimeSpan.TicksPerDay
TimeSpan.TicksPerHour
TimeSpan.TicksPerMillisecond
TimeSpan.TicksPerMinute
TimeSpan.TicksPerSecond
TimeSpan.Zero
[TimeSpan Methods]
TimeSpan.Add
TimeSpan.Compare
TimeSpan.CompareTo
TimeSpan.Duration
TimeSpan.Equals
TimeSpan.FromDays
TimeSpan.FromHours
TimeSpan.FromMilliseconds
TimeSpan.FromMinutes
TimeSpan.FromSeconds
TimeSpan.FromTicks
TimeSpan.GetHashCode
TimeSpan.Negate
TimeSpan.op_Addition
TimeSpan.op_Equality
TimeSpan.op_GreaterThan
TimeSpan.op_GreaterThanOrEqual
TimeSpan.op_Inequality
TimeSpan.op_LessThan
TimeSpan.op_LessThanOrEqual
TimeSpan.op_Subtraction
TimeSpan.op_UnaryNegation
TimeSpan.Parse
TimeSpan.Subtract
TimeSpan.ToString
[TimeSpan Properties]
TimeSpan.Days
TimeSpan.Hours
TimeSpan.Milliseconds
TimeSpan.Minutes
TimeSpan.Seconds
TimeSpan.Ticks
TimeSpan.TotalDays
TimeSpan.TotalHours
TimeSpan.TotalMilliseconds
TimeSpan.TotalMinutes
TimeSpan.TotalSeconds

System.TimeZone class
TimeZone.TimeZone
[TimeZone Methods]
TimeZone.GetDaylightChanges
TimeZone.GetUtcOffset
TimeZone.IsDaylightSavingTime
TimeZone.ToLocalTime
TimeZone.ToUniversalTime
[TimeZone Properties]
TimeZone.CurrentTimeZone
TimeZone.DaylightName
TimeZone.StandardName

System.Type class
Type.Type
[Type Fields]
Type.Delimiter
Type.Missing
[Type Methods]
Type.Equals
Type.GetArrayRank
Type.GetAttributeFlagsImpl
Type.GetConstructor
Type.GetConstructorImpl
Type.GetConstructors
Type.GetDefaultMembers
Type.GetElementType
Type.GetEvent
Type.GetEvents
Type.GetField
Type.GetFields
Type.GetGenericArguments
Type.GetGenericTypeDefinition
Type.GetHashCode
Type.GetInterfaces
Type.GetMember
Type.GetMembers
Type.GetMethod
Type.GetMethodImpl
Type.GetMethods
Type.GetNestedType
Type.GetNestedTypes
Type.GetProperties
Type.GetProperty
Type.GetPropertyImpl
Type.GetType
Type.GetTypeCode
Type.GetTypeFromHandle
Type.HasElementTypeImpl
Type.InvokeMember
Type.IsArrayImpl
Type.IsAssignableFrom
Type.IsByRefImpl
Type.IsCOMObjectImpl
Type.IsInstanceOfType
Type.IsPointerImpl
Type.IsPrimitiveImpl
Type.IsSubclassOf
Type.IsValueTypeImpl
Type.MakeGenericType
Type.ToString
[Type Properties]
Type.Assembly
Type.AssemblyQualifiedName
Type.Attributes
Type.BaseType
Type.ContainsGenericParameters
Type.DeclaringType
Type.DefaultBinder
Type.FullName
Type.HasElementType
Type.IsAbstract
Type.IsAnsiClass
Type.IsArray
Type.IsAutoClass
Type.IsAutoLayout
Type.IsByRef
Type.IsClass
Type.IsCOMObject
Type.IsEnum
Type.IsGenericParameter
Type.IsGenericType
Type.IsGenericTypeDefinition
Type.IsImport
Type.IsInterface
Type.IsNestedAssembly
Type.IsNestedFamANDAssem
Type.IsNestedFamily
Type.IsNestedFamORAssem
Type.IsNestedPrivate
Type.IsNestedPublic
Type.IsNotPublic
Type.IsPointer
Type.IsPrimitive
Type.IsPublic
Type.IsSealed
Type.IsSpecialName
Type.IsUnicodeClass
Type.IsValueType
Type.IsVisible
Type.MemberType
Type.Module
Type.Namespace
Type.ReflectedType
Type.TypeHandle
Type.UnderlyingSystemType

System.TypeCode enumeration

System.TypedReference structure

System.TypeLoadException class
TypeLoadException.TypeLoadException

System.UInt16 structure
[UInt16 Fields]
UInt16.MaxValue
UInt16.MinValue
[UInt16 Methods]
UInt16.CompareTo
UInt16.Equals
UInt16.GetHashCode
UInt16.GetTypeCode
UInt16.Parse
UInt16.ToString

System.UInt32 structure
[UInt32 Fields]
UInt32.MaxValue
UInt32.MinValue
[UInt32 Methods]
UInt32.CompareTo
UInt32.Equals
UInt32.GetHashCode
UInt32.GetTypeCode
UInt32.Parse
UInt32.ToString

System.UInt64 structure
[UInt64 Fields]
UInt64.MaxValue
UInt64.MinValue
[UInt64 Methods]
UInt64.CompareTo
UInt64.Equals
UInt64.GetHashCode
UInt64.GetTypeCode
UInt64.Parse
UInt64.ToString

System.UIntPtr structure
UIntPtr.UIntPtr
[UIntPtr Fields]
UIntPtr.Zero
[UIntPtr Methods]
UIntPtr.Equals
UIntPtr.GetHashCode
UIntPtr.op_Equality
UIntPtr.op_Explicit
UIntPtr.op_Inequality
UIntPtr.ToPointer
UIntPtr.ToString
UIntPtr.ToUInt32
UIntPtr.ToUInt64
[UIntPtr Properties]
UIntPtr.Size

System.UnauthorizedAccessException class
UnauthorizedAccessException.UnauthorizedAccessException

System.UnhandledExceptionEventArgs class
UnhandledExceptionEventArgs.UnhandledExceptionEventArgs
[UnhandledExceptionEventArgs Properties]
UnhandledExceptionEventArgs.ExceptionObject
UnhandledExceptionEventArgs.IsTerminating

System.UnhandledExceptionEventHandler delegate

System.Uri class
Uri.Uri
[Uri Fields]
Uri.SchemeDelimiter
Uri.UriSchemeFile
Uri.UriSchemeFtp
Uri.UriSchemeGopher
Uri.UriSchemeHttp
Uri.UriSchemeHttps
Uri.UriSchemeMailto
Uri.UriSchemeNetPipe
Uri.UriSchemeNetTcp
Uri.UriSchemeNews
Uri.UriSchemeNntp
[Uri Methods]
Uri.Canonicalize
Uri.CheckHostName
Uri.CheckSchemeName
Uri.CheckSecurity
Uri.Compare
Uri.Equals
Uri.Escape
Uri.EscapeDataString
Uri.EscapeString
Uri.EscapeUriString
Uri.FromHex
Uri.GetComponents
Uri.GetHashCode
Uri.GetLeftPart
Uri.HexEscape
Uri.HexUnescape
Uri.IsBadFileSystemCharacter
Uri.IsBaseOf
Uri.IsExcludedCharacter
Uri.IsHexDigit
Uri.IsHexEncoding
Uri.IsReservedCharacter
Uri.IsWellFormedOriginalString
Uri.IsWellFormedUriString
Uri.MakeRelative
Uri.MakeRelativeUri
Uri.op_Equality
Uri.op_Inequality
Uri.Parse
Uri.ToString
Uri.TryCreate
Uri.Unescape
Uri.UnescapeDataString
[Uri Properties]
Uri.AbsolutePath
Uri.AbsoluteUri
Uri.Authority
Uri.DnsSafeHost
Uri.Fragment
Uri.Host
Uri.HostNameType
Uri.IsAbsoluteUri
Uri.IsDefaultPort
Uri.IsFile
Uri.IsLoopback
Uri.IsUnc
Uri.LocalPath
Uri.OriginalString
Uri.PathAndQuery
Uri.Port
Uri.Query
Uri.Scheme
Uri.Segments
Uri.UserEscaped
Uri.UserInfo

System.UriComponents enumeration

System.UriFormat enumeration

System.UriFormatException class
UriFormatException.UriFormatException

System.UriHostNameType enumeration

System.UriKind enumeration

System.UriPartial enumeration

System.ValueType class
ValueType.ValueType
[ValueType Methods]
ValueType.Equals
ValueType.GetHashCode

System.Version class
Version.Version
[Version Methods]
Version.Clone
Version.CompareTo
Version.Equals
Version.GetHashCode
Version.op_Equality
Version.op_GreaterThan
Version.op_GreaterThanOrEqual
Version.op_Inequality
Version.op_LessThan
Version.op_LessThanOrEqual
Version.ToString
[Version Properties]
Version.Build
Version.Major
Version.Minor
Version.Revision

System.Void structure

System.WeakReference class
WeakReference.WeakReference
[WeakReference Methods]
WeakReference.Finalize
[WeakReference Properties]
WeakReference.IsAlive
WeakReference.Target
WeakReference.TrackResurrection

System.CodeDom.Compiler namespace

System.CodeDom.Compiler.GeneratedCodeAttribute class
GeneratedCodeAttribute.GeneratedCodeAttribute
[GeneratedCodeAttribute Properties]
GeneratedCodeAttribute.Tool
GeneratedCodeAttribute.Version

System.Collections namespace

System.Collections.ArrayList class
ArrayList.ArrayList
[ArrayList Methods]
ArrayList.Add
ArrayList.AddRange
ArrayList.BinarySearch
ArrayList.Clear
ArrayList.Clone
ArrayList.Contains
ArrayList.CopyTo
ArrayList.GetEnumerator
ArrayList.IndexOf
ArrayList.Insert
ArrayList.InsertRange
ArrayList.Remove
ArrayList.RemoveAt
ArrayList.RemoveRange
ArrayList.Reverse
ArrayList.Sort
ArrayList.Synchronized
ArrayList.ToArray
ArrayList.TrimToSize
[ArrayList Properties]
ArrayList.Capacity
ArrayList.Count
ArrayList.IsFixedSize
ArrayList.IsReadOnly
ArrayList.IsSynchronized
ArrayList.Item
ArrayList.SyncRoot

System.Collections.BitArray class
BitArray.BitArray
[BitArray Methods]
BitArray.And
BitArray.Clone
BitArray.CopyTo
BitArray.Get
BitArray.GetEnumerator
BitArray.Not
BitArray.Or
BitArray.Set
BitArray.SetAll
BitArray.Xor
[BitArray Properties]
BitArray.Count
BitArray.IsReadOnly
BitArray.IsSynchronized
BitArray.Item
BitArray.Length
BitArray.SyncRoot

System.Collections.CaseInsensitiveComparer class
CaseInsensitiveComparer.CaseInsensitiveComparer
[CaseInsensitiveComparer Methods]
CaseInsensitiveComparer.Compare
[CaseInsensitiveComparer Properties]
CaseInsensitiveComparer.Default
CaseInsensitiveComparer.DefaultInvariant

System.Collections.CaseInsensitiveHashCodeProvider class
CaseInsensitiveHashCodeProvider.CaseInsensitiveHashCodeProvider
[CaseInsensitiveHashCodeProvider Methods]
CaseInsensitiveHashCodeProvider.GetHashCode
[CaseInsensitiveHashCodeProvider Properties]
CaseInsensitiveHashCodeProvider.Default
CaseInsensitiveHashCodeProvider.DefaultInvariant

System.Collections.CollectionBase class
CollectionBase.CollectionBase
[CollectionBase Methods]
CollectionBase.Clear
CollectionBase.GetEnumerator
CollectionBase.OnClear
CollectionBase.OnClearComplete
CollectionBase.OnInsert
CollectionBase.OnInsertComplete
CollectionBase.OnRemove
CollectionBase.OnRemoveComplete
CollectionBase.OnSet
CollectionBase.OnSetComplete
CollectionBase.OnValidate
CollectionBase.RemoveAt
[CollectionBase Properties]
CollectionBase.Capacity
CollectionBase.Count
CollectionBase.InnerList
CollectionBase.List

System.Collections.Comparer class
Comparer.Comparer
[Comparer Fields]
Comparer.Default
Comparer.DefaultInvariant
[Comparer Methods]
Comparer.Compare

System.Collections.DictionaryEntry structure
DictionaryEntry.DictionaryEntry
[DictionaryEntry Properties]
DictionaryEntry.Key
DictionaryEntry.Value

System.Collections.Hashtable class
Hashtable.Hashtable
[Hashtable Methods]
Hashtable.Add
Hashtable.Clear
Hashtable.Clone
Hashtable.Contains
Hashtable.ContainsKey
Hashtable.ContainsValue
Hashtable.CopyTo
Hashtable.GetEnumerator
Hashtable.GetHash
Hashtable.KeyEquals
Hashtable.Remove
Hashtable.Synchronized
[Hashtable Properties]
Hashtable.comparer
Hashtable.Count
Hashtable.EqualityComparer
Hashtable.hcp
Hashtable.IsFixedSize
Hashtable.IsReadOnly
Hashtable.IsSynchronized
Hashtable.Item
Hashtable.Keys
Hashtable.SyncRoot
Hashtable.Values

System.Collections.ICollection interface
[ICollection Methods]
ICollection.CopyTo
[ICollection Properties]
ICollection.Count
ICollection.IsSynchronized
ICollection.SyncRoot

System.Collections.IComparer interface
[IComparer Methods]
IComparer.Compare

System.Collections.IDictionary interface
[IDictionary Methods]
IDictionary.Add
IDictionary.Clear
IDictionary.Contains
IDictionary.GetEnumerator
IDictionary.Remove
[IDictionary Properties]
IDictionary.IsFixedSize
IDictionary.IsReadOnly
IDictionary.Item
IDictionary.Keys
IDictionary.Values

System.Collections.IDictionaryEnumerator interface
[IDictionaryEnumerator Properties]
IDictionaryEnumerator.Entry
IDictionaryEnumerator.Key
IDictionaryEnumerator.Value

System.Collections.IEnumerable interface
[IEnumerable Methods]
IEnumerable.GetEnumerator

System.Collections.IEnumerator interface
[IEnumerator Methods]
IEnumerator.MoveNext
IEnumerator.Reset
[IEnumerator Properties]
IEnumerator.Current

System.Collections.IEqualityComparer interface
[IEqualityComparer Methods]
IEqualityComparer.Equals
IEqualityComparer.GetHashCode

System.Collections.IHashCodeProvider interface
[IHashCodeProvider Methods]
IHashCodeProvider.GetHashCode

System.Collections.IList interface
[IList Methods]
IList.Add
IList.Clear
IList.Contains
IList.IndexOf
IList.Insert
IList.Remove
IList.RemoveAt
[IList Properties]
IList.IsFixedSize
IList.IsReadOnly
IList.Item

System.Collections.Queue class
Queue.Queue
[Queue Methods]
Queue.Clear
Queue.Clone
Queue.Contains
Queue.CopyTo
Queue.Dequeue
Queue.Enqueue
Queue.GetEnumerator
Queue.Peek
Queue.ToArray
Queue.TrimToSize
[Queue Properties]
Queue.Count
Queue.IsSynchronized
Queue.SyncRoot

System.Collections.SortedList class
SortedList.SortedList
[SortedList Methods]
SortedList.Add
SortedList.Clear
SortedList.Clone
SortedList.Contains
SortedList.ContainsKey
SortedList.ContainsValue
SortedList.CopyTo
SortedList.GetByIndex
SortedList.GetEnumerator
SortedList.GetKey
SortedList.GetKeyList
SortedList.GetValueList
SortedList.IndexOfKey
SortedList.IndexOfValue
SortedList.Remove
SortedList.RemoveAt
SortedList.SetByIndex
SortedList.Synchronized
SortedList.TrimToSize
[SortedList Properties]
SortedList.Capacity
SortedList.Count
SortedList.IsFixedSize
SortedList.IsReadOnly
SortedList.IsSynchronized
SortedList.Item
SortedList.Keys
SortedList.SyncRoot
SortedList.Values

System.Collections.Stack class
Stack.Stack
[Stack Methods]
Stack.Clear
Stack.Clone
Stack.Contains
Stack.CopyTo
Stack.GetEnumerator
Stack.Peek
Stack.Pop
Stack.Push
Stack.Synchronized
Stack.ToArray
[Stack Properties]
Stack.Count
Stack.IsSynchronized
Stack.SyncRoot

System.Collections.Generic namespace

System.Collections.Generic.Comparer<T> class
Comparer<T>.Comparer<T>
[Comparer<T> Methods]
Comparer<T>.Compare
[Comparer<T> Properties]
Comparer<T>.Default

System.Collections.Generic.Dictionary<TKey><TValue> class
Dictionary<TKey><TValue>.Dictionary<TKey><TValue>
[Dictionary<TKey><TValue> Methods]
Dictionary<TKey><TValue>.Add
Dictionary<TKey><TValue>.Clear
Dictionary<TKey><TValue>.ContainsKey
Dictionary<TKey><TValue>.ContainsValue
Dictionary<TKey><TValue>.GetEnumerator
Dictionary<TKey><TValue>.Remove
Dictionary<TKey><TValue>.TryGetValue
[Dictionary<TKey><TValue> Properties]
Dictionary<TKey><TValue>.Comparer
Dictionary<TKey><TValue>.Count
Dictionary<TKey><TValue>.Item
Dictionary<TKey><TValue>.Keys
Dictionary<TKey><TValue>.Values

System.Collections.Generic.Dictionary<TKey><TValue>.Enumerator structure
[Dictionary<TKey><TValue>.Enumerator Methods]
Dictionary<TKey><TValue>.Enumerator.Dispose
Dictionary<TKey><TValue>.Enumerator.MoveNext
[Dictionary<TKey><TValue>.Enumerator Properties]
Dictionary<TKey><TValue>.Enumerator.Current

System.Collections.Generic.Dictionary<TKey><TValue>.KeyCollection class
Dictionary<TKey><TValue>.KeyCollection.Dictionary<TKey><TValue>.KeyCollection
[Dictionary<TKey><TValue>.KeyCollection Methods]
Dictionary<TKey><TValue>.KeyCollection.CopyTo
Dictionary<TKey><TValue>.KeyCollection.GetEnumerator
[Dictionary<TKey><TValue>.KeyCollection Properties]
Dictionary<TKey><TValue>.KeyCollection.Count

System.Collections.Generic.Dictionary<TKey><TValue>.KeyCollection.Enumerator structure
[Dictionary<TKey><TValue>.KeyCollection.Enumerator Methods]
Dictionary<TKey><TValue>.KeyCollection.Enumerator.Dispose
Dictionary<TKey><TValue>.KeyCollection.Enumerator.MoveNext
[Dictionary<TKey><TValue>.KeyCollection.Enumerator Properties]
Dictionary<TKey><TValue>.KeyCollection.Enumerator.Current

System.Collections.Generic.Dictionary<TKey><TValue>.ValueCollection class
Dictionary<TKey><TValue>.ValueCollection.Dictionary<TKey><TValue>.ValueCollection
[Dictionary<TKey><TValue>.ValueCollection Methods]
Dictionary<TKey><TValue>.ValueCollection.CopyTo
Dictionary<TKey><TValue>.ValueCollection.GetEnumerator
[Dictionary<TKey><TValue>.ValueCollection Properties]
Dictionary<TKey><TValue>.ValueCollection.Count

System.Collections.Generic.Dictionary<TKey><TValue>.ValueCollection.Enumerator structure
[Dictionary<TKey><TValue>.ValueCollection.Enumerator Methods]
Dictionary<TKey><TValue>.ValueCollection.Enumerator.Dispose
Dictionary<TKey><TValue>.ValueCollection.Enumerator.MoveNext
[Dictionary<TKey><TValue>.ValueCollection.Enumerator Properties]
Dictionary<TKey><TValue>.ValueCollection.Enumerator.Current

System.Collections.Generic.EqualityComparer<T> class
EqualityComparer<T>.EqualityComparer<T>
[EqualityComparer<T> Methods]
EqualityComparer<T>.Equals
EqualityComparer<T>.GetHashCode
[EqualityComparer<T> Properties]
EqualityComparer<T>.Default

System.Collections.Generic.ICollection<T> interface
[ICollection<T> Methods]
ICollection<T>.Add
ICollection<T>.Clear
ICollection<T>.Contains
ICollection<T>.CopyTo
ICollection<T>.Remove
[ICollection<T> Properties]
ICollection<T>.Count
ICollection<T>.IsReadOnly

System.Collections.Generic.IComparer<T> interface
[IComparer<T> Methods]
IComparer<T>.Compare

System.Collections.Generic.IDictionary<TKey><TValue> interface
[IDictionary<TKey><TValue> Methods]
IDictionary<TKey><TValue>.Add
IDictionary<TKey><TValue>.ContainsKey
IDictionary<TKey><TValue>.Remove
IDictionary<TKey><TValue>.TryGetValue
[IDictionary<TKey><TValue> Properties]
IDictionary<TKey><TValue>.Item
IDictionary<TKey><TValue>.Keys
IDictionary<TKey><TValue>.Values

System.Collections.Generic.IEnumerable<T> interface
[IEnumerable<T> Methods]
IEnumerable<T>.GetEnumerator

System.Collections.Generic.IEnumerator<T> interface
[IEnumerator<T> Properties]
IEnumerator<T>.Current

System.Collections.Generic.IEqualityComparer<T> interface
[IEqualityComparer<T> Methods]
IEqualityComparer<T>.Equals
IEqualityComparer<T>.GetHashCode

System.Collections.Generic.IList<T> interface
[IList<T> Methods]
IList<T>.IndexOf
IList<T>.Insert
IList<T>.RemoveAt
[IList<T> Properties]
IList<T>.Item

System.Collections.Generic.KeyNotFoundException class
KeyNotFoundException.KeyNotFoundException

System.Collections.Generic.KeyValuePair<TKey><TValue> structure
KeyValuePair<TKey><TValue>.KeyValuePair<TKey><TValue>
[KeyValuePair<TKey><TValue> Methods]
KeyValuePair<TKey><TValue>.ToString
[KeyValuePair<TKey><TValue> Properties]
KeyValuePair<TKey><TValue>.Key
KeyValuePair<TKey><TValue>.Value

System.Collections.Generic.LinkedList<T> class
LinkedList<T>.LinkedList<T>
[LinkedList<T> Methods]
LinkedList<T>.AddAfter
LinkedList<T>.AddBefore
LinkedList<T>.AddFirst
LinkedList<T>.AddLast
LinkedList<T>.Clear
LinkedList<T>.Contains
LinkedList<T>.CopyTo
LinkedList<T>.Find
LinkedList<T>.FindLast
LinkedList<T>.GetEnumerator
LinkedList<T>.Remove
LinkedList<T>.RemoveFirst
LinkedList<T>.RemoveLast
[LinkedList<T> Properties]
LinkedList<T>.Count
LinkedList<T>.First
LinkedList<T>.Last

System.Collections.Generic.LinkedList<T>.Enumerator structure
[LinkedList<T>.Enumerator Methods]
LinkedList<T>.Enumerator.Dispose
LinkedList<T>.Enumerator.MoveNext
[LinkedList<T>.Enumerator Properties]
LinkedList<T>.Enumerator.Current

System.Collections.Generic.LinkedListNode<T> class
LinkedListNode<T>.LinkedListNode<T>
[LinkedListNode<T> Properties]
LinkedListNode<T>.List
LinkedListNode<T>.Next
LinkedListNode<T>.Previous
LinkedListNode<T>.Value

System.Collections.Generic.List<T> class
List<T>.List<T>
[List<T> Methods]
List<T>.Add
List<T>.AddRange
List<T>.AsReadOnly
List<T>.BinarySearch
List<T>.Clear
List<T>.Contains
List<T>.ConvertAll<TOutput>
List<T>.CopyTo
List<T>.Exists
List<T>.Find
List<T>.FindAll
List<T>.FindIndex
List<T>.FindLast
List<T>.FindLastIndex
List<T>.ForEach
List<T>.GetEnumerator
List<T>.GetRange
List<T>.IndexOf
List<T>.Insert
List<T>.InsertRange
List<T>.LastIndexOf
List<T>.Remove
List<T>.RemoveAll
List<T>.RemoveAt
List<T>.RemoveRange
List<T>.Reverse
List<T>.Sort
List<T>.ToArray
List<T>.TrimExcess
List<T>.TrueForAll
[List<T> Properties]
List<T>.Capacity
List<T>.Count
List<T>.Item

System.Collections.Generic.List<T>.Enumerator structure
[List<T>.Enumerator Methods]
List<T>.Enumerator.Dispose
List<T>.Enumerator.MoveNext
[List<T>.Enumerator Properties]
List<T>.Enumerator.Current

System.Collections.Generic.Queue<T> class
Queue<T>.Queue<T>
[Queue<T> Methods]
Queue<T>.Clear
Queue<T>.Contains
Queue<T>.CopyTo
Queue<T>.Dequeue
Queue<T>.Enqueue
Queue<T>.GetEnumerator
Queue<T>.Peek
Queue<T>.ToArray
Queue<T>.TrimExcess
[Queue<T> Properties]
Queue<T>.Count

System.Collections.Generic.Queue<T>.Enumerator structure
[Queue<T>.Enumerator Methods]
Queue<T>.Enumerator.Dispose
Queue<T>.Enumerator.MoveNext
[Queue<T>.Enumerator Properties]
Queue<T>.Enumerator.Current

System.Collections.Generic.SortedList<TKey><TValue> class
SortedList<TKey><TValue>.SortedList<TKey><TValue>
[SortedList<TKey><TValue> Methods]
SortedList<TKey><TValue>.Add
SortedList<TKey><TValue>.Clear
SortedList<TKey><TValue>.ContainsKey
SortedList<TKey><TValue>.ContainsValue
SortedList<TKey><TValue>.GetEnumerator
SortedList<TKey><TValue>.IndexOfKey
SortedList<TKey><TValue>.IndexOfValue
SortedList<TKey><TValue>.Remove
SortedList<TKey><TValue>.RemoveAt
SortedList<TKey><TValue>.TrimExcess
SortedList<TKey><TValue>.TryGetValue
[SortedList<TKey><TValue> Properties]
SortedList<TKey><TValue>.Capacity
SortedList<TKey><TValue>.Comparer
SortedList<TKey><TValue>.Count
SortedList<TKey><TValue>.Item
SortedList<TKey><TValue>.Keys
SortedList<TKey><TValue>.Values

System.Collections.Generic.Stack<T> class
Stack<T>.Stack<T>
[Stack<T> Methods]
Stack<T>.Clear
Stack<T>.Contains
Stack<T>.CopyTo
Stack<T>.GetEnumerator
Stack<T>.Peek
Stack<T>.Pop
Stack<T>.Push
Stack<T>.ToArray
Stack<T>.TrimExcess
[Stack<T> Properties]
Stack<T>.Count

System.Collections.Generic.Stack<T>.Enumerator structure
[Stack<T>.Enumerator Methods]
Stack<T>.Enumerator.Dispose
Stack<T>.Enumerator.MoveNext
[Stack<T>.Enumerator Properties]
Stack<T>.Enumerator.Current

System.Collections.ObjectModel namespace

System.Collections.ObjectModel.Collection<T> class
Collection<T>.Collection<T>
[Collection<T> Methods]
Collection<T>.Add
Collection<T>.Clear
Collection<T>.ClearItems
Collection<T>.Contains
Collection<T>.CopyTo
Collection<T>.GetEnumerator
Collection<T>.IndexOf
Collection<T>.Insert
Collection<T>.InsertItem
Collection<T>.Remove
Collection<T>.RemoveAt
Collection<T>.RemoveItem
Collection<T>.SetItem
[Collection<T> Properties]
Collection<T>.Count
Collection<T>.Item
Collection<T>.Items

System.Collections.ObjectModel.KeyedCollection<TKey><TItem> class
KeyedCollection<TKey><TItem>.KeyedCollection<TKey><TItem>
[KeyedCollection<TKey><TItem> Methods]
KeyedCollection<TKey><TItem>.ChangeItemKey
KeyedCollection<TKey><TItem>.ClearItems
KeyedCollection<TKey><TItem>.Contains
KeyedCollection<TKey><TItem>.GetKeyForItem
KeyedCollection<TKey><TItem>.InsertItem
KeyedCollection<TKey><TItem>.Remove
KeyedCollection<TKey><TItem>.RemoveItem
KeyedCollection<TKey><TItem>.SetItem
[KeyedCollection<TKey><TItem> Properties]
KeyedCollection<TKey><TItem>.Comparer
KeyedCollection<TKey><TItem>.Dictionary
KeyedCollection<TKey><TItem>.Item

System.Collections.ObjectModel.ReadOnlyCollection<T> class
ReadOnlyCollection<T>.ReadOnlyCollection<T>
[ReadOnlyCollection<T> Methods]
ReadOnlyCollection<T>.Contains
ReadOnlyCollection<T>.CopyTo
ReadOnlyCollection<T>.GetEnumerator
ReadOnlyCollection<T>.IndexOf
[ReadOnlyCollection<T> Properties]
ReadOnlyCollection<T>.Count
ReadOnlyCollection<T>.Item
ReadOnlyCollection<T>.Items

System.Collections.Specialized namespace

System.Collections.Specialized.BitVector32 structure
BitVector32.BitVector32
[BitVector32 Methods]
BitVector32.CreateMask
BitVector32.CreateSection
BitVector32.Equals
BitVector32.GetHashCode
BitVector32.ToString
[BitVector32 Properties]
BitVector32.Data
BitVector32.Item
BitVector32.Item

System.Collections.Specialized.BitVector32.Section structure
[BitVector32.Section Methods]
BitVector32.Section.Equals
BitVector32.Section.GetHashCode
BitVector32.Section.op_Equality
BitVector32.Section.op_Inequality
BitVector32.Section.ToString
[BitVector32.Section Properties]
BitVector32.Section.Mask
BitVector32.Section.Offset

System.Collections.Specialized.HybridDictionary class
HybridDictionary.HybridDictionary
[HybridDictionary Methods]
HybridDictionary.Add
HybridDictionary.Clear
HybridDictionary.Contains
HybridDictionary.CopyTo
HybridDictionary.GetEnumerator
HybridDictionary.Remove
[HybridDictionary Properties]
HybridDictionary.Count
HybridDictionary.IsFixedSize
HybridDictionary.IsReadOnly
HybridDictionary.IsSynchronized
HybridDictionary.Item
HybridDictionary.Keys
HybridDictionary.SyncRoot
HybridDictionary.Values

System.Collections.Specialized.ListDictionary class
ListDictionary.ListDictionary
[ListDictionary Methods]
ListDictionary.Add
ListDictionary.Clear
ListDictionary.Contains
ListDictionary.CopyTo
ListDictionary.GetEnumerator
ListDictionary.Remove
[ListDictionary Properties]
ListDictionary.Count
ListDictionary.IsFixedSize
ListDictionary.IsReadOnly
ListDictionary.IsSynchronized
ListDictionary.Item
ListDictionary.Keys
ListDictionary.SyncRoot
ListDictionary.Values

System.Collections.Specialized.NameObjectCollectionBase class
NameObjectCollectionBase.NameObjectCollectionBase
[NameObjectCollectionBase Methods]
NameObjectCollectionBase.BaseAdd
NameObjectCollectionBase.BaseClear
NameObjectCollectionBase.BaseGet
NameObjectCollectionBase.BaseGetAllKeys
NameObjectCollectionBase.BaseGetKey
NameObjectCollectionBase.BaseHasKeys
NameObjectCollectionBase.BaseRemove
NameObjectCollectionBase.BaseRemoveAt
NameObjectCollectionBase.BaseSet
NameObjectCollectionBase.GetEnumerator
[NameObjectCollectionBase Properties]
NameObjectCollectionBase.Count
NameObjectCollectionBase.IsReadOnly
NameObjectCollectionBase.Keys

System.Collections.Specialized.NameObjectCollectionBase.KeysCollection class
[NameObjectCollectionBase.KeysCollection Methods]
NameObjectCollectionBase.KeysCollection.Get
NameObjectCollectionBase.KeysCollection.GetEnumerator
[NameObjectCollectionBase.KeysCollection Properties]
NameObjectCollectionBase.KeysCollection.Count
NameObjectCollectionBase.KeysCollection.Item

System.Collections.Specialized.NameValueCollection class
NameValueCollection.NameValueCollection
[NameValueCollection Methods]
NameValueCollection.Add
NameValueCollection.Clear
NameValueCollection.Get
NameValueCollection.GetKey
NameValueCollection.GetValues
NameValueCollection.HasKeys
NameValueCollection.InvalidateCachedArrays
NameValueCollection.Remove
NameValueCollection.Set
[NameValueCollection Properties]
NameValueCollection.AllKeys
NameValueCollection.Item
NameValueCollection.Item

System.Collections.Specialized.StringDictionary class
StringDictionary.StringDictionary
[StringDictionary Methods]
StringDictionary.Add
StringDictionary.Clear
StringDictionary.ContainsKey
StringDictionary.ContainsValue
StringDictionary.CopyTo
StringDictionary.GetEnumerator
StringDictionary.Remove
[StringDictionary Properties]
StringDictionary.Count
StringDictionary.IsSynchronized
StringDictionary.Item
StringDictionary.Keys
StringDictionary.SyncRoot
StringDictionary.Values

System.ComponentModel namespace

System.ComponentModel.AddingNewEventArgs class
AddingNewEventArgs.AddingNewEventArgs
[AddingNewEventArgs Properties]
AddingNewEventArgs.NewObject

System.ComponentModel.AddingNewEventHandler delegate

System.ComponentModel.AsyncCompletedEventArgs class
AsyncCompletedEventArgs.AsyncCompletedEventArgs
[AsyncCompletedEventArgs Methods]
AsyncCompletedEventArgs.RaiseExceptionIfNecessary
[AsyncCompletedEventArgs Properties]
AsyncCompletedEventArgs.Cancelled
AsyncCompletedEventArgs.Error
AsyncCompletedEventArgs.UserState

System.ComponentModel.AsyncCompletedEventHandler delegate

System.ComponentModel.AttributeCollection class
AttributeCollection.AttributeCollection
[AttributeCollection Fields]
AttributeCollection.Empty
[AttributeCollection Methods]
AttributeCollection.Contains
AttributeCollection.CopyTo
AttributeCollection.GetDefaultAttribute
AttributeCollection.GetEnumerator
AttributeCollection.Matches
[AttributeCollection Properties]
AttributeCollection.Count
AttributeCollection.Item
AttributeCollection.Item

System.ComponentModel.BindingList<T> class
BindingList<T>.BindingList<T>
[BindingList<T> Methods]
BindingList<T>.AddNew
BindingList<T>.AddNewCore
BindingList<T>.ApplySortCore
BindingList<T>.CancelNew
BindingList<T>.ClearItems
BindingList<T>.EndNew
BindingList<T>.FindCore
BindingList<T>.InsertItem
BindingList<T>.OnAddingNew
BindingList<T>.OnListChanged
BindingList<T>.RemoveItem
BindingList<T>.RemoveSortCore
BindingList<T>.ResetBindings
BindingList<T>.ResetItem
BindingList<T>.SetItem
[BindingList<T> Properties]
BindingList<T>.AllowEdit
BindingList<T>.AllowNew
BindingList<T>.AllowRemove
BindingList<T>.IsSortedCore
BindingList<T>.RaiseListChangedEvents
BindingList<T>.SortDirectionCore
BindingList<T>.SortPropertyCore
BindingList<T>.SupportsChangeNotificationCore
BindingList<T>.SupportsSearchingCore
BindingList<T>.SupportsSortingCore
[BindingList<T> Events]
BindingList<T>.AddingNew
BindingList<T>.ListChanged

System.ComponentModel.CancelEventArgs class
CancelEventArgs.CancelEventArgs
[CancelEventArgs Properties]
CancelEventArgs.Cancel

System.ComponentModel.CancelEventHandler delegate

System.ComponentModel.CollectionChangeAction enumeration

System.ComponentModel.CollectionChangeEventArgs class
CollectionChangeEventArgs.CollectionChangeEventArgs
[CollectionChangeEventArgs Properties]
CollectionChangeEventArgs.Action
CollectionChangeEventArgs.Element

System.ComponentModel.CollectionChangeEventHandler delegate

System.ComponentModel.Component class
Component.Component
[Component Methods]
Component.Dispose
Component.Finalize
[Component Properties]
Component.Events
Component.Site
[Component Events]
Component.Disposed

System.ComponentModel.ComponentResourceManager class
ComponentResourceManager.ComponentResourceManager
[ComponentResourceManager Methods]
ComponentResourceManager.ApplyResources

System.ComponentModel.Container class
Container.Container
[Container Methods]
Container.Add
Container.CreateSite
Container.Dispose
Container.GetService
Container.Remove

System.ComponentModel.DataObjectAttribute class
DataObjectAttribute.DataObjectAttribute
[DataObjectAttribute Fields]
DataObjectAttribute.DataObject
DataObjectAttribute.Default
DataObjectAttribute.NonDataObject
[DataObjectAttribute Methods]
DataObjectAttribute.Equals
DataObjectAttribute.GetHashCode
[DataObjectAttribute Properties]
DataObjectAttribute.IsDataObject

System.ComponentModel.DataObjectMethodAttribute class
DataObjectMethodAttribute.DataObjectMethodAttribute
[DataObjectMethodAttribute Methods]
DataObjectMethodAttribute.Equals
DataObjectMethodAttribute.GetHashCode
DataObjectMethodAttribute.Match
[DataObjectMethodAttribute Properties]
DataObjectMethodAttribute.IsDefault
DataObjectMethodAttribute.MethodType

System.ComponentModel.DataObjectMethodType enumeration

System.ComponentModel.DefaultValueAttribute class
DefaultValueAttribute.DefaultValueAttribute
[DefaultValueAttribute Methods]
DefaultValueAttribute.Equals
DefaultValueAttribute.GetHashCode
[DefaultValueAttribute Properties]
DefaultValueAttribute.Value

System.ComponentModel.DesignerCategoryAttribute class
DesignerCategoryAttribute.DesignerCategoryAttribute
[DesignerCategoryAttribute Fields]
DesignerCategoryAttribute.Component
DesignerCategoryAttribute.Default
DesignerCategoryAttribute.Form
DesignerCategoryAttribute.Generic
[DesignerCategoryAttribute Methods]
DesignerCategoryAttribute.Equals
DesignerCategoryAttribute.GetHashCode
[DesignerCategoryAttribute Properties]
DesignerCategoryAttribute.Category

System.ComponentModel.DesignTimeVisibleAttribute class
DesignTimeVisibleAttribute.DesignTimeVisibleAttribute
[DesignTimeVisibleAttribute Fields]
DesignTimeVisibleAttribute.Default
DesignTimeVisibleAttribute.No
DesignTimeVisibleAttribute.Yes
[DesignTimeVisibleAttribute Methods]
DesignTimeVisibleAttribute.Equals
DesignTimeVisibleAttribute.GetHashCode
[DesignTimeVisibleAttribute Properties]
DesignTimeVisibleAttribute.Visible

System.ComponentModel.EditorBrowsableAttribute class
EditorBrowsableAttribute.EditorBrowsableAttribute
[EditorBrowsableAttribute Methods]
EditorBrowsableAttribute.Equals
EditorBrowsableAttribute.GetHashCode
[EditorBrowsableAttribute Properties]
EditorBrowsableAttribute.State

System.ComponentModel.EditorBrowsableState enumeration

System.ComponentModel.EventDescriptor class
EventDescriptor.EventDescriptor
[EventDescriptor Methods]
EventDescriptor.AddEventHandler
EventDescriptor.RemoveEventHandler
[EventDescriptor Properties]
EventDescriptor.ComponentType
EventDescriptor.EventType
EventDescriptor.IsMulticast

System.ComponentModel.EventDescriptorCollection class
EventDescriptorCollection.EventDescriptorCollection
[EventDescriptorCollection Fields]
EventDescriptorCollection.Empty
[EventDescriptorCollection Methods]
EventDescriptorCollection.Add
EventDescriptorCollection.Clear
EventDescriptorCollection.Contains
EventDescriptorCollection.Find
EventDescriptorCollection.GetEnumerator
EventDescriptorCollection.IndexOf
EventDescriptorCollection.Insert
EventDescriptorCollection.Remove
EventDescriptorCollection.RemoveAt
[EventDescriptorCollection Properties]
EventDescriptorCollection.Count
EventDescriptorCollection.Item
EventDescriptorCollection.Item

System.ComponentModel.EventHandlerList class
EventHandlerList.EventHandlerList
[EventHandlerList Methods]
EventHandlerList.AddHandler
EventHandlerList.AddHandlers
EventHandlerList.Dispose
EventHandlerList.RemoveHandler
[EventHandlerList Properties]
EventHandlerList.Item

System.ComponentModel.IBindingList interface
[IBindingList Methods]
IBindingList.AddIndex
IBindingList.AddNew
IBindingList.ApplySort
IBindingList.Find
IBindingList.RemoveIndex
IBindingList.RemoveSort
[IBindingList Properties]
IBindingList.AllowEdit
IBindingList.AllowNew
IBindingList.AllowRemove
IBindingList.IsSorted
IBindingList.SortDirection
IBindingList.SortProperty
IBindingList.SupportsChangeNotification
IBindingList.SupportsSearching
IBindingList.SupportsSorting
[IBindingList Events]
IBindingList.ListChanged

System.ComponentModel.IBindingListView interface
[IBindingListView Methods]
IBindingListView.ApplySort
IBindingListView.RemoveFilter
[IBindingListView Properties]
IBindingListView.Filter
IBindingListView.SortDescriptions
IBindingListView.SupportsAdvancedSorting
IBindingListView.SupportsFiltering

System.ComponentModel.ICancelAddNew interface
[ICancelAddNew Methods]
ICancelAddNew.CancelNew
ICancelAddNew.EndNew

System.ComponentModel.IChangeTracking interface
[IChangeTracking Methods]
IChangeTracking.AcceptChanges
[IChangeTracking Properties]
IChangeTracking.IsChanged

System.ComponentModel.IComponent interface
[IComponent Properties]
IComponent.Site
[IComponent Events]
IComponent.Disposed

System.ComponentModel.IContainer interface
[IContainer Methods]
IContainer.Add
IContainer.Remove

System.ComponentModel.ICustomTypeDescriptor interface
[ICustomTypeDescriptor Methods]
ICustomTypeDescriptor.GetAttributes
ICustomTypeDescriptor.GetClassName
ICustomTypeDescriptor.GetComponentName
ICustomTypeDescriptor.GetConverter
ICustomTypeDescriptor.GetDefaultEvent
ICustomTypeDescriptor.GetDefaultProperty
ICustomTypeDescriptor.GetEditor
ICustomTypeDescriptor.GetEvents
ICustomTypeDescriptor.GetProperties
ICustomTypeDescriptor.GetPropertyOwner

System.ComponentModel.IDataErrorInfo interface
[IDataErrorInfo Properties]
IDataErrorInfo.Error
IDataErrorInfo.Item

System.ComponentModel.IEditableObject interface
[IEditableObject Methods]
IEditableObject.BeginEdit
IEditableObject.CancelEdit
IEditableObject.EndEdit

System.ComponentModel.IListSource interface
[IListSource Methods]
IListSource.GetList
[IListSource Properties]
IListSource.ContainsListCollection

System.ComponentModel.INotifyPropertyChanged interface
[INotifyPropertyChanged Events]
INotifyPropertyChanged.PropertyChanged

System.ComponentModel.IRaiseItemChangedEvents interface
[IRaiseItemChangedEvents Properties]
IRaiseItemChangedEvents.RaisesItemChangedEvents

System.ComponentModel.IRevertibleChangeTracking interface
[IRevertibleChangeTracking Methods]
IRevertibleChangeTracking.RejectChanges

System.ComponentModel.ISite interface
[ISite Properties]
ISite.Component
ISite.Container
ISite.DesignMode
ISite.Name

System.ComponentModel.ISupportInitialize interface
[ISupportInitialize Methods]
ISupportInitialize.BeginInit
ISupportInitialize.EndInit

System.ComponentModel.ISupportInitializeNotification interface
[ISupportInitializeNotification Properties]
ISupportInitializeNotification.IsInitialized
[ISupportInitializeNotification Events]
ISupportInitializeNotification.Initialized

System.ComponentModel.ITypedList interface
[ITypedList Methods]
ITypedList.GetItemProperties
ITypedList.GetListName

System.ComponentModel.ListChangedEventArgs class
ListChangedEventArgs.ListChangedEventArgs
[ListChangedEventArgs Properties]
ListChangedEventArgs.ListChangedType
ListChangedEventArgs.NewIndex
ListChangedEventArgs.OldIndex

System.ComponentModel.ListChangedEventHandler delegate

System.ComponentModel.ListChangedType enumeration

System.ComponentModel.ListSortDescription class
ListSortDescription.ListSortDescription
[ListSortDescription Properties]
ListSortDescription.PropertyDescriptor
ListSortDescription.SortDirection

System.ComponentModel.ListSortDescriptionCollection class
ListSortDescriptionCollection.ListSortDescriptionCollection
[ListSortDescriptionCollection Methods]
ListSortDescriptionCollection.Contains
ListSortDescriptionCollection.CopyTo
ListSortDescriptionCollection.IndexOf
[ListSortDescriptionCollection Properties]
ListSortDescriptionCollection.Count
ListSortDescriptionCollection.Item

System.ComponentModel.ListSortDirection enumeration

System.ComponentModel.MarshalByValueComponent class
MarshalByValueComponent.MarshalByValueComponent
[MarshalByValueComponent Methods]
MarshalByValueComponent.Dispose
MarshalByValueComponent.Finalize
MarshalByValueComponent.GetService
MarshalByValueComponent.ToString
[MarshalByValueComponent Properties]
MarshalByValueComponent.Container
MarshalByValueComponent.DesignMode
MarshalByValueComponent.Events
MarshalByValueComponent.Site
[MarshalByValueComponent Events]
MarshalByValueComponent.Disposed

System.ComponentModel.MemberDescriptor class
MemberDescriptor.MemberDescriptor
[MemberDescriptor Methods]
MemberDescriptor.CreateAttributeCollection
MemberDescriptor.FillAttributes
MemberDescriptor.FindMethod
MemberDescriptor.GetHashCode
[MemberDescriptor Properties]
MemberDescriptor.AttributeArray
MemberDescriptor.DisplayName
MemberDescriptor.Name
MemberDescriptor.NameHashCode

System.ComponentModel.PropertyChangedEventArgs class
PropertyChangedEventArgs.PropertyChangedEventArgs
[PropertyChangedEventArgs Properties]
PropertyChangedEventArgs.PropertyName

System.ComponentModel.PropertyChangedEventHandler delegate

System.ComponentModel.PropertyDescriptor class
PropertyDescriptor.PropertyDescriptor
[PropertyDescriptor Methods]
PropertyDescriptor.AddValueChanged
PropertyDescriptor.CanResetValue
PropertyDescriptor.GetValue
PropertyDescriptor.GetValueChangedHandler
PropertyDescriptor.OnValueChanged
PropertyDescriptor.RemoveValueChanged
PropertyDescriptor.ResetValue
PropertyDescriptor.SetValue
PropertyDescriptor.ShouldSerializeValue
[PropertyDescriptor Properties]
PropertyDescriptor.ComponentType
PropertyDescriptor.IsReadOnly
PropertyDescriptor.PropertyType
PropertyDescriptor.SupportsChangeEvents

System.ComponentModel.PropertyDescriptorCollection class
PropertyDescriptorCollection.PropertyDescriptorCollection
[PropertyDescriptorCollection Fields]
PropertyDescriptorCollection.Empty
[PropertyDescriptorCollection Methods]
PropertyDescriptorCollection.Add
PropertyDescriptorCollection.Clear
PropertyDescriptorCollection.Contains
PropertyDescriptorCollection.CopyTo
PropertyDescriptorCollection.Find
PropertyDescriptorCollection.GetEnumerator
PropertyDescriptorCollection.IndexOf
PropertyDescriptorCollection.Insert
PropertyDescriptorCollection.Remove
PropertyDescriptorCollection.RemoveAt
[PropertyDescriptorCollection Properties]
PropertyDescriptorCollection.Count
PropertyDescriptorCollection.Item
PropertyDescriptorCollection.Item

System.ComponentModel.TypeConverter class
TypeConverter.TypeConverter

System.ComponentModel.TypeDescriptor class
[TypeDescriptor Methods]
TypeDescriptor.GetEvents
TypeDescriptor.GetProperties

System.ComponentModel.Win32Exception class
Win32Exception.Win32Exception
[Win32Exception Properties]
Win32Exception.NativeErrorCode

System.Configuration.Assemblies namespace

System.Configuration.Assemblies.AssemblyHashAlgorithm enumeration

System.Configuration.Assemblies.AssemblyVersionCompatibility enumeration

System.Diagnostics namespace

System.Diagnostics.ConditionalAttribute class
ConditionalAttribute.ConditionalAttribute
[ConditionalAttribute Properties]
ConditionalAttribute.ConditionString

System.Diagnostics.Debug class
[Debug Methods]
Debug.Assert
Debug.Close
Debug.Fail
Debug.Flush
Debug.Write
Debug.WriteIf
Debug.WriteLine
Debug.WriteLineIf
[Debug Properties]
Debug.AutoFlush
Debug.IndentLevel
Debug.IndentSize
Debug.Listeners

System.Diagnostics.DebuggableAttribute class
DebuggableAttribute.DebuggableAttribute

System.Diagnostics.DebuggableAttribute.DebuggingModes enumeration

System.Diagnostics.Debugger class
Debugger.Debugger
[Debugger Methods]
Debugger.Break
Debugger.Launch
[Debugger Properties]
Debugger.IsAttached

System.Diagnostics.DebuggerHiddenAttribute class
DebuggerHiddenAttribute.DebuggerHiddenAttribute

System.Diagnostics.DebuggerNonUserCodeAttribute class
DebuggerNonUserCodeAttribute.DebuggerNonUserCodeAttribute

System.Diagnostics.DebuggerStepThroughAttribute class
DebuggerStepThroughAttribute.DebuggerStepThroughAttribute

System.Diagnostics.DefaultTraceListener class
DefaultTraceListener.DefaultTraceListener
[DefaultTraceListener Methods]
DefaultTraceListener.Fail
DefaultTraceListener.Write
DefaultTraceListener.WriteLine

System.Diagnostics.Stopwatch class
Stopwatch.Stopwatch
[Stopwatch Fields]
Stopwatch.Frequency
Stopwatch.IsHighResolution
[Stopwatch Methods]
Stopwatch.GetTimestamp
Stopwatch.Reset
Stopwatch.Start
Stopwatch.StartNew
Stopwatch.Stop
[Stopwatch Properties]
Stopwatch.Elapsed
Stopwatch.ElapsedMilliseconds
Stopwatch.ElapsedTicks
Stopwatch.IsRunning

System.Diagnostics.TextWriterTraceListener class
TextWriterTraceListener.TextWriterTraceListener
[TextWriterTraceListener Methods]
TextWriterTraceListener.Close
TextWriterTraceListener.Dispose
TextWriterTraceListener.Flush
TextWriterTraceListener.Write
TextWriterTraceListener.WriteLine
[TextWriterTraceListener Properties]
TextWriterTraceListener.Writer

System.Diagnostics.Trace class
[Trace Methods]
Trace.Assert
Trace.Close
Trace.Fail
Trace.Flush
Trace.Write
Trace.WriteIf
Trace.WriteLine
Trace.WriteLineIf
[Trace Properties]
Trace.AutoFlush
Trace.IndentLevel
Trace.IndentSize
Trace.Listeners

System.Diagnostics.TraceListener class
TraceListener.TraceListener
[TraceListener Methods]
TraceListener.Close
TraceListener.Dispose
TraceListener.Fail
TraceListener.Flush
TraceListener.Write
TraceListener.WriteIndent
TraceListener.WriteLine
[TraceListener Properties]
TraceListener.IndentLevel
TraceListener.IndentSize
TraceListener.Name
TraceListener.NeedIndent

System.Diagnostics.TraceListenerCollection class
[TraceListenerCollection Methods]
TraceListenerCollection.Add
TraceListenerCollection.Clear
TraceListenerCollection.Contains
TraceListenerCollection.CopyTo
TraceListenerCollection.GetEnumerator
TraceListenerCollection.IndexOf
TraceListenerCollection.Insert
TraceListenerCollection.Remove
TraceListenerCollection.RemoveAt
[TraceListenerCollection Properties]
TraceListenerCollection.Count
TraceListenerCollection.Item
TraceListenerCollection.Item

System.Diagnostics.CodeAnalysis namespace

System.Diagnostics.CodeAnalysis.SuppressMessageAttribute class
SuppressMessageAttribute.SuppressMessageAttribute
[SuppressMessageAttribute Properties]
SuppressMessageAttribute.Category
SuppressMessageAttribute.CheckId
SuppressMessageAttribute.Justification
SuppressMessageAttribute.MessageId
SuppressMessageAttribute.Scope
SuppressMessageAttribute.Target

System.Globalization namespace

System.Globalization.Calendar class
Calendar.Calendar
[Calendar Fields]
Calendar.CurrentEra
[Calendar Methods]
Calendar.AddDays
Calendar.AddHours
Calendar.AddMilliseconds
Calendar.AddMinutes
Calendar.AddMonths
Calendar.AddSeconds
Calendar.AddWeeks
Calendar.AddYears
Calendar.GetDayOfMonth
Calendar.GetDayOfWeek
Calendar.GetDayOfYear
Calendar.GetDaysInMonth
Calendar.GetDaysInYear
Calendar.GetEra
Calendar.GetHour
Calendar.GetMilliseconds
Calendar.GetMinute
Calendar.GetMonth
Calendar.GetMonthsInYear
Calendar.GetSecond
Calendar.GetWeekOfYear
Calendar.GetYear
Calendar.IsLeapDay
Calendar.IsLeapMonth
Calendar.IsLeapYear
Calendar.ToDateTime
Calendar.ToFourDigitYear
[Calendar Properties]
Calendar.Eras
Calendar.IsReadOnly
Calendar.MaxSupportedDateTime
Calendar.MinSupportedDateTime
Calendar.TwoDigitYearMax

System.Globalization.CalendarWeekRule enumeration

System.Globalization.CharUnicodeInfo class
[CharUnicodeInfo Methods]
CharUnicodeInfo.GetNumericValue
CharUnicodeInfo.GetUnicodeCategory

System.Globalization.CompareInfo class
[CompareInfo Methods]
CompareInfo.Compare
CompareInfo.Equals
CompareInfo.GetCompareInfo
CompareInfo.GetHashCode
CompareInfo.IndexOf
CompareInfo.IsPrefix
CompareInfo.IsSuffix
CompareInfo.LastIndexOf
CompareInfo.ToString
[CompareInfo Properties]
CompareInfo.LCID
CompareInfo.Name

System.Globalization.CompareOptions enumeration

System.Globalization.CultureInfo class
CultureInfo.CultureInfo
[CultureInfo Methods]
CultureInfo.ClearCachedData
CultureInfo.Clone
CultureInfo.CreateSpecificCulture
CultureInfo.Equals
CultureInfo.GetCultureInfo
CultureInfo.GetFormat
CultureInfo.GetHashCode
CultureInfo.ReadOnly
CultureInfo.ToString
[CultureInfo Properties]
CultureInfo.Calendar
CultureInfo.CompareInfo
CultureInfo.CurrentCulture
CultureInfo.CurrentUICulture
CultureInfo.DateTimeFormat
CultureInfo.EnglishName
CultureInfo.InvariantCulture
CultureInfo.IsNeutralCulture
CultureInfo.IsReadOnly
CultureInfo.LCID
CultureInfo.Name
CultureInfo.NativeName
CultureInfo.NumberFormat
CultureInfo.OptionalCalendars
CultureInfo.Parent
CultureInfo.TextInfo
CultureInfo.ThreeLetterISOLanguageName
CultureInfo.ThreeLetterWindowsLanguageName
CultureInfo.TwoLetterISOLanguageName
CultureInfo.UseUserOverride

System.Globalization.CultureTypes enumeration

System.Globalization.DateTimeFormatInfo class
DateTimeFormatInfo.DateTimeFormatInfo
[DateTimeFormatInfo Methods]
DateTimeFormatInfo.Clone
DateTimeFormatInfo.GetAbbreviatedDayName
DateTimeFormatInfo.GetAbbreviatedEraName
DateTimeFormatInfo.GetAbbreviatedMonthName
DateTimeFormatInfo.GetAllDateTimePatterns
DateTimeFormatInfo.GetDayName
DateTimeFormatInfo.GetEra
DateTimeFormatInfo.GetEraName
DateTimeFormatInfo.GetFormat
DateTimeFormatInfo.GetInstance
DateTimeFormatInfo.GetMonthName
DateTimeFormatInfo.ReadOnly
[DateTimeFormatInfo Properties]
DateTimeFormatInfo.AbbreviatedDayNames
DateTimeFormatInfo.AbbreviatedMonthGenitiveNames
DateTimeFormatInfo.AbbreviatedMonthNames
DateTimeFormatInfo.AMDesignator
DateTimeFormatInfo.Calendar
DateTimeFormatInfo.CalendarWeekRule
DateTimeFormatInfo.CurrentInfo
DateTimeFormatInfo.DateSeparator
DateTimeFormatInfo.DayNames
DateTimeFormatInfo.FirstDayOfWeek
DateTimeFormatInfo.FullDateTimePattern
DateTimeFormatInfo.InvariantInfo
DateTimeFormatInfo.IsReadOnly
DateTimeFormatInfo.LongDatePattern
DateTimeFormatInfo.LongTimePattern
DateTimeFormatInfo.MonthDayPattern
DateTimeFormatInfo.MonthGenitiveNames
DateTimeFormatInfo.MonthNames
DateTimeFormatInfo.PMDesignator
DateTimeFormatInfo.RFC1123Pattern
DateTimeFormatInfo.ShortDatePattern
DateTimeFormatInfo.ShortestDayNames
DateTimeFormatInfo.ShortTimePattern
DateTimeFormatInfo.SortableDateTimePattern
DateTimeFormatInfo.TimeSeparator
DateTimeFormatInfo.UniversalSortableDateTimePattern
DateTimeFormatInfo.YearMonthPattern

System.Globalization.DateTimeStyles enumeration

System.Globalization.DaylightTime class
DaylightTime.DaylightTime
[DaylightTime Properties]
DaylightTime.Delta
DaylightTime.End
DaylightTime.Start

System.Globalization.GregorianCalendar class
GregorianCalendar.GregorianCalendar
[GregorianCalendar Fields]
GregorianCalendar.ADEra
[GregorianCalendar Methods]
GregorianCalendar.AddMonths
GregorianCalendar.AddYears
GregorianCalendar.GetDayOfMonth
GregorianCalendar.GetDayOfWeek
GregorianCalendar.GetDayOfYear
GregorianCalendar.GetDaysInMonth
GregorianCalendar.GetDaysInYear
GregorianCalendar.GetEra
GregorianCalendar.GetMonth
GregorianCalendar.GetMonthsInYear
GregorianCalendar.GetWeekOfYear
GregorianCalendar.GetYear
GregorianCalendar.IsLeapDay
GregorianCalendar.IsLeapMonth
GregorianCalendar.IsLeapYear
GregorianCalendar.ToDateTime
GregorianCalendar.ToFourDigitYear
[GregorianCalendar Properties]
GregorianCalendar.CalendarType
GregorianCalendar.Eras
GregorianCalendar.MaxSupportedDateTime
GregorianCalendar.MinSupportedDateTime
GregorianCalendar.TwoDigitYearMax

System.Globalization.GregorianCalendarTypes enumeration

System.Globalization.JapaneseCalendar class
JapaneseCalendar.JapaneseCalendar
[JapaneseCalendar Methods]
JapaneseCalendar.AddMonths
JapaneseCalendar.AddYears
JapaneseCalendar.GetDayOfMonth
JapaneseCalendar.GetDayOfWeek
JapaneseCalendar.GetDayOfYear
JapaneseCalendar.GetDaysInMonth
JapaneseCalendar.GetDaysInYear
JapaneseCalendar.GetEra
JapaneseCalendar.GetMonth
JapaneseCalendar.GetMonthsInYear
JapaneseCalendar.GetWeekOfYear
JapaneseCalendar.GetYear
JapaneseCalendar.IsLeapDay
JapaneseCalendar.IsLeapMonth
JapaneseCalendar.IsLeapYear
JapaneseCalendar.ToDateTime
JapaneseCalendar.ToFourDigitYear
[JapaneseCalendar Properties]
JapaneseCalendar.Eras
JapaneseCalendar.MaxSupportedDateTime
JapaneseCalendar.MinSupportedDateTime
JapaneseCalendar.TwoDigitYearMax

System.Globalization.KoreanCalendar class
KoreanCalendar.KoreanCalendar
[KoreanCalendar Fields]
KoreanCalendar.KoreanEra
[KoreanCalendar Methods]
KoreanCalendar.AddMonths
KoreanCalendar.AddYears
KoreanCalendar.GetDayOfMonth
KoreanCalendar.GetDayOfWeek
KoreanCalendar.GetDayOfYear
KoreanCalendar.GetDaysInMonth
KoreanCalendar.GetDaysInYear
KoreanCalendar.GetEra
KoreanCalendar.GetMonth
KoreanCalendar.GetMonthsInYear
KoreanCalendar.GetWeekOfYear
KoreanCalendar.GetYear
KoreanCalendar.IsLeapDay
KoreanCalendar.IsLeapMonth
KoreanCalendar.IsLeapYear
KoreanCalendar.ToDateTime
KoreanCalendar.ToFourDigitYear
[KoreanCalendar Properties]
KoreanCalendar.Eras
KoreanCalendar.MaxSupportedDateTime
KoreanCalendar.MinSupportedDateTime
KoreanCalendar.TwoDigitYearMax

System.Globalization.NumberFormatInfo class
NumberFormatInfo.NumberFormatInfo
[NumberFormatInfo Methods]
NumberFormatInfo.Clone
NumberFormatInfo.GetFormat
NumberFormatInfo.GetInstance
NumberFormatInfo.ReadOnly
[NumberFormatInfo Properties]
NumberFormatInfo.CurrencyDecimalDigits
NumberFormatInfo.CurrencyDecimalSeparator
NumberFormatInfo.CurrencyGroupSeparator
NumberFormatInfo.CurrencyGroupSizes
NumberFormatInfo.CurrencyNegativePattern
NumberFormatInfo.CurrencyPositivePattern
NumberFormatInfo.CurrencySymbol
NumberFormatInfo.CurrentInfo
NumberFormatInfo.InvariantInfo
NumberFormatInfo.IsReadOnly
NumberFormatInfo.NaNSymbol
NumberFormatInfo.NegativeInfinitySymbol
NumberFormatInfo.NegativeSign
NumberFormatInfo.NumberDecimalDigits
NumberFormatInfo.NumberDecimalSeparator
NumberFormatInfo.NumberGroupSeparator
NumberFormatInfo.NumberGroupSizes
NumberFormatInfo.NumberNegativePattern
NumberFormatInfo.PercentDecimalDigits
NumberFormatInfo.PercentDecimalSeparator
NumberFormatInfo.PercentGroupSeparator
NumberFormatInfo.PercentGroupSizes
NumberFormatInfo.PercentNegativePattern
NumberFormatInfo.PercentPositivePattern
NumberFormatInfo.PercentSymbol
NumberFormatInfo.PerMilleSymbol
NumberFormatInfo.PositiveInfinitySymbol
NumberFormatInfo.PositiveSign

System.Globalization.NumberStyles enumeration

System.Globalization.RegionInfo class
RegionInfo.RegionInfo
[RegionInfo Methods]
RegionInfo.Equals
RegionInfo.GetHashCode
RegionInfo.ToString
[RegionInfo Properties]
RegionInfo.CurrencySymbol
RegionInfo.CurrentRegion
RegionInfo.EnglishName
RegionInfo.IsMetric
RegionInfo.ISOCurrencySymbol
RegionInfo.Name
RegionInfo.ThreeLetterISORegionName
RegionInfo.ThreeLetterWindowsRegionName
RegionInfo.TwoLetterISORegionName

System.Globalization.StringInfo class
StringInfo.StringInfo
[StringInfo Methods]
StringInfo.Equals
StringInfo.GetHashCode
StringInfo.GetNextTextElement
StringInfo.GetTextElementEnumerator
StringInfo.ParseCombiningCharacters
[StringInfo Properties]
StringInfo.LengthInTextElements
StringInfo.String

System.Globalization.TaiwanCalendar class
TaiwanCalendar.TaiwanCalendar
[TaiwanCalendar Methods]
TaiwanCalendar.AddMonths
TaiwanCalendar.AddYears
TaiwanCalendar.GetDayOfMonth
TaiwanCalendar.GetDayOfWeek
TaiwanCalendar.GetDayOfYear
TaiwanCalendar.GetDaysInMonth
TaiwanCalendar.GetDaysInYear
TaiwanCalendar.GetEra
TaiwanCalendar.GetMonth
TaiwanCalendar.GetMonthsInYear
TaiwanCalendar.GetWeekOfYear
TaiwanCalendar.GetYear
TaiwanCalendar.IsLeapDay
TaiwanCalendar.IsLeapMonth
TaiwanCalendar.IsLeapYear
TaiwanCalendar.ToDateTime
TaiwanCalendar.ToFourDigitYear
[TaiwanCalendar Properties]
TaiwanCalendar.Eras
TaiwanCalendar.MaxSupportedDateTime
TaiwanCalendar.MinSupportedDateTime
TaiwanCalendar.TwoDigitYearMax

System.Globalization.TextElementEnumerator class
[TextElementEnumerator Methods]
TextElementEnumerator.GetTextElement
TextElementEnumerator.MoveNext
TextElementEnumerator.Reset
[TextElementEnumerator Properties]
TextElementEnumerator.Current
TextElementEnumerator.ElementIndex

System.Globalization.TextInfo class
[TextInfo Methods]
TextInfo.Equals
TextInfo.GetHashCode
TextInfo.ToLower
TextInfo.ToString
TextInfo.ToTitleCase
TextInfo.ToUpper
[TextInfo Properties]
TextInfo.ANSICodePage
TextInfo.CultureName
TextInfo.IsReadOnly
TextInfo.ListSeparator

System.Globalization.ThaiBuddhistCalendar class
ThaiBuddhistCalendar.ThaiBuddhistCalendar
[ThaiBuddhistCalendar Fields]
ThaiBuddhistCalendar.ThaiBuddhistEra
[ThaiBuddhistCalendar Methods]
ThaiBuddhistCalendar.AddMonths
ThaiBuddhistCalendar.AddYears
ThaiBuddhistCalendar.GetDayOfMonth
ThaiBuddhistCalendar.GetDayOfWeek
ThaiBuddhistCalendar.GetDayOfYear
ThaiBuddhistCalendar.GetDaysInMonth
ThaiBuddhistCalendar.GetDaysInYear
ThaiBuddhistCalendar.GetEra
ThaiBuddhistCalendar.GetMonth
ThaiBuddhistCalendar.GetMonthsInYear
ThaiBuddhistCalendar.GetWeekOfYear
ThaiBuddhistCalendar.GetYear
ThaiBuddhistCalendar.IsLeapDay
ThaiBuddhistCalendar.IsLeapMonth
ThaiBuddhistCalendar.IsLeapYear
ThaiBuddhistCalendar.ToDateTime
ThaiBuddhistCalendar.ToFourDigitYear
[ThaiBuddhistCalendar Properties]
ThaiBuddhistCalendar.Eras
ThaiBuddhistCalendar.MaxSupportedDateTime
ThaiBuddhistCalendar.MinSupportedDateTime
ThaiBuddhistCalendar.TwoDigitYearMax

System.Globalization.UnicodeCategory enumeration

System.IO namespace

System.IO.BinaryReader class
BinaryReader.BinaryReader
[BinaryReader Methods]
BinaryReader.Close
BinaryReader.Dispose
BinaryReader.FillBuffer
BinaryReader.PeekChar
BinaryReader.Read
BinaryReader.Read7BitEncodedInt
BinaryReader.ReadBoolean
BinaryReader.ReadByte
BinaryReader.ReadBytes
BinaryReader.ReadChar
BinaryReader.ReadChars
BinaryReader.ReadDouble
BinaryReader.ReadInt16
BinaryReader.ReadInt32
BinaryReader.ReadInt64
BinaryReader.ReadSByte
BinaryReader.ReadSingle
BinaryReader.ReadString
BinaryReader.ReadUInt16
BinaryReader.ReadUInt32
BinaryReader.ReadUInt64
[BinaryReader Properties]
BinaryReader.BaseStream

System.IO.BinaryWriter class
BinaryWriter.BinaryWriter
[BinaryWriter Fields]
BinaryWriter.Null
BinaryWriter.OutStream
[BinaryWriter Methods]
BinaryWriter.Close
BinaryWriter.Dispose
BinaryWriter.Flush
BinaryWriter.Seek
BinaryWriter.Write
BinaryWriter.Write7BitEncodedInt
[BinaryWriter Properties]
BinaryWriter.BaseStream

System.IO.Directory class
[Directory Methods]
Directory.CreateDirectory
Directory.Delete
Directory.Exists
Directory.GetCreationTime
Directory.GetCurrentDirectory
Directory.GetDirectories
Directory.GetDirectoryRoot
Directory.GetFiles
Directory.GetFileSystemEntries
Directory.GetLastAccessTime
Directory.GetLastWriteTime
Directory.Move
Directory.SetCurrentDirectory

System.IO.DirectoryInfo class
DirectoryInfo.DirectoryInfo
[DirectoryInfo Methods]
DirectoryInfo.Create
DirectoryInfo.CreateSubdirectory
DirectoryInfo.Delete
DirectoryInfo.GetDirectories
DirectoryInfo.GetFiles
DirectoryInfo.GetFileSystemInfos
DirectoryInfo.MoveTo
DirectoryInfo.ToString
[DirectoryInfo Properties]
DirectoryInfo.Exists
DirectoryInfo.Name
DirectoryInfo.Parent
DirectoryInfo.Root

System.IO.DirectoryNotFoundException class
DirectoryNotFoundException.DirectoryNotFoundException

System.IO.EndOfStreamException class
EndOfStreamException.EndOfStreamException

System.IO.File class
[File Methods]
File.AppendText
File.Copy
File.Create
File.CreateText
File.Delete
File.Exists
File.GetCreationTime
File.GetLastAccessTime
File.GetLastWriteTime
File.Move
File.Open
File.OpenRead
File.OpenText
File.OpenWrite

System.IO.FileAccess enumeration

System.IO.FileAttributes enumeration

System.IO.FileInfo class
FileInfo.FileInfo
[FileInfo Methods]
FileInfo.AppendText
FileInfo.CopyTo
FileInfo.Create
FileInfo.CreateText
FileInfo.Delete
FileInfo.MoveTo
FileInfo.Open
FileInfo.OpenRead
FileInfo.OpenText
FileInfo.OpenWrite
FileInfo.ToString
[FileInfo Properties]
FileInfo.Directory
FileInfo.DirectoryName
FileInfo.Exists
FileInfo.Length
FileInfo.Name

System.IO.FileMode enumeration

System.IO.FileNotFoundException class
FileNotFoundException.FileNotFoundException

System.IO.FileShare enumeration

System.IO.FileStream class
FileStream.FileStream
[FileStream Methods]
FileStream.Dispose
FileStream.Finalize
FileStream.Flush
FileStream.Read
FileStream.ReadByte
FileStream.Seek
FileStream.SetLength
FileStream.Write
FileStream.WriteByte
[FileStream Properties]
FileStream.CanRead
FileStream.CanSeek
FileStream.CanWrite
FileStream.IsAsync
FileStream.Length
FileStream.Name
FileStream.Position

System.IO.FileSystemInfo class
FileSystemInfo.FileSystemInfo
[FileSystemInfo Fields]
FileSystemInfo.FullPath
FileSystemInfo.OriginalPath
[FileSystemInfo Methods]
FileSystemInfo.Delete
FileSystemInfo.Refresh
[FileSystemInfo Properties]
FileSystemInfo.Attributes
FileSystemInfo.CreationTime
FileSystemInfo.Exists
FileSystemInfo.Extension
FileSystemInfo.FullName
FileSystemInfo.LastAccessTime
FileSystemInfo.LastWriteTime
FileSystemInfo.Name

System.IO.IOException class
IOException.IOException

System.IO.MemoryStream class
MemoryStream.MemoryStream
[MemoryStream Methods]
MemoryStream.Dispose
MemoryStream.Flush
MemoryStream.GetBuffer
MemoryStream.Read
MemoryStream.ReadByte
MemoryStream.Seek
MemoryStream.SetLength
MemoryStream.ToArray
MemoryStream.Write
MemoryStream.WriteByte
MemoryStream.WriteTo
[MemoryStream Properties]
MemoryStream.CanRead
MemoryStream.CanSeek
MemoryStream.CanWrite
MemoryStream.Capacity
MemoryStream.Length
MemoryStream.Position

System.IO.Path class
[Path Fields]
Path.AltDirectorySeparatorChar
Path.DirectorySeparatorChar
Path.InvalidPathChars
Path.PathSeparator
Path.VolumeSeparatorChar
[Path Methods]
Path.ChangeExtension
Path.Combine
Path.GetDirectoryName
Path.GetExtension
Path.GetFileName
Path.GetFileNameWithoutExtension
Path.GetFullPath
Path.GetInvalidPathChars
Path.GetPathRoot
Path.HasExtension
Path.IsPathRooted

System.IO.PathTooLongException class
PathTooLongException.PathTooLongException

System.IO.SeekOrigin enumeration

System.IO.Stream class
Stream.Stream
[Stream Fields]
Stream.Null
[Stream Methods]
Stream.BeginRead
Stream.BeginWrite
Stream.Close
Stream.CreateWaitHandle
Stream.Dispose
Stream.EndRead
Stream.EndWrite
Stream.Flush
Stream.Read
Stream.ReadByte
Stream.Seek
Stream.SetLength
Stream.Write
Stream.WriteByte
[Stream Properties]
Stream.CanRead
Stream.CanSeek
Stream.CanTimeout
Stream.CanWrite
Stream.Length
Stream.Position
Stream.ReadTimeout
Stream.WriteTimeout

System.IO.StreamReader class
StreamReader.StreamReader
[StreamReader Fields]
StreamReader.Null
[StreamReader Methods]
StreamReader.Close
StreamReader.DiscardBufferedData
StreamReader.Dispose
StreamReader.Peek
StreamReader.Read
StreamReader.ReadLine
StreamReader.ReadToEnd
[StreamReader Properties]
StreamReader.BaseStream
StreamReader.CurrentEncoding
StreamReader.EndOfStream

System.IO.StreamWriter class
StreamWriter.StreamWriter
[StreamWriter Fields]
StreamWriter.Null
[StreamWriter Methods]
StreamWriter.Close
StreamWriter.Dispose
StreamWriter.Flush
StreamWriter.Write
[StreamWriter Properties]
StreamWriter.AutoFlush
StreamWriter.BaseStream
StreamWriter.Encoding

System.IO.StringReader class
StringReader.StringReader
[StringReader Methods]
StringReader.Close
StringReader.Dispose
StringReader.Peek
StringReader.Read
StringReader.ReadLine
StringReader.ReadToEnd

System.IO.StringWriter class
StringWriter.StringWriter
[StringWriter Methods]
StringWriter.Close
StringWriter.Dispose
StringWriter.GetStringBuilder
StringWriter.ToString
StringWriter.Write
[StringWriter Properties]
StringWriter.Encoding

System.IO.TextReader class
TextReader.TextReader
[TextReader Fields]
TextReader.Null
[TextReader Methods]
TextReader.Close
TextReader.Dispose
TextReader.Peek
TextReader.Read
TextReader.ReadBlock
TextReader.ReadLine
TextReader.ReadToEnd
TextReader.Synchronized

System.IO.TextWriter class
TextWriter.TextWriter
[TextWriter Fields]
TextWriter.CoreNewLine
TextWriter.Null
[TextWriter Methods]
TextWriter.Close
TextWriter.Dispose
TextWriter.Flush
TextWriter.Synchronized
TextWriter.Write
TextWriter.WriteLine
[TextWriter Properties]
TextWriter.Encoding
TextWriter.FormatProvider
TextWriter.NewLine

System.Net namespace

System.Net.ICredentials interface
[ICredentials Methods]
ICredentials.GetCredential

System.Net.NetworkCredential class
NetworkCredential.NetworkCredential
[NetworkCredential Methods]
NetworkCredential.GetCredential
[NetworkCredential Properties]
NetworkCredential.Domain
NetworkCredential.Password
NetworkCredential.UserName

System.Reflection namespace

System.Reflection.AmbiguousMatchException class
AmbiguousMatchException.AmbiguousMatchException

System.Reflection.Assembly class
[Assembly Methods]
Assembly.CreateInstance
Assembly.GetCallingAssembly
Assembly.GetCustomAttributes
Assembly.GetExecutingAssembly
Assembly.GetManifestResourceNames
Assembly.GetManifestResourceStream
Assembly.GetModules
Assembly.GetName
Assembly.GetSatelliteAssembly
Assembly.GetType
Assembly.GetTypes
Assembly.IsDefined
Assembly.Load
Assembly.LoadFrom
Assembly.ToString
[Assembly Properties]
Assembly.FullName
Assembly.ManifestModule

System.Reflection.AssemblyAlgorithmIdAttribute class
AssemblyAlgorithmIdAttribute.AssemblyAlgorithmIdAttribute
[AssemblyAlgorithmIdAttribute Properties]
AssemblyAlgorithmIdAttribute.AlgorithmId

System.Reflection.AssemblyCompanyAttribute class
AssemblyCompanyAttribute.AssemblyCompanyAttribute
[AssemblyCompanyAttribute Properties]
AssemblyCompanyAttribute.Company

System.Reflection.AssemblyConfigurationAttribute class
AssemblyConfigurationAttribute.AssemblyConfigurationAttribute
[AssemblyConfigurationAttribute Properties]
AssemblyConfigurationAttribute.Configuration

System.Reflection.AssemblyCopyrightAttribute class
AssemblyCopyrightAttribute.AssemblyCopyrightAttribute
[AssemblyCopyrightAttribute Properties]
AssemblyCopyrightAttribute.Copyright

System.Reflection.AssemblyCultureAttribute class
AssemblyCultureAttribute.AssemblyCultureAttribute
[AssemblyCultureAttribute Properties]
AssemblyCultureAttribute.Culture

System.Reflection.AssemblyDefaultAliasAttribute class
AssemblyDefaultAliasAttribute.AssemblyDefaultAliasAttribute
[AssemblyDefaultAliasAttribute Properties]
AssemblyDefaultAliasAttribute.DefaultAlias

System.Reflection.AssemblyDelaySignAttribute class
AssemblyDelaySignAttribute.AssemblyDelaySignAttribute
[AssemblyDelaySignAttribute Properties]
AssemblyDelaySignAttribute.DelaySign

System.Reflection.AssemblyDescriptionAttribute class
AssemblyDescriptionAttribute.AssemblyDescriptionAttribute
[AssemblyDescriptionAttribute Properties]
AssemblyDescriptionAttribute.Description

System.Reflection.AssemblyFlagsAttribute class
AssemblyFlagsAttribute.AssemblyFlagsAttribute
[AssemblyFlagsAttribute Properties]
AssemblyFlagsAttribute.AssemblyFlags
AssemblyFlagsAttribute.Flags

System.Reflection.AssemblyInformationalVersionAttribute class
AssemblyInformationalVersionAttribute.AssemblyInformationalVersionAttribute
[AssemblyInformationalVersionAttribute Properties]
AssemblyInformationalVersionAttribute.InformationalVersion

System.Reflection.AssemblyKeyFileAttribute class
AssemblyKeyFileAttribute.AssemblyKeyFileAttribute
[AssemblyKeyFileAttribute Properties]
AssemblyKeyFileAttribute.KeyFile

System.Reflection.AssemblyKeyNameAttribute class
AssemblyKeyNameAttribute.AssemblyKeyNameAttribute
[AssemblyKeyNameAttribute Properties]
AssemblyKeyNameAttribute.KeyName

System.Reflection.AssemblyName class
AssemblyName.AssemblyName
[AssemblyName Methods]
AssemblyName.Clone
AssemblyName.GetPublicKey
AssemblyName.GetPublicKeyToken
AssemblyName.SetPublicKey
AssemblyName.SetPublicKeyToken
AssemblyName.ToString
[AssemblyName Properties]
AssemblyName.CodeBase
AssemblyName.CultureInfo
AssemblyName.Flags
AssemblyName.FullName
AssemblyName.HashAlgorithm
AssemblyName.Name
AssemblyName.Version
AssemblyName.VersionCompatibility

System.Reflection.AssemblyNameFlags enumeration

System.Reflection.AssemblyProductAttribute class
AssemblyProductAttribute.AssemblyProductAttribute
[AssemblyProductAttribute Properties]
AssemblyProductAttribute.Product

System.Reflection.AssemblyTitleAttribute class
AssemblyTitleAttribute.AssemblyTitleAttribute
[AssemblyTitleAttribute Properties]
AssemblyTitleAttribute.Title

System.Reflection.AssemblyTrademarkAttribute class
AssemblyTrademarkAttribute.AssemblyTrademarkAttribute
[AssemblyTrademarkAttribute Properties]
AssemblyTrademarkAttribute.Trademark

System.Reflection.AssemblyVersionAttribute class
AssemblyVersionAttribute.AssemblyVersionAttribute
[AssemblyVersionAttribute Properties]
AssemblyVersionAttribute.Version

System.Reflection.Binder class
Binder.Binder
[Binder Methods]
Binder.BindToField
Binder.BindToMethod
Binder.ChangeType
Binder.ReorderArgumentArray
Binder.SelectMethod
Binder.SelectProperty

System.Reflection.BindingFlags enumeration

System.Reflection.CallingConventions enumeration

System.Reflection.ConstructorInfo class
ConstructorInfo.ConstructorInfo
[ConstructorInfo Fields]
ConstructorInfo.ConstructorName
ConstructorInfo.TypeConstructorName
[ConstructorInfo Methods]
ConstructorInfo.Invoke
[ConstructorInfo Properties]
ConstructorInfo.MemberType

System.Reflection.CustomAttributeFormatException class
CustomAttributeFormatException.CustomAttributeFormatException

System.Reflection.DefaultMemberAttribute class
DefaultMemberAttribute.DefaultMemberAttribute
[DefaultMemberAttribute Properties]
DefaultMemberAttribute.MemberName

System.Reflection.EventAttributes enumeration

System.Reflection.EventInfo class
EventInfo.EventInfo
[EventInfo Methods]
EventInfo.AddEventHandler
EventInfo.GetAddMethod
EventInfo.GetRaiseMethod
EventInfo.GetRemoveMethod
EventInfo.RemoveEventHandler
[EventInfo Properties]
EventInfo.Attributes
EventInfo.EventHandlerType
EventInfo.IsMulticast
EventInfo.IsSpecialName
EventInfo.MemberType

System.Reflection.FieldAttributes enumeration

System.Reflection.FieldInfo class
FieldInfo.FieldInfo
[FieldInfo Methods]
FieldInfo.GetFieldFromHandle
FieldInfo.GetValue
FieldInfo.SetValue
[FieldInfo Properties]
FieldInfo.Attributes
FieldInfo.FieldHandle
FieldInfo.FieldType
FieldInfo.IsAssembly
FieldInfo.IsFamily
FieldInfo.IsFamilyAndAssembly
FieldInfo.IsFamilyOrAssembly
FieldInfo.IsInitOnly
FieldInfo.IsLiteral
FieldInfo.IsNotSerialized
FieldInfo.IsPinvokeImpl
FieldInfo.IsPrivate
FieldInfo.IsPublic
FieldInfo.IsSpecialName
FieldInfo.IsStatic
FieldInfo.MemberType

System.Reflection.ICustomAttributeProvider interface
[ICustomAttributeProvider Methods]
ICustomAttributeProvider.GetCustomAttributes
ICustomAttributeProvider.IsDefined

System.Reflection.MemberInfo class
MemberInfo.MemberInfo
[MemberInfo Methods]
MemberInfo.GetCustomAttributes
MemberInfo.IsDefined
[MemberInfo Properties]
MemberInfo.DeclaringType
MemberInfo.MemberType
MemberInfo.Name
MemberInfo.ReflectedType

System.Reflection.MemberTypes enumeration

System.Reflection.MethodAttributes enumeration

System.Reflection.MethodBase class
MethodBase.MethodBase
[MethodBase Methods]
MethodBase.GetGenericArguments
MethodBase.GetMethodFromHandle
MethodBase.GetParameters
MethodBase.Invoke
[MethodBase Properties]
MethodBase.Attributes
MethodBase.CallingConvention
MethodBase.ContainsGenericParameters
MethodBase.IsAbstract
MethodBase.IsAssembly
MethodBase.IsConstructor
MethodBase.IsFamily
MethodBase.IsFamilyAndAssembly
MethodBase.IsFamilyOrAssembly
MethodBase.IsFinal
MethodBase.IsGenericMethod
MethodBase.IsGenericMethodDefinition
MethodBase.IsHideBySig
MethodBase.IsPrivate
MethodBase.IsPublic
MethodBase.IsSpecialName
MethodBase.IsStatic
MethodBase.IsVirtual
MethodBase.MethodHandle

System.Reflection.MethodImplAttributes enumeration

System.Reflection.MethodInfo class
MethodInfo.MethodInfo
[MethodInfo Methods]
MethodInfo.GetBaseDefinition
MethodInfo.GetGenericArguments
MethodInfo.GetGenericMethodDefinition
MethodInfo.MakeGenericMethod
[MethodInfo Properties]
MethodInfo.ContainsGenericParameters
MethodInfo.IsGenericMethod
MethodInfo.IsGenericMethodDefinition
MethodInfo.MemberType
MethodInfo.ReturnType
MethodInfo.ReturnTypeCustomAttributes

System.Reflection.Missing class
[Missing Fields]
Missing.Value

System.Reflection.Module class
[Module Methods]
Module.GetCustomAttributes
Module.GetType
Module.GetTypes
Module.IsDefined
Module.ToString
[Module Properties]
Module.Assembly
Module.FullyQualifiedName
Module.Name

System.Reflection.ParameterAttributes enumeration

System.Reflection.ParameterInfo class
ParameterInfo.ParameterInfo
[ParameterInfo Fields]
ParameterInfo.AttrsImpl
ParameterInfo.ClassImpl
ParameterInfo.DefaultValueImpl
ParameterInfo.MemberImpl
ParameterInfo.NameImpl
ParameterInfo.PositionImpl
[ParameterInfo Methods]
ParameterInfo.Equals
ParameterInfo.GetCustomAttributes
ParameterInfo.GetHashCode
ParameterInfo.IsDefined
[ParameterInfo Properties]
ParameterInfo.Attributes
ParameterInfo.DefaultValue
ParameterInfo.Member
ParameterInfo.Name
ParameterInfo.ParameterType
ParameterInfo.Position

System.Reflection.ParameterModifier structure
ParameterModifier.ParameterModifier
[ParameterModifier Properties]
ParameterModifier.Item

System.Reflection.PropertyAttributes enumeration

System.Reflection.PropertyInfo class
PropertyInfo.PropertyInfo
[PropertyInfo Methods]
PropertyInfo.GetAccessors
PropertyInfo.GetGetMethod
PropertyInfo.GetIndexParameters
PropertyInfo.GetSetMethod
PropertyInfo.GetValue
PropertyInfo.SetValue
[PropertyInfo Properties]
PropertyInfo.Attributes
PropertyInfo.CanRead
PropertyInfo.CanWrite
PropertyInfo.IsSpecialName
PropertyInfo.MemberType
PropertyInfo.PropertyType

System.Reflection.TargetInvocationException class
TargetInvocationException.TargetInvocationException

System.Reflection.TargetParameterCountException class
TargetParameterCountException.TargetParameterCountException

System.Reflection.TypeAttributes enumeration

System.Resources namespace

System.Resources.IResourceReader interface
[IResourceReader Methods]
IResourceReader.Close
IResourceReader.GetEnumerator

System.Resources.MissingManifestResourceException class
MissingManifestResourceException.MissingManifestResourceException

System.Resources.NeutralResourcesLanguageAttribute class
NeutralResourcesLanguageAttribute.NeutralResourcesLanguageAttribute
[NeutralResourcesLanguageAttribute Properties]
NeutralResourcesLanguageAttribute.CultureName

System.Resources.ResourceManager class
ResourceManager.ResourceManager
[ResourceManager Fields]
ResourceManager.BaseNameField
ResourceManager.HeaderVersionNumber
ResourceManager.MagicNumber
ResourceManager.MainAssembly
ResourceManager.ResourceSets
[ResourceManager Methods]
ResourceManager.CreateFileBasedResourceManager
ResourceManager.GetNeutralResourcesLanguage
ResourceManager.GetObject
ResourceManager.GetResourceFileName
ResourceManager.GetResourceSet
ResourceManager.GetSatelliteContractVersion
ResourceManager.GetString
ResourceManager.InternalGetResourceSet
ResourceManager.ReleaseAllResources
[ResourceManager Properties]
ResourceManager.BaseName
ResourceManager.IgnoreCase
ResourceManager.ResourceSetType

System.Resources.ResourceReader class
ResourceReader.ResourceReader
[ResourceReader Methods]
ResourceReader.Close
ResourceReader.GetEnumerator

System.Resources.ResourceSet class
ResourceSet.ResourceSet
[ResourceSet Fields]
ResourceSet.Reader
ResourceSet.Table
[ResourceSet Methods]
ResourceSet.Close
ResourceSet.Dispose
ResourceSet.GetDefaultReader
ResourceSet.GetEnumerator
ResourceSet.GetObject
ResourceSet.GetString
ResourceSet.ReadResources

System.Resources.SatelliteContractVersionAttribute class
SatelliteContractVersionAttribute.SatelliteContractVersionAttribute
[SatelliteContractVersionAttribute Properties]
SatelliteContractVersionAttribute.Version

System.Runtime.CompilerServices namespace

System.Runtime.CompilerServices.AccessedThroughPropertyAttribute class
AccessedThroughPropertyAttribute.AccessedThroughPropertyAttribute
[AccessedThroughPropertyAttribute Properties]
AccessedThroughPropertyAttribute.PropertyName

System.Runtime.CompilerServices.CompilerGeneratedAttribute class
CompilerGeneratedAttribute.CompilerGeneratedAttribute

System.Runtime.CompilerServices.CustomConstantAttribute class
CustomConstantAttribute.CustomConstantAttribute
[CustomConstantAttribute Properties]
CustomConstantAttribute.Value

System.Runtime.CompilerServices.DateTimeConstantAttribute class
DateTimeConstantAttribute.DateTimeConstantAttribute
[DateTimeConstantAttribute Properties]
DateTimeConstantAttribute.Value

System.Runtime.CompilerServices.DecimalConstantAttribute class
DecimalConstantAttribute.DecimalConstantAttribute
[DecimalConstantAttribute Properties]
DecimalConstantAttribute.Value

System.Runtime.CompilerServices.FixedBufferAttribute class
FixedBufferAttribute.FixedBufferAttribute
[FixedBufferAttribute Properties]
FixedBufferAttribute.ElementType
FixedBufferAttribute.Length

System.Runtime.CompilerServices.IndexerNameAttribute class
IndexerNameAttribute.IndexerNameAttribute

System.Runtime.CompilerServices.InternalsVisibleToAttribute class
InternalsVisibleToAttribute.InternalsVisibleToAttribute
[InternalsVisibleToAttribute Properties]
InternalsVisibleToAttribute.AssemblyName

System.Runtime.CompilerServices.IsVolatile class

System.Runtime.CompilerServices.MethodCodeType enumeration

System.Runtime.CompilerServices.MethodImplAttribute class
MethodImplAttribute.MethodImplAttribute
[MethodImplAttribute Fields]
MethodImplAttribute.MethodCodeType
[MethodImplAttribute Properties]
MethodImplAttribute.Value

System.Runtime.CompilerServices.MethodImplOptions enumeration

System.Runtime.CompilerServices.RuntimeHelpers class
[RuntimeHelpers Methods]
RuntimeHelpers.GetObjectValue
RuntimeHelpers.InitializeArray
[RuntimeHelpers Properties]
RuntimeHelpers.OffsetToStringData

System.Runtime.InteropServices namespace

System.Runtime.InteropServices.CallingConvention enumeration

System.Runtime.InteropServices.CharSet enumeration

System.Runtime.InteropServices.ComVisibleAttribute class
ComVisibleAttribute.ComVisibleAttribute
[ComVisibleAttribute Properties]
ComVisibleAttribute.Value

System.Runtime.InteropServices.DllImportAttribute class
DllImportAttribute.DllImportAttribute
[DllImportAttribute Fields]
DllImportAttribute.CallingConvention
DllImportAttribute.CharSet
DllImportAttribute.EntryPoint
DllImportAttribute.PreserveSig
DllImportAttribute.SetLastError
[DllImportAttribute Properties]
DllImportAttribute.Value

System.Runtime.InteropServices.ExternalException class
ExternalException.ExternalException
[ExternalException Properties]
ExternalException.ErrorCode

System.Runtime.InteropServices.FieldOffsetAttribute class
FieldOffsetAttribute.FieldOffsetAttribute
[FieldOffsetAttribute Properties]
FieldOffsetAttribute.Value

System.Runtime.InteropServices.GCHandle structure
[GCHandle Methods]
GCHandle.AddrOfPinnedObject
GCHandle.Alloc
GCHandle.Free
GCHandle.op_Explicit
[GCHandle Properties]
GCHandle.IsAllocated
GCHandle.Target

System.Runtime.InteropServices.GCHandleType enumeration

System.Runtime.InteropServices.GuidAttribute class
GuidAttribute.GuidAttribute
[GuidAttribute Properties]
GuidAttribute.Value

System.Runtime.InteropServices.InAttribute class
InAttribute.InAttribute

System.Runtime.InteropServices.LayoutKind enumeration

System.Runtime.InteropServices.Marshal class
[Marshal Fields]
Marshal.SystemDefaultCharSize
[Marshal Methods]
Marshal.Copy
Marshal.GetLastWin32Error
Marshal.Prelink
Marshal.PrelinkAll
Marshal.PtrToStringUni
Marshal.PtrToStructure
Marshal.ReadByte
Marshal.ReadInt16
Marshal.ReadInt32
Marshal.ReadInt64
Marshal.ReadIntPtr
Marshal.SizeOf
Marshal.StructureToPtr
Marshal.WriteByte
Marshal.WriteInt16
Marshal.WriteInt32
Marshal.WriteInt64
Marshal.WriteIntPtr

System.Runtime.InteropServices.MarshalAsAttribute class
MarshalAsAttribute.MarshalAsAttribute
[MarshalAsAttribute Fields]
MarshalAsAttribute.ArraySubType
MarshalAsAttribute.SizeConst
MarshalAsAttribute.SizeParamIndex
[MarshalAsAttribute Properties]
MarshalAsAttribute.Value

System.Runtime.InteropServices.MarshalDirectiveException class
MarshalDirectiveException.MarshalDirectiveException

System.Runtime.InteropServices.OutAttribute class
OutAttribute.OutAttribute

System.Runtime.InteropServices.PreserveSigAttribute class
PreserveSigAttribute.PreserveSigAttribute

System.Runtime.InteropServices.StructLayoutAttribute class
StructLayoutAttribute.StructLayoutAttribute
[StructLayoutAttribute Fields]
StructLayoutAttribute.CharSet
StructLayoutAttribute.Size

System.Runtime.InteropServices.UnmanagedType enumeration

System.Runtime.Serialization namespace

System.Runtime.Serialization.SerializationException class
SerializationException.SerializationException

System.Security namespace

System.Security.SecurityException class
SecurityException.SecurityException

System.Security.VerificationException class
VerificationException.VerificationException

System.Security.Permissions namespace

System.Security.Permissions.SecurityAction enumeration

System.Security.Policy namespace

System.Security.Policy.Evidence class
Evidence.Evidence
[Evidence Methods]
Evidence.CopyTo
Evidence.GetEnumerator
[Evidence Properties]
Evidence.Count
Evidence.IsSynchronized
Evidence.SyncRoot

System.Text namespace

System.Text.ASCIIEncoding class
ASCIIEncoding.ASCIIEncoding
[ASCIIEncoding Methods]
ASCIIEncoding.GetByteCount
ASCIIEncoding.GetBytes
ASCIIEncoding.GetCharCount
ASCIIEncoding.GetChars
ASCIIEncoding.GetMaxByteCount
ASCIIEncoding.GetMaxCharCount

System.Text.Decoder class
Decoder.Decoder
[Decoder Methods]
Decoder.Convert
Decoder.GetCharCount
Decoder.GetChars
Decoder.Reset

System.Text.Encoder class
Encoder.Encoder
[Encoder Methods]
Encoder.Convert
Encoder.GetByteCount
Encoder.GetBytes

System.Text.Encoding class
Encoding.Encoding
[Encoding Methods]
Encoding.Clone
Encoding.Convert
Encoding.Equals
Encoding.GetByteCount
Encoding.GetBytes
Encoding.GetCharCount
Encoding.GetChars
Encoding.GetDecoder
Encoding.GetEncoder
Encoding.GetEncoding
Encoding.GetHashCode
Encoding.GetMaxByteCount
Encoding.GetMaxCharCount
Encoding.GetPreamble
Encoding.GetString
[Encoding Properties]
Encoding.ASCII
Encoding.BigEndianUnicode
Encoding.CodePage
Encoding.Default
Encoding.Unicode
Encoding.UTF7
Encoding.UTF8
Encoding.WebName

System.Text.StringBuilder class
StringBuilder.StringBuilder
[StringBuilder Methods]
StringBuilder.Append
StringBuilder.AppendFormat
StringBuilder.AppendLine
StringBuilder.EnsureCapacity
StringBuilder.Equals
StringBuilder.Insert
StringBuilder.Remove
StringBuilder.Replace
StringBuilder.ToString
[StringBuilder Properties]
StringBuilder.Capacity
StringBuilder.Chars
StringBuilder.Length

System.Text.UnicodeEncoding class
UnicodeEncoding.UnicodeEncoding
[UnicodeEncoding Fields]
UnicodeEncoding.CharSize
[UnicodeEncoding Methods]
UnicodeEncoding.Equals
UnicodeEncoding.GetByteCount
UnicodeEncoding.GetBytes
UnicodeEncoding.GetCharCount
UnicodeEncoding.GetChars
UnicodeEncoding.GetDecoder
UnicodeEncoding.GetHashCode
UnicodeEncoding.GetMaxByteCount
UnicodeEncoding.GetMaxCharCount
UnicodeEncoding.GetPreamble

System.Text.UTF7Encoding class
UTF7Encoding.UTF7Encoding
[UTF7Encoding Methods]
UTF7Encoding.Equals
UTF7Encoding.GetByteCount
UTF7Encoding.GetBytes
UTF7Encoding.GetCharCount
UTF7Encoding.GetChars
UTF7Encoding.GetDecoder
UTF7Encoding.GetEncoder
UTF7Encoding.GetHashCode
UTF7Encoding.GetMaxByteCount
UTF7Encoding.GetMaxCharCount

System.Text.UTF8Encoding class
UTF8Encoding.UTF8Encoding
[UTF8Encoding Methods]
UTF8Encoding.Equals
UTF8Encoding.GetByteCount
UTF8Encoding.GetBytes
UTF8Encoding.GetCharCount
UTF8Encoding.GetChars
UTF8Encoding.GetDecoder
UTF8Encoding.GetEncoder
UTF8Encoding.GetHashCode
UTF8Encoding.GetMaxByteCount
UTF8Encoding.GetMaxCharCount
UTF8Encoding.GetPreamble

System.Text.RegularExpressions namespace

System.Text.RegularExpressions.Capture class
[Capture Methods]
Capture.ToString
[Capture Properties]
Capture.Index
Capture.Length
Capture.Value

System.Text.RegularExpressions.CaptureCollection class
[CaptureCollection Methods]
CaptureCollection.CopyTo
CaptureCollection.GetEnumerator
[CaptureCollection Properties]
CaptureCollection.Count
CaptureCollection.IsReadOnly
CaptureCollection.IsSynchronized
CaptureCollection.Item
CaptureCollection.SyncRoot

System.Text.RegularExpressions.Group class
[Group Methods]
Group.Synchronized
[Group Properties]
Group.Captures
Group.Success

System.Text.RegularExpressions.GroupCollection class
[GroupCollection Methods]
GroupCollection.CopyTo
GroupCollection.GetEnumerator
[GroupCollection Properties]
GroupCollection.Count
GroupCollection.IsReadOnly
GroupCollection.IsSynchronized
GroupCollection.Item
GroupCollection.Item
GroupCollection.SyncRoot

System.Text.RegularExpressions.Match class
[Match Methods]
Match.NextMatch
Match.Result
Match.Synchronized
[Match Properties]
Match.Empty
Match.Groups

System.Text.RegularExpressions.MatchCollection class
[MatchCollection Methods]
MatchCollection.CopyTo
MatchCollection.GetEnumerator
[MatchCollection Properties]
MatchCollection.Count
MatchCollection.IsReadOnly
MatchCollection.IsSynchronized
MatchCollection.Item
MatchCollection.SyncRoot

System.Text.RegularExpressions.MatchEvaluator delegate

System.Text.RegularExpressions.Regex class
Regex.Regex
[Regex Fields]
Regex.capnames
Regex.caps
Regex.capsize
Regex.capslist
Regex.pattern
Regex.roptions
[Regex Methods]
Regex.Escape
Regex.GetGroupNames
Regex.GetGroupNumbers
Regex.GroupNameFromNumber
Regex.GroupNumberFromName
Regex.IsMatch
Regex.Match
Regex.Matches
Regex.Replace
Regex.Split
Regex.ToString
Regex.Unescape
Regex.UseOptionC
Regex.UseOptionR
[Regex Properties]
Regex.Options
Regex.RightToLeft

System.Text.RegularExpressions.RegexOptions enumeration

System.Text.RegularExpressions.RegexRunner class
RegexRunner.RegexRunner
[RegexRunner Fields]
RegexRunner.runcrawl
RegexRunner.runcrawlpos
RegexRunner.runmatch
RegexRunner.runregex
RegexRunner.runstack
RegexRunner.runstackpos
RegexRunner.runtext
RegexRunner.runtextbeg
RegexRunner.runtextend
RegexRunner.runtextpos
RegexRunner.runtextstart
RegexRunner.runtrack
RegexRunner.runtrackcount
RegexRunner.runtrackpos
[RegexRunner Methods]
RegexRunner.Capture
RegexRunner.CharInClass
RegexRunner.CharInSet
RegexRunner.Crawl
RegexRunner.Crawlpos
RegexRunner.DoubleCrawl
RegexRunner.DoubleStack
RegexRunner.DoubleTrack
RegexRunner.EnsureStorage
RegexRunner.FindFirstChar
RegexRunner.Go
RegexRunner.InitTrackCount
RegexRunner.IsBoundary
RegexRunner.IsECMABoundary
RegexRunner.IsMatched
RegexRunner.MatchIndex
RegexRunner.MatchLength
RegexRunner.Popcrawl
RegexRunner.Scan
RegexRunner.TransferCapture
RegexRunner.Uncapture

System.Text.RegularExpressions.RegexRunnerFactory class
RegexRunnerFactory.RegexRunnerFactory
[RegexRunnerFactory Methods]
RegexRunnerFactory.CreateInstance

System.Threading namespace

System.Threading.AutoResetEvent class
AutoResetEvent.AutoResetEvent

System.Threading.EventResetMode enumeration

System.Threading.EventWaitHandle class
EventWaitHandle.EventWaitHandle
[EventWaitHandle Methods]
EventWaitHandle.Close
EventWaitHandle.Finalize
EventWaitHandle.Reset
EventWaitHandle.Set
EventWaitHandle.WaitOne

System.Threading.Interlocked class
[Interlocked Methods]
Interlocked.CompareExchange
Interlocked.Decrement
Interlocked.Exchange
Interlocked.Increment

System.Threading.ManualResetEvent class
ManualResetEvent.ManualResetEvent

System.Threading.Monitor class
[Monitor Methods]
Monitor.Enter
Monitor.Exit
Monitor.TryEnter

System.Threading.Mutex class
Mutex.Mutex
[Mutex Methods]
Mutex.Close
Mutex.ReleaseMutex
Mutex.WaitOne

System.Threading.Thread class
Thread.Thread
[Thread Methods]
Thread.Abort
Thread.AllocateDataSlot
Thread.AllocateNamedDataSlot
Thread.FreeNamedDataSlot
Thread.GetData
Thread.GetDomain
Thread.GetNamedDataSlot
Thread.Join
Thread.MemoryBarrier
Thread.SetData
Thread.SetProcessorAffinity
Thread.Sleep
Thread.Start
[Thread Properties]
Thread.CurrentThread
Thread.IsBackground
Thread.ManagedThreadId
Thread.Name
Thread.Priority

System.Threading.ThreadAbortException class
[ThreadAbortException Properties]
ThreadAbortException.ExceptionState

System.Threading.ThreadPool class
[ThreadPool Methods]
ThreadPool.GetMaxThreads
ThreadPool.QueueUserWorkItem
ThreadPool.SetMaxThreads

System.Threading.ThreadPriority enumeration

System.Threading.ThreadStart delegate

System.Threading.ThreadStateException class
ThreadStateException.ThreadStateException

System.Threading.Timeout class
[Timeout Fields]
Timeout.Infinite

System.Threading.Timer class
Timer.Timer
[Timer Methods]
Timer.Change
Timer.Dispose

System.Threading.TimerCallback delegate

System.Threading.WaitCallback delegate

System.Threading.WaitHandle class
WaitHandle.WaitHandle
[WaitHandle Fields]
WaitHandle.InvalidHandle
[WaitHandle Methods]
WaitHandle.Close
WaitHandle.Dispose
WaitHandle.WaitOne
[WaitHandle Properties]
WaitHandle.Handle

System.Xml namespace

System.Xml.ConformanceLevel enumeration

System.Xml.EntityHandling enumeration

System.Xml.Formatting enumeration

System.Xml.IHasXmlNode interface
[IHasXmlNode Methods]
IHasXmlNode.GetNode

System.Xml.IXmlLineInfo interface
[IXmlLineInfo Methods]
IXmlLineInfo.HasLineInfo
[IXmlLineInfo Properties]
IXmlLineInfo.LineNumber
IXmlLineInfo.LinePosition

System.Xml.IXmlNamespaceResolver interface
[IXmlNamespaceResolver Methods]
IXmlNamespaceResolver.GetNamespacesInScope
IXmlNamespaceResolver.LookupNamespace
IXmlNamespaceResolver.LookupPrefix

System.Xml.NameTable class
NameTable.NameTable
[NameTable Methods]
NameTable.Add
NameTable.Get

System.Xml.NewLineHandling enumeration

System.Xml.ReadState enumeration

System.Xml.ValidationType enumeration

System.Xml.WhitespaceHandling enumeration

System.Xml.WriteState enumeration

System.Xml.XmlAttribute class
XmlAttribute.XmlAttribute
[XmlAttribute Methods]
XmlAttribute.AppendChild
XmlAttribute.CloneNode
XmlAttribute.InsertAfter
XmlAttribute.InsertBefore
XmlAttribute.PrependChild
XmlAttribute.RemoveChild
XmlAttribute.ReplaceChild
XmlAttribute.WriteContentTo
XmlAttribute.WriteTo
[XmlAttribute Properties]
XmlAttribute.BaseURI
XmlAttribute.InnerText
XmlAttribute.InnerXml
XmlAttribute.LocalName
XmlAttribute.Name
XmlAttribute.NamespaceURI
XmlAttribute.NodeType
XmlAttribute.OwnerDocument
XmlAttribute.OwnerElement
XmlAttribute.ParentNode
XmlAttribute.Prefix
XmlAttribute.SchemaInfo
XmlAttribute.Specified
XmlAttribute.Value

System.Xml.XmlAttributeCollection class
[XmlAttributeCollection Methods]
XmlAttributeCollection.Append
XmlAttributeCollection.CopyTo
XmlAttributeCollection.InsertAfter
XmlAttributeCollection.InsertBefore
XmlAttributeCollection.Prepend
XmlAttributeCollection.Remove
XmlAttributeCollection.RemoveAll
XmlAttributeCollection.RemoveAt
XmlAttributeCollection.SetNamedItem
[XmlAttributeCollection Properties]
XmlAttributeCollection.ItemOf
XmlAttributeCollection.ItemOf
XmlAttributeCollection.ItemOf

System.Xml.XmlCDataSection class
XmlCDataSection.XmlCDataSection
[XmlCDataSection Methods]
XmlCDataSection.CloneNode
XmlCDataSection.WriteContentTo
XmlCDataSection.WriteTo
[XmlCDataSection Properties]
XmlCDataSection.LocalName
XmlCDataSection.Name
XmlCDataSection.NodeType
XmlCDataSection.ParentNode

System.Xml.XmlCharacterData class
XmlCharacterData.XmlCharacterData
[XmlCharacterData Methods]
XmlCharacterData.AppendData
XmlCharacterData.DeleteData
XmlCharacterData.InsertData
XmlCharacterData.ReplaceData
XmlCharacterData.Substring
[XmlCharacterData Properties]
XmlCharacterData.Data
XmlCharacterData.InnerText
XmlCharacterData.Length
XmlCharacterData.Value

System.Xml.XmlComment class
XmlComment.XmlComment
[XmlComment Methods]
XmlComment.CloneNode
XmlComment.WriteContentTo
XmlComment.WriteTo
[XmlComment Properties]
XmlComment.LocalName
XmlComment.Name
XmlComment.NodeType

System.Xml.XmlConvert class
XmlConvert.XmlConvert
[XmlConvert Methods]
XmlConvert.DecodeName
XmlConvert.EncodeLocalName
XmlConvert.EncodeName
XmlConvert.EncodeNmToken
XmlConvert.FromBinHexString
XmlConvert.ToBinHexString
XmlConvert.ToBoolean
XmlConvert.ToByte
XmlConvert.ToChar
XmlConvert.ToDateTime
XmlConvert.ToDecimal
XmlConvert.ToDouble
XmlConvert.ToGuid
XmlConvert.ToInt16
XmlConvert.ToInt32
XmlConvert.ToInt64
XmlConvert.ToSByte
XmlConvert.ToSingle
XmlConvert.ToString
XmlConvert.ToTimeSpan
XmlConvert.ToUInt16
XmlConvert.ToUInt32
XmlConvert.ToUInt64
XmlConvert.VerifyName
XmlConvert.VerifyNCName
XmlConvert.VerifyNMTOKEN
XmlConvert.VerifyTOKEN

System.Xml.XmlDateTimeSerializationMode enumeration

System.Xml.XmlDeclaration class
XmlDeclaration.XmlDeclaration
[XmlDeclaration Methods]
XmlDeclaration.CloneNode
XmlDeclaration.WriteContentTo
XmlDeclaration.WriteTo
[XmlDeclaration Properties]
XmlDeclaration.Encoding
XmlDeclaration.InnerText
XmlDeclaration.LocalName
XmlDeclaration.Name
XmlDeclaration.NodeType
XmlDeclaration.Standalone
XmlDeclaration.Value
XmlDeclaration.Version

System.Xml.XmlDocument class
XmlDocument.XmlDocument
[XmlDocument Methods]
XmlDocument.CloneNode
XmlDocument.CreateAttribute
XmlDocument.CreateCDataSection
XmlDocument.CreateComment
XmlDocument.CreateDefaultAttribute
XmlDocument.CreateDocumentFragment
XmlDocument.CreateElement
XmlDocument.CreateEntityReference
XmlDocument.CreateNode
XmlDocument.CreateProcessingInstruction
XmlDocument.CreateSignificantWhitespace
XmlDocument.CreateTextNode
XmlDocument.CreateWhitespace
XmlDocument.CreateXmlDeclaration
XmlDocument.GetElementsByTagName
XmlDocument.ImportNode
XmlDocument.Load
XmlDocument.LoadXml
XmlDocument.ReadNode
XmlDocument.Save
XmlDocument.Validate
XmlDocument.WriteContentTo
XmlDocument.WriteTo
[XmlDocument Properties]
XmlDocument.BaseURI
XmlDocument.DocumentElement
XmlDocument.Implementation
XmlDocument.InnerXml
XmlDocument.IsReadOnly
XmlDocument.LocalName
XmlDocument.Name
XmlDocument.NameTable
XmlDocument.NodeType
XmlDocument.OwnerDocument
XmlDocument.ParentNode
XmlDocument.PreserveWhitespace
XmlDocument.SchemaInfo
XmlDocument.Schemas
XmlDocument.XmlResolver
[XmlDocument Events]
XmlDocument.NodeChanged
XmlDocument.NodeChanging
XmlDocument.NodeInserted
XmlDocument.NodeInserting
XmlDocument.NodeRemoved
XmlDocument.NodeRemoving

System.Xml.XmlDocumentFragment class
XmlDocumentFragment.XmlDocumentFragment
[XmlDocumentFragment Methods]
XmlDocumentFragment.CloneNode
XmlDocumentFragment.WriteContentTo
XmlDocumentFragment.WriteTo
[XmlDocumentFragment Properties]
XmlDocumentFragment.InnerXml
XmlDocumentFragment.LocalName
XmlDocumentFragment.Name
XmlDocumentFragment.NodeType
XmlDocumentFragment.OwnerDocument
XmlDocumentFragment.ParentNode

System.Xml.XmlElement class
XmlElement.XmlElement
[XmlElement Methods]
XmlElement.CloneNode
XmlElement.GetAttribute
XmlElement.GetAttributeNode
XmlElement.GetElementsByTagName
XmlElement.HasAttribute
XmlElement.RemoveAll
XmlElement.RemoveAllAttributes
XmlElement.RemoveAttribute
XmlElement.RemoveAttributeAt
XmlElement.RemoveAttributeNode
XmlElement.SetAttribute
XmlElement.SetAttributeNode
XmlElement.WriteContentTo
XmlElement.WriteTo
[XmlElement Properties]
XmlElement.Attributes
XmlElement.HasAttributes
XmlElement.InnerText
XmlElement.InnerXml
XmlElement.IsEmpty
XmlElement.LocalName
XmlElement.Name
XmlElement.NamespaceURI
XmlElement.NextSibling
XmlElement.NodeType
XmlElement.OwnerDocument
XmlElement.ParentNode
XmlElement.Prefix
XmlElement.SchemaInfo

System.Xml.XmlEntityReference class
XmlEntityReference.XmlEntityReference
[XmlEntityReference Methods]
XmlEntityReference.CloneNode
XmlEntityReference.WriteContentTo
XmlEntityReference.WriteTo
[XmlEntityReference Properties]
XmlEntityReference.BaseURI
XmlEntityReference.IsReadOnly
XmlEntityReference.LocalName
XmlEntityReference.Name
XmlEntityReference.NodeType
XmlEntityReference.Value

System.Xml.XmlException class
XmlException.XmlException
[XmlException Properties]
XmlException.LineNumber
XmlException.LinePosition
XmlException.Message
XmlException.SourceUri

System.Xml.XmlImplementation class
XmlImplementation.XmlImplementation
[XmlImplementation Methods]
XmlImplementation.CreateDocument
XmlImplementation.HasFeature

System.Xml.XmlLinkedNode class
[XmlLinkedNode Properties]
XmlLinkedNode.NextSibling
XmlLinkedNode.PreviousSibling

System.Xml.XmlNamedNodeMap class
[XmlNamedNodeMap Methods]
XmlNamedNodeMap.GetEnumerator
XmlNamedNodeMap.GetNamedItem
XmlNamedNodeMap.Item
XmlNamedNodeMap.RemoveNamedItem
XmlNamedNodeMap.SetNamedItem
[XmlNamedNodeMap Properties]
XmlNamedNodeMap.Count

System.Xml.XmlNamespaceManager class
XmlNamespaceManager.XmlNamespaceManager
[XmlNamespaceManager Methods]
XmlNamespaceManager.AddNamespace
XmlNamespaceManager.GetEnumerator
XmlNamespaceManager.GetNamespacesInScope
XmlNamespaceManager.HasNamespace
XmlNamespaceManager.LookupNamespace
XmlNamespaceManager.LookupPrefix
XmlNamespaceManager.PopScope
XmlNamespaceManager.PushScope
XmlNamespaceManager.RemoveNamespace
[XmlNamespaceManager Properties]
XmlNamespaceManager.DefaultNamespace
XmlNamespaceManager.NameTable

System.Xml.XmlNamespaceScope enumeration

System.Xml.XmlNameTable class
XmlNameTable.XmlNameTable
[XmlNameTable Methods]
XmlNameTable.Add
XmlNameTable.Get

System.Xml.XmlNode class
[XmlNode Methods]
XmlNode.AppendChild
XmlNode.Clone
XmlNode.CloneNode
XmlNode.GetEnumerator
XmlNode.GetNamespaceOfPrefix
XmlNode.GetPrefixOfNamespace
XmlNode.InsertAfter
XmlNode.InsertBefore
XmlNode.Normalize
XmlNode.PrependChild
XmlNode.RemoveAll
XmlNode.RemoveChild
XmlNode.ReplaceChild
XmlNode.SelectNodes
XmlNode.SelectSingleNode
XmlNode.Supports
XmlNode.WriteContentTo
XmlNode.WriteTo
[XmlNode Properties]
XmlNode.Attributes
XmlNode.BaseURI
XmlNode.ChildNodes
XmlNode.FirstChild
XmlNode.HasChildNodes
XmlNode.InnerText
XmlNode.InnerXml
XmlNode.IsReadOnly
XmlNode.Item
XmlNode.Item
XmlNode.LastChild
XmlNode.LocalName
XmlNode.Name
XmlNode.NamespaceURI
XmlNode.NextSibling
XmlNode.NodeType
XmlNode.OuterXml
XmlNode.OwnerDocument
XmlNode.ParentNode
XmlNode.Prefix
XmlNode.PreviousSibling
XmlNode.SchemaInfo
XmlNode.Value

System.Xml.XmlNodeChangedAction enumeration

System.Xml.XmlNodeChangedEventArgs class
XmlNodeChangedEventArgs.XmlNodeChangedEventArgs
[XmlNodeChangedEventArgs Properties]
XmlNodeChangedEventArgs.Action
XmlNodeChangedEventArgs.NewParent
XmlNodeChangedEventArgs.NewValue
XmlNodeChangedEventArgs.Node
XmlNodeChangedEventArgs.OldParent
XmlNodeChangedEventArgs.OldValue

System.Xml.XmlNodeChangedEventHandler delegate

System.Xml.XmlNodeList class
XmlNodeList.XmlNodeList
[XmlNodeList Methods]
XmlNodeList.GetEnumerator
XmlNodeList.Item
[XmlNodeList Properties]
XmlNodeList.Count
XmlNodeList.ItemOf

System.Xml.XmlNodeOrder enumeration

System.Xml.XmlNodeReader class
XmlNodeReader.XmlNodeReader
[XmlNodeReader Methods]
XmlNodeReader.Close
XmlNodeReader.GetAttribute
XmlNodeReader.LookupNamespace
XmlNodeReader.MoveToAttribute
XmlNodeReader.MoveToElement
XmlNodeReader.MoveToFirstAttribute
XmlNodeReader.MoveToNextAttribute
XmlNodeReader.Read
XmlNodeReader.ReadAttributeValue
XmlNodeReader.ReadContentAsBase64
XmlNodeReader.ReadContentAsBinHex
XmlNodeReader.ReadElementContentAsBase64
XmlNodeReader.ReadElementContentAsBinHex
XmlNodeReader.ReadString
XmlNodeReader.ResolveEntity
XmlNodeReader.Skip
[XmlNodeReader Properties]
XmlNodeReader.AttributeCount
XmlNodeReader.BaseURI
XmlNodeReader.CanReadBinaryContent
XmlNodeReader.Depth
XmlNodeReader.EOF
XmlNodeReader.HasAttributes
XmlNodeReader.HasValue
XmlNodeReader.IsDefault
XmlNodeReader.IsEmptyElement
XmlNodeReader.LocalName
XmlNodeReader.Name
XmlNodeReader.NamespaceURI
XmlNodeReader.NameTable
XmlNodeReader.NodeType
XmlNodeReader.Prefix
XmlNodeReader.ReadState
XmlNodeReader.SchemaInfo
XmlNodeReader.Value
XmlNodeReader.XmlLang
XmlNodeReader.XmlSpace

System.Xml.XmlNodeType enumeration

System.Xml.XmlOutputMethod enumeration

System.Xml.XmlParserContext class
XmlParserContext.XmlParserContext
[XmlParserContext Properties]
XmlParserContext.BaseURI
XmlParserContext.DocTypeName
XmlParserContext.Encoding
XmlParserContext.InternalSubset
XmlParserContext.NamespaceManager
XmlParserContext.NameTable
XmlParserContext.PublicId
XmlParserContext.SystemId
XmlParserContext.XmlLang
XmlParserContext.XmlSpace

System.Xml.XmlProcessingInstruction class
XmlProcessingInstruction.XmlProcessingInstruction
[XmlProcessingInstruction Methods]
XmlProcessingInstruction.CloneNode
XmlProcessingInstruction.WriteContentTo
XmlProcessingInstruction.WriteTo
[XmlProcessingInstruction Properties]
XmlProcessingInstruction.Data
XmlProcessingInstruction.InnerText
XmlProcessingInstruction.LocalName
XmlProcessingInstruction.Name
XmlProcessingInstruction.NodeType
XmlProcessingInstruction.Target
XmlProcessingInstruction.Value

System.Xml.XmlQualifiedName class
XmlQualifiedName.XmlQualifiedName
[XmlQualifiedName Fields]
XmlQualifiedName.Empty
[XmlQualifiedName Methods]
XmlQualifiedName.Equals
XmlQualifiedName.GetHashCode
XmlQualifiedName.op_Equality
XmlQualifiedName.op_Inequality
XmlQualifiedName.ToString
[XmlQualifiedName Properties]
XmlQualifiedName.IsEmpty
XmlQualifiedName.Name
XmlQualifiedName.Namespace

System.Xml.XmlReader class
XmlReader.XmlReader
[XmlReader Methods]
XmlReader.Close
XmlReader.Create
XmlReader.Dispose
XmlReader.GetAttribute
XmlReader.IsName
XmlReader.IsNameToken
XmlReader.IsStartElement
XmlReader.LookupNamespace
XmlReader.MoveToAttribute
XmlReader.MoveToContent
XmlReader.MoveToElement
XmlReader.MoveToFirstAttribute
XmlReader.MoveToNextAttribute
XmlReader.Read
XmlReader.ReadAttributeValue
XmlReader.ReadContentAs
XmlReader.ReadContentAsBase64
XmlReader.ReadContentAsBinHex
XmlReader.ReadContentAsBoolean
XmlReader.ReadContentAsDateTime
XmlReader.ReadContentAsDecimal
XmlReader.ReadContentAsDouble
XmlReader.ReadContentAsFloat
XmlReader.ReadContentAsInt
XmlReader.ReadContentAsLong
XmlReader.ReadContentAsObject
XmlReader.ReadContentAsString
XmlReader.ReadElementContentAs
XmlReader.ReadElementContentAsBase64
XmlReader.ReadElementContentAsBinHex
XmlReader.ReadElementContentAsBoolean
XmlReader.ReadElementContentAsDateTime
XmlReader.ReadElementContentAsDecimal
XmlReader.ReadElementContentAsDouble
XmlReader.ReadElementContentAsFloat
XmlReader.ReadElementContentAsInt
XmlReader.ReadElementContentAsLong
XmlReader.ReadElementContentAsObject
XmlReader.ReadElementContentAsString
XmlReader.ReadElementString
XmlReader.ReadEndElement
XmlReader.ReadInnerXml
XmlReader.ReadOuterXml
XmlReader.ReadStartElement
XmlReader.ReadString
XmlReader.ReadSubtree
XmlReader.ReadToDescendant
XmlReader.ReadToFollowing
XmlReader.ReadToNextSibling
XmlReader.ReadValueChunk
XmlReader.ResolveEntity
XmlReader.Skip
[XmlReader Properties]
XmlReader.AttributeCount
XmlReader.BaseURI
XmlReader.CanReadBinaryContent
XmlReader.CanReadValueChunk
XmlReader.CanResolveEntity
XmlReader.Depth
XmlReader.EOF
XmlReader.HasAttributes
XmlReader.HasValue
XmlReader.IsDefault
XmlReader.IsEmptyElement
XmlReader.Item
XmlReader.Item
XmlReader.Item
XmlReader.LocalName
XmlReader.Name
XmlReader.NamespaceURI
XmlReader.NameTable
XmlReader.NodeType
XmlReader.Prefix
XmlReader.QuoteChar
XmlReader.ReadState
XmlReader.SchemaInfo
XmlReader.Settings
XmlReader.Value
XmlReader.ValueType
XmlReader.XmlLang
XmlReader.XmlSpace

System.Xml.XmlReaderSettings class
XmlReaderSettings.XmlReaderSettings
[XmlReaderSettings Methods]
XmlReaderSettings.Clone
XmlReaderSettings.Reset
[XmlReaderSettings Properties]
XmlReaderSettings.CheckCharacters
XmlReaderSettings.CloseInput
XmlReaderSettings.ConformanceLevel
XmlReaderSettings.IgnoreComments
XmlReaderSettings.IgnoreProcessingInstructions
XmlReaderSettings.IgnoreWhitespace
XmlReaderSettings.LineNumberOffset
XmlReaderSettings.LinePositionOffset
XmlReaderSettings.NameTable
XmlReaderSettings.Schemas
XmlReaderSettings.ValidationFlags
XmlReaderSettings.ValidationType
XmlReaderSettings.XmlResolver
[XmlReaderSettings Events]
XmlReaderSettings.ValidationEventHandler

System.Xml.XmlResolver class
XmlResolver.XmlResolver
[XmlResolver Methods]
XmlResolver.GetEntity
XmlResolver.ResolveUri
[XmlResolver Properties]
XmlResolver.Credentials
XmlResolver.NameTable

System.Xml.XmlSignificantWhitespace class
XmlSignificantWhitespace.XmlSignificantWhitespace
[XmlSignificantWhitespace Methods]
XmlSignificantWhitespace.CloneNode
XmlSignificantWhitespace.WriteContentTo
XmlSignificantWhitespace.WriteTo
[XmlSignificantWhitespace Properties]
XmlSignificantWhitespace.LocalName
XmlSignificantWhitespace.Name
XmlSignificantWhitespace.NodeType
XmlSignificantWhitespace.ParentNode
XmlSignificantWhitespace.Value

System.Xml.XmlSpace enumeration

System.Xml.XmlText class
XmlText.XmlText
[XmlText Methods]
XmlText.CloneNode
XmlText.SplitText
XmlText.WriteContentTo
XmlText.WriteTo
[XmlText Properties]
XmlText.LocalName
XmlText.Name
XmlText.NodeType
XmlText.ParentNode
XmlText.Value

System.Xml.XmlTextReader class
XmlTextReader.XmlTextReader
[XmlTextReader Methods]
XmlTextReader.Close
XmlTextReader.GetAttribute
XmlTextReader.GetNamespacesInScope
XmlTextReader.GetRemainder
XmlTextReader.HasLineInfo
XmlTextReader.LookupNamespace
XmlTextReader.MoveToAttribute
XmlTextReader.MoveToElement
XmlTextReader.MoveToFirstAttribute
XmlTextReader.MoveToNextAttribute
XmlTextReader.Read
XmlTextReader.ReadAttributeValue
XmlTextReader.ReadBase64
XmlTextReader.ReadBinHex
XmlTextReader.ReadChars
XmlTextReader.ReadContentAsBase64
XmlTextReader.ReadContentAsBinHex
XmlTextReader.ReadElementContentAsBase64
XmlTextReader.ReadElementContentAsBinHex
XmlTextReader.ReadString
XmlTextReader.ResetState
XmlTextReader.ResolveEntity
XmlTextReader.Skip
[XmlTextReader Properties]
XmlTextReader.AttributeCount
XmlTextReader.BaseURI
XmlTextReader.CanReadBinaryContent
XmlTextReader.CanReadValueChunk
XmlTextReader.CanResolveEntity
XmlTextReader.Depth
XmlTextReader.Encoding
XmlTextReader.EntityHandling
XmlTextReader.EOF
XmlTextReader.HasValue
XmlTextReader.IsDefault
XmlTextReader.IsEmptyElement
XmlTextReader.LineNumber
XmlTextReader.LinePosition
XmlTextReader.LocalName
XmlTextReader.Name
XmlTextReader.Namespaces
XmlTextReader.NamespaceURI
XmlTextReader.NameTable
XmlTextReader.NodeType
XmlTextReader.Normalization
XmlTextReader.Prefix
XmlTextReader.QuoteChar
XmlTextReader.ReadState
XmlTextReader.Settings
XmlTextReader.Value
XmlTextReader.WhitespaceHandling
XmlTextReader.XmlLang
XmlTextReader.XmlResolver
XmlTextReader.XmlSpace

System.Xml.XmlTextWriter class
XmlTextWriter.XmlTextWriter
[XmlTextWriter Methods]
XmlTextWriter.Close
XmlTextWriter.Flush
XmlTextWriter.LookupPrefix
XmlTextWriter.WriteBase64
XmlTextWriter.WriteBinHex
XmlTextWriter.WriteCData
XmlTextWriter.WriteCharEntity
XmlTextWriter.WriteChars
XmlTextWriter.WriteComment
XmlTextWriter.WriteDocType
XmlTextWriter.WriteEndAttribute
XmlTextWriter.WriteEndDocument
XmlTextWriter.WriteEndElement
XmlTextWriter.WriteEntityRef
XmlTextWriter.WriteFullEndElement
XmlTextWriter.WriteName
XmlTextWriter.WriteNmToken
XmlTextWriter.WriteProcessingInstruction
XmlTextWriter.WriteQualifiedName
XmlTextWriter.WriteRaw
XmlTextWriter.WriteStartAttribute
XmlTextWriter.WriteStartDocument
XmlTextWriter.WriteStartElement
XmlTextWriter.WriteString
XmlTextWriter.WriteSurrogateCharEntity
XmlTextWriter.WriteWhitespace
[XmlTextWriter Properties]
XmlTextWriter.BaseStream
XmlTextWriter.Formatting
XmlTextWriter.Indentation
XmlTextWriter.IndentChar
XmlTextWriter.Namespaces
XmlTextWriter.QuoteChar
XmlTextWriter.WriteState
XmlTextWriter.XmlLang
XmlTextWriter.XmlSpace

System.Xml.XmlTokenizedType enumeration

System.Xml.XmlUrlResolver class
XmlUrlResolver.XmlUrlResolver
[XmlUrlResolver Methods]
XmlUrlResolver.GetEntity
XmlUrlResolver.ResolveUri
[XmlUrlResolver Properties]
XmlUrlResolver.Credentials

System.Xml.XmlWhitespace class
XmlWhitespace.XmlWhitespace
[XmlWhitespace Methods]
XmlWhitespace.CloneNode
XmlWhitespace.WriteContentTo
XmlWhitespace.WriteTo
[XmlWhitespace Properties]
XmlWhitespace.LocalName
XmlWhitespace.Name
XmlWhitespace.NodeType
XmlWhitespace.ParentNode
XmlWhitespace.Value

System.Xml.XmlWriter class
XmlWriter.XmlWriter
[XmlWriter Methods]
XmlWriter.Close
XmlWriter.Create
XmlWriter.Dispose
XmlWriter.Flush
XmlWriter.LookupPrefix
XmlWriter.WriteAttributes
XmlWriter.WriteAttributeString
XmlWriter.WriteBase64
XmlWriter.WriteBinHex
XmlWriter.WriteCData
XmlWriter.WriteCharEntity
XmlWriter.WriteChars
XmlWriter.WriteComment
XmlWriter.WriteDocType
XmlWriter.WriteElementString
XmlWriter.WriteEndAttribute
XmlWriter.WriteEndDocument
XmlWriter.WriteEndElement
XmlWriter.WriteEntityRef
XmlWriter.WriteFullEndElement
XmlWriter.WriteName
XmlWriter.WriteNmToken
XmlWriter.WriteNode
XmlWriter.WriteProcessingInstruction
XmlWriter.WriteQualifiedName
XmlWriter.WriteRaw
XmlWriter.WriteStartAttribute
XmlWriter.WriteStartDocument
XmlWriter.WriteStartElement
XmlWriter.WriteString
XmlWriter.WriteSurrogateCharEntity
XmlWriter.WriteValue
XmlWriter.WriteWhitespace
[XmlWriter Properties]
XmlWriter.Settings
XmlWriter.WriteState
XmlWriter.XmlLang
XmlWriter.XmlSpace

System.Xml.XmlWriterSettings class
XmlWriterSettings.XmlWriterSettings
[XmlWriterSettings Methods]
XmlWriterSettings.Clone
XmlWriterSettings.Reset
[XmlWriterSettings Properties]
XmlWriterSettings.CheckCharacters
XmlWriterSettings.CloseOutput
XmlWriterSettings.ConformanceLevel
XmlWriterSettings.Encoding
XmlWriterSettings.Indent
XmlWriterSettings.IndentChars
XmlWriterSettings.NewLineChars
XmlWriterSettings.NewLineHandling
XmlWriterSettings.NewLineOnAttributes
XmlWriterSettings.OmitXmlDeclaration
XmlWriterSettings.OutputMethod

System.Xml.Schema namespace

System.Xml.Schema.IXmlSchemaInfo interface
[IXmlSchemaInfo Properties]
IXmlSchemaInfo.IsDefault
IXmlSchemaInfo.IsNil
IXmlSchemaInfo.MemberType
IXmlSchemaInfo.SchemaAttribute
IXmlSchemaInfo.SchemaElement
IXmlSchemaInfo.SchemaType
IXmlSchemaInfo.Validity

System.Xml.Schema.ValidationEventArgs class
[ValidationEventArgs Properties]
ValidationEventArgs.Exception
ValidationEventArgs.Message
ValidationEventArgs.Severity

System.Xml.Schema.ValidationEventHandler delegate

System.Xml.Schema.XmlAtomicValue class
[XmlAtomicValue Methods]
XmlAtomicValue.Clone
XmlAtomicValue.ToString
XmlAtomicValue.ValueAs
[XmlAtomicValue Properties]
XmlAtomicValue.IsNode
XmlAtomicValue.TypedValue
XmlAtomicValue.Value
XmlAtomicValue.ValueAsBoolean
XmlAtomicValue.ValueAsDateTime
XmlAtomicValue.ValueAsDouble
XmlAtomicValue.ValueAsInt
XmlAtomicValue.ValueAsLong
XmlAtomicValue.ValueType
XmlAtomicValue.XmlType

System.Xml.Schema.XmlSchema class
XmlSchema.XmlSchema
[XmlSchema Fields]
XmlSchema.InstanceNamespace
XmlSchema.Namespace
[XmlSchema Methods]
XmlSchema.Read
XmlSchema.Write
[XmlSchema Properties]
XmlSchema.AttributeFormDefault
XmlSchema.AttributeGroups
XmlSchema.Attributes
XmlSchema.BlockDefault
XmlSchema.ElementFormDefault
XmlSchema.Elements
XmlSchema.FinalDefault
XmlSchema.Groups
XmlSchema.Id
XmlSchema.Includes
XmlSchema.IsCompiled
XmlSchema.Items
XmlSchema.Notations
XmlSchema.SchemaTypes
XmlSchema.TargetNamespace
XmlSchema.UnhandledAttributes
XmlSchema.Version

System.Xml.Schema.XmlSchemaAll class
XmlSchemaAll.XmlSchemaAll
[XmlSchemaAll Properties]
XmlSchemaAll.Items

System.Xml.Schema.XmlSchemaAnnotated class
XmlSchemaAnnotated.XmlSchemaAnnotated
[XmlSchemaAnnotated Properties]
XmlSchemaAnnotated.Annotation
XmlSchemaAnnotated.Id
XmlSchemaAnnotated.UnhandledAttributes

System.Xml.Schema.XmlSchemaAnnotation class
XmlSchemaAnnotation.XmlSchemaAnnotation
[XmlSchemaAnnotation Properties]
XmlSchemaAnnotation.Id
XmlSchemaAnnotation.Items
XmlSchemaAnnotation.UnhandledAttributes

System.Xml.Schema.XmlSchemaAny class
XmlSchemaAny.XmlSchemaAny
[XmlSchemaAny Properties]
XmlSchemaAny.Namespace
XmlSchemaAny.ProcessContents

System.Xml.Schema.XmlSchemaAnyAttribute class
XmlSchemaAnyAttribute.XmlSchemaAnyAttribute
[XmlSchemaAnyAttribute Properties]
XmlSchemaAnyAttribute.Namespace
XmlSchemaAnyAttribute.ProcessContents

System.Xml.Schema.XmlSchemaAppInfo class
XmlSchemaAppInfo.XmlSchemaAppInfo
[XmlSchemaAppInfo Properties]
XmlSchemaAppInfo.Markup
XmlSchemaAppInfo.Source

System.Xml.Schema.XmlSchemaAttribute class
XmlSchemaAttribute.XmlSchemaAttribute
[XmlSchemaAttribute Properties]
XmlSchemaAttribute.AttributeSchemaType
XmlSchemaAttribute.AttributeType
XmlSchemaAttribute.DefaultValue
XmlSchemaAttribute.FixedValue
XmlSchemaAttribute.Form
XmlSchemaAttribute.Name
XmlSchemaAttribute.QualifiedName
XmlSchemaAttribute.RefName
XmlSchemaAttribute.SchemaType
XmlSchemaAttribute.SchemaTypeName
XmlSchemaAttribute.Use

System.Xml.Schema.XmlSchemaAttributeGroup class
XmlSchemaAttributeGroup.XmlSchemaAttributeGroup
[XmlSchemaAttributeGroup Properties]
XmlSchemaAttributeGroup.AnyAttribute
XmlSchemaAttributeGroup.Attributes
XmlSchemaAttributeGroup.Name
XmlSchemaAttributeGroup.QualifiedName
XmlSchemaAttributeGroup.RedefinedAttributeGroup

System.Xml.Schema.XmlSchemaAttributeGroupRef class
XmlSchemaAttributeGroupRef.XmlSchemaAttributeGroupRef
[XmlSchemaAttributeGroupRef Properties]
XmlSchemaAttributeGroupRef.RefName

System.Xml.Schema.XmlSchemaChoice class
XmlSchemaChoice.XmlSchemaChoice
[XmlSchemaChoice Properties]
XmlSchemaChoice.Items

System.Xml.Schema.XmlSchemaCompilationSettings class
XmlSchemaCompilationSettings.XmlSchemaCompilationSettings
[XmlSchemaCompilationSettings Properties]
XmlSchemaCompilationSettings.EnableUpaCheck

System.Xml.Schema.XmlSchemaComplexContent class
XmlSchemaComplexContent.XmlSchemaComplexContent
[XmlSchemaComplexContent Properties]
XmlSchemaComplexContent.Content
XmlSchemaComplexContent.IsMixed

System.Xml.Schema.XmlSchemaComplexContentExtension class
XmlSchemaComplexContentExtension.XmlSchemaComplexContentExtension
[XmlSchemaComplexContentExtension Properties]
XmlSchemaComplexContentExtension.AnyAttribute
XmlSchemaComplexContentExtension.Attributes
XmlSchemaComplexContentExtension.BaseTypeName
XmlSchemaComplexContentExtension.Particle

System.Xml.Schema.XmlSchemaComplexContentRestriction class
XmlSchemaComplexContentRestriction.XmlSchemaComplexContentRestriction
[XmlSchemaComplexContentRestriction Properties]
XmlSchemaComplexContentRestriction.AnyAttribute
XmlSchemaComplexContentRestriction.Attributes
XmlSchemaComplexContentRestriction.BaseTypeName
XmlSchemaComplexContentRestriction.Particle

System.Xml.Schema.XmlSchemaComplexType class
XmlSchemaComplexType.XmlSchemaComplexType
[XmlSchemaComplexType Properties]
XmlSchemaComplexType.AnyAttribute
XmlSchemaComplexType.Attributes
XmlSchemaComplexType.AttributeUses
XmlSchemaComplexType.AttributeWildcard
XmlSchemaComplexType.Block
XmlSchemaComplexType.BlockResolved
XmlSchemaComplexType.ContentModel
XmlSchemaComplexType.ContentType
XmlSchemaComplexType.ContentTypeParticle
XmlSchemaComplexType.IsAbstract
XmlSchemaComplexType.IsMixed
XmlSchemaComplexType.Particle

System.Xml.Schema.XmlSchemaContent class
XmlSchemaContent.XmlSchemaContent

System.Xml.Schema.XmlSchemaContentModel class
XmlSchemaContentModel.XmlSchemaContentModel
[XmlSchemaContentModel Properties]
XmlSchemaContentModel.Content

System.Xml.Schema.XmlSchemaContentProcessing enumeration

System.Xml.Schema.XmlSchemaContentType enumeration

System.Xml.Schema.XmlSchemaDatatype class
XmlSchemaDatatype.XmlSchemaDatatype
[XmlSchemaDatatype Methods]
XmlSchemaDatatype.ChangeType
XmlSchemaDatatype.IsDerivedFrom
XmlSchemaDatatype.ParseValue
[XmlSchemaDatatype Properties]
XmlSchemaDatatype.TokenizedType
XmlSchemaDatatype.TypeCode
XmlSchemaDatatype.ValueType
XmlSchemaDatatype.Variety

System.Xml.Schema.XmlSchemaDatatypeVariety enumeration

System.Xml.Schema.XmlSchemaDerivationMethod enumeration

System.Xml.Schema.XmlSchemaDocumentation class
XmlSchemaDocumentation.XmlSchemaDocumentation
[XmlSchemaDocumentation Properties]
XmlSchemaDocumentation.Language
XmlSchemaDocumentation.Markup
XmlSchemaDocumentation.Source

System.Xml.Schema.XmlSchemaElement class
XmlSchemaElement.XmlSchemaElement
[XmlSchemaElement Properties]
XmlSchemaElement.Block
XmlSchemaElement.BlockResolved
XmlSchemaElement.Constraints
XmlSchemaElement.DefaultValue
XmlSchemaElement.ElementSchemaType
XmlSchemaElement.ElementType
XmlSchemaElement.Final
XmlSchemaElement.FinalResolved
XmlSchemaElement.FixedValue
XmlSchemaElement.Form
XmlSchemaElement.IsAbstract
XmlSchemaElement.IsNillable
XmlSchemaElement.Name
XmlSchemaElement.QualifiedName
XmlSchemaElement.RefName
XmlSchemaElement.SchemaType
XmlSchemaElement.SchemaTypeName
XmlSchemaElement.SubstitutionGroup

System.Xml.Schema.XmlSchemaEnumerationFacet class
XmlSchemaEnumerationFacet.XmlSchemaEnumerationFacet

System.Xml.Schema.XmlSchemaException class
XmlSchemaException.XmlSchemaException
[XmlSchemaException Properties]
XmlSchemaException.LineNumber
XmlSchemaException.LinePosition
XmlSchemaException.SourceSchemaObject
XmlSchemaException.SourceUri

System.Xml.Schema.XmlSchemaExternal class
XmlSchemaExternal.XmlSchemaExternal
[XmlSchemaExternal Properties]
XmlSchemaExternal.Id
XmlSchemaExternal.Schema
XmlSchemaExternal.SchemaLocation
XmlSchemaExternal.UnhandledAttributes

System.Xml.Schema.XmlSchemaFacet class
XmlSchemaFacet.XmlSchemaFacet
[XmlSchemaFacet Properties]
XmlSchemaFacet.IsFixed
XmlSchemaFacet.Value

System.Xml.Schema.XmlSchemaForm enumeration

System.Xml.Schema.XmlSchemaFractionDigitsFacet class
XmlSchemaFractionDigitsFacet.XmlSchemaFractionDigitsFacet

System.Xml.Schema.XmlSchemaGroup class
XmlSchemaGroup.XmlSchemaGroup
[XmlSchemaGroup Properties]
XmlSchemaGroup.Name
XmlSchemaGroup.Particle
XmlSchemaGroup.QualifiedName

System.Xml.Schema.XmlSchemaGroupBase class
XmlSchemaGroupBase.XmlSchemaGroupBase
[XmlSchemaGroupBase Properties]
XmlSchemaGroupBase.Items

System.Xml.Schema.XmlSchemaGroupRef class
XmlSchemaGroupRef.XmlSchemaGroupRef
[XmlSchemaGroupRef Properties]
XmlSchemaGroupRef.Particle
XmlSchemaGroupRef.RefName

System.Xml.Schema.XmlSchemaIdentityConstraint class
XmlSchemaIdentityConstraint.XmlSchemaIdentityConstraint
[XmlSchemaIdentityConstraint Properties]
XmlSchemaIdentityConstraint.Fields
XmlSchemaIdentityConstraint.Name
XmlSchemaIdentityConstraint.QualifiedName
XmlSchemaIdentityConstraint.Selector

System.Xml.Schema.XmlSchemaImport class
XmlSchemaImport.XmlSchemaImport
[XmlSchemaImport Properties]
XmlSchemaImport.Annotation
XmlSchemaImport.Namespace

System.Xml.Schema.XmlSchemaInclude class
XmlSchemaInclude.XmlSchemaInclude
[XmlSchemaInclude Properties]
XmlSchemaInclude.Annotation

System.Xml.Schema.XmlSchemaInference class
XmlSchemaInference.XmlSchemaInference
[XmlSchemaInference Methods]
XmlSchemaInference.InferSchema
[XmlSchemaInference Properties]
XmlSchemaInference.Occurrence
XmlSchemaInference.TypeInference

System.Xml.Schema.XmlSchemaInference.InferenceOption enumeration

System.Xml.Schema.XmlSchemaInferenceException class
XmlSchemaInferenceException.XmlSchemaInferenceException

System.Xml.Schema.XmlSchemaInfo class
XmlSchemaInfo.XmlSchemaInfo
[XmlSchemaInfo Properties]
XmlSchemaInfo.ContentType
XmlSchemaInfo.IsDefault
XmlSchemaInfo.IsNil
XmlSchemaInfo.MemberType
XmlSchemaInfo.SchemaAttribute
XmlSchemaInfo.SchemaElement
XmlSchemaInfo.SchemaType
XmlSchemaInfo.Validity

System.Xml.Schema.XmlSchemaKey class
XmlSchemaKey.XmlSchemaKey

System.Xml.Schema.XmlSchemaKeyref class
XmlSchemaKeyref.XmlSchemaKeyref
[XmlSchemaKeyref Properties]
XmlSchemaKeyref.Refer

System.Xml.Schema.XmlSchemaLengthFacet class
XmlSchemaLengthFacet.XmlSchemaLengthFacet

System.Xml.Schema.XmlSchemaMaxExclusiveFacet class
XmlSchemaMaxExclusiveFacet.XmlSchemaMaxExclusiveFacet

System.Xml.Schema.XmlSchemaMaxInclusiveFacet class
XmlSchemaMaxInclusiveFacet.XmlSchemaMaxInclusiveFacet

System.Xml.Schema.XmlSchemaMaxLengthFacet class
XmlSchemaMaxLengthFacet.XmlSchemaMaxLengthFacet

System.Xml.Schema.XmlSchemaMinExclusiveFacet class
XmlSchemaMinExclusiveFacet.XmlSchemaMinExclusiveFacet

System.Xml.Schema.XmlSchemaMinInclusiveFacet class
XmlSchemaMinInclusiveFacet.XmlSchemaMinInclusiveFacet

System.Xml.Schema.XmlSchemaMinLengthFacet class
XmlSchemaMinLengthFacet.XmlSchemaMinLengthFacet

System.Xml.Schema.XmlSchemaNotation class
XmlSchemaNotation.XmlSchemaNotation
[XmlSchemaNotation Properties]
XmlSchemaNotation.Name
XmlSchemaNotation.Public
XmlSchemaNotation.System

System.Xml.Schema.XmlSchemaNumericFacet class
XmlSchemaNumericFacet.XmlSchemaNumericFacet

System.Xml.Schema.XmlSchemaObject class
XmlSchemaObject.XmlSchemaObject
[XmlSchemaObject Properties]
XmlSchemaObject.LineNumber
XmlSchemaObject.LinePosition
XmlSchemaObject.Namespaces
XmlSchemaObject.Parent
XmlSchemaObject.SourceUri

System.Xml.Schema.XmlSchemaObjectCollection class
XmlSchemaObjectCollection.XmlSchemaObjectCollection
[XmlSchemaObjectCollection Methods]
XmlSchemaObjectCollection.Add
XmlSchemaObjectCollection.Contains
XmlSchemaObjectCollection.CopyTo
XmlSchemaObjectCollection.GetEnumerator
XmlSchemaObjectCollection.IndexOf
XmlSchemaObjectCollection.Insert
XmlSchemaObjectCollection.OnClear
XmlSchemaObjectCollection.OnInsert
XmlSchemaObjectCollection.OnRemove
XmlSchemaObjectCollection.OnSet
XmlSchemaObjectCollection.Remove
[XmlSchemaObjectCollection Properties]
XmlSchemaObjectCollection.Item

System.Xml.Schema.XmlSchemaObjectEnumerator class
[XmlSchemaObjectEnumerator Methods]
XmlSchemaObjectEnumerator.MoveNext
XmlSchemaObjectEnumerator.Reset
[XmlSchemaObjectEnumerator Properties]
XmlSchemaObjectEnumerator.Current

System.Xml.Schema.XmlSchemaObjectTable class
[XmlSchemaObjectTable Methods]
XmlSchemaObjectTable.Contains
XmlSchemaObjectTable.GetEnumerator
[XmlSchemaObjectTable Properties]
XmlSchemaObjectTable.Count
XmlSchemaObjectTable.Item
XmlSchemaObjectTable.Names
XmlSchemaObjectTable.Values

System.Xml.Schema.XmlSchemaParticle class
XmlSchemaParticle.XmlSchemaParticle
[XmlSchemaParticle Properties]
XmlSchemaParticle.MaxOccurs
XmlSchemaParticle.MaxOccursString
XmlSchemaParticle.MinOccurs
XmlSchemaParticle.MinOccursString

System.Xml.Schema.XmlSchemaPatternFacet class
XmlSchemaPatternFacet.XmlSchemaPatternFacet

System.Xml.Schema.XmlSchemaRedefine class
XmlSchemaRedefine.XmlSchemaRedefine
[XmlSchemaRedefine Properties]
XmlSchemaRedefine.AttributeGroups
XmlSchemaRedefine.Groups
XmlSchemaRedefine.Items
XmlSchemaRedefine.SchemaTypes

System.Xml.Schema.XmlSchemaSequence class
XmlSchemaSequence.XmlSchemaSequence
[XmlSchemaSequence Properties]
XmlSchemaSequence.Items

System.Xml.Schema.XmlSchemaSet class
XmlSchemaSet.XmlSchemaSet
[XmlSchemaSet Methods]
XmlSchemaSet.Add
XmlSchemaSet.Compile
XmlSchemaSet.Contains
XmlSchemaSet.CopyTo
XmlSchemaSet.Remove
XmlSchemaSet.RemoveRecursive
XmlSchemaSet.Reprocess
XmlSchemaSet.Schemas
[XmlSchemaSet Properties]
XmlSchemaSet.CompilationSettings
XmlSchemaSet.Count
XmlSchemaSet.GlobalAttributes
XmlSchemaSet.GlobalElements
XmlSchemaSet.GlobalTypes
XmlSchemaSet.IsCompiled
XmlSchemaSet.NameTable
XmlSchemaSet.XmlResolver
[XmlSchemaSet Events]
XmlSchemaSet.ValidationEventHandler

System.Xml.Schema.XmlSchemaSimpleContent class
XmlSchemaSimpleContent.XmlSchemaSimpleContent
[XmlSchemaSimpleContent Properties]
XmlSchemaSimpleContent.Content

System.Xml.Schema.XmlSchemaSimpleContentExtension class
XmlSchemaSimpleContentExtension.XmlSchemaSimpleContentExtension
[XmlSchemaSimpleContentExtension Properties]
XmlSchemaSimpleContentExtension.AnyAttribute
XmlSchemaSimpleContentExtension.Attributes
XmlSchemaSimpleContentExtension.BaseTypeName

System.Xml.Schema.XmlSchemaSimpleContentRestriction class
XmlSchemaSimpleContentRestriction.XmlSchemaSimpleContentRestriction
[XmlSchemaSimpleContentRestriction Properties]
XmlSchemaSimpleContentRestriction.AnyAttribute
XmlSchemaSimpleContentRestriction.Attributes
XmlSchemaSimpleContentRestriction.BaseType
XmlSchemaSimpleContentRestriction.BaseTypeName
XmlSchemaSimpleContentRestriction.Facets

System.Xml.Schema.XmlSchemaSimpleType class
XmlSchemaSimpleType.XmlSchemaSimpleType
[XmlSchemaSimpleType Properties]
XmlSchemaSimpleType.Content

System.Xml.Schema.XmlSchemaSimpleTypeContent class
XmlSchemaSimpleTypeContent.XmlSchemaSimpleTypeContent

System.Xml.Schema.XmlSchemaSimpleTypeList class
XmlSchemaSimpleTypeList.XmlSchemaSimpleTypeList
[XmlSchemaSimpleTypeList Properties]
XmlSchemaSimpleTypeList.BaseItemType
XmlSchemaSimpleTypeList.ItemType
XmlSchemaSimpleTypeList.ItemTypeName

System.Xml.Schema.XmlSchemaSimpleTypeRestriction class
XmlSchemaSimpleTypeRestriction.XmlSchemaSimpleTypeRestriction
[XmlSchemaSimpleTypeRestriction Properties]
XmlSchemaSimpleTypeRestriction.BaseType
XmlSchemaSimpleTypeRestriction.BaseTypeName
XmlSchemaSimpleTypeRestriction.Facets

System.Xml.Schema.XmlSchemaSimpleTypeUnion class
XmlSchemaSimpleTypeUnion.XmlSchemaSimpleTypeUnion
[XmlSchemaSimpleTypeUnion Properties]
XmlSchemaSimpleTypeUnion.BaseMemberTypes
XmlSchemaSimpleTypeUnion.BaseTypes
XmlSchemaSimpleTypeUnion.MemberTypes

System.Xml.Schema.XmlSchemaTotalDigitsFacet class
XmlSchemaTotalDigitsFacet.XmlSchemaTotalDigitsFacet

System.Xml.Schema.XmlSchemaType class
XmlSchemaType.XmlSchemaType
[XmlSchemaType Methods]
XmlSchemaType.GetBuiltInComplexType
XmlSchemaType.GetBuiltInSimpleType
XmlSchemaType.IsDerivedFrom
[XmlSchemaType Properties]
XmlSchemaType.BaseSchemaType
XmlSchemaType.BaseXmlSchemaType
XmlSchemaType.Datatype
XmlSchemaType.DerivedBy
XmlSchemaType.Final
XmlSchemaType.FinalResolved
XmlSchemaType.IsMixed
XmlSchemaType.Name
XmlSchemaType.QualifiedName
XmlSchemaType.TypeCode

System.Xml.Schema.XmlSchemaUnique class
XmlSchemaUnique.XmlSchemaUnique

System.Xml.Schema.XmlSchemaUse enumeration

System.Xml.Schema.XmlSchemaValidationException class
XmlSchemaValidationException.XmlSchemaValidationException
[XmlSchemaValidationException Methods]
XmlSchemaValidationException.SetSourceObject
[XmlSchemaValidationException Properties]
XmlSchemaValidationException.SourceObject

System.Xml.Schema.XmlSchemaValidationFlags enumeration

System.Xml.Schema.XmlSchemaValidator class
XmlSchemaValidator.XmlSchemaValidator
[XmlSchemaValidator Methods]
XmlSchemaValidator.AddSchema
XmlSchemaValidator.EndValidation
XmlSchemaValidator.GetExpectedAttributes
XmlSchemaValidator.GetExpectedParticles
XmlSchemaValidator.GetUnspecifiedDefaultAttributes
XmlSchemaValidator.Initialize
XmlSchemaValidator.SkipToEndElement
XmlSchemaValidator.ValidateAttribute
XmlSchemaValidator.ValidateElement
XmlSchemaValidator.ValidateEndElement
XmlSchemaValidator.ValidateEndOfAttributes
XmlSchemaValidator.ValidateText
XmlSchemaValidator.ValidateWhitespace
[XmlSchemaValidator Properties]
XmlSchemaValidator.LineInfoProvider
XmlSchemaValidator.SourceUri
XmlSchemaValidator.ValidationEventSender
XmlSchemaValidator.XmlResolver
[XmlSchemaValidator Events]
XmlSchemaValidator.ValidationEventHandler

System.Xml.Schema.XmlSchemaValidity enumeration

System.Xml.Schema.XmlSchemaWhiteSpaceFacet class
XmlSchemaWhiteSpaceFacet.XmlSchemaWhiteSpaceFacet

System.Xml.Schema.XmlSchemaXPath class
XmlSchemaXPath.XmlSchemaXPath
[XmlSchemaXPath Properties]
XmlSchemaXPath.XPath

System.Xml.Schema.XmlSeverityType enumeration

System.Xml.Schema.XmlTypeCode enumeration

System.Xml.Schema.XmlValueGetter delegate

System.Xml.Serialization namespace

System.Xml.Serialization.IXmlSerializable interface
[IXmlSerializable Methods]
IXmlSerializable.GetSchema
IXmlSerializable.ReadXml
IXmlSerializable.WriteXml

System.Xml.Serialization.IXmlTextParser interface
[IXmlTextParser Properties]
IXmlTextParser.Normalized
IXmlTextParser.WhitespaceHandling

System.Xml.Serialization.SoapAttributeAttribute class
SoapAttributeAttribute.SoapAttributeAttribute
[SoapAttributeAttribute Properties]
SoapAttributeAttribute.AttributeName
SoapAttributeAttribute.DataType
SoapAttributeAttribute.Namespace

System.Xml.Serialization.SoapAttributeOverrides class
SoapAttributeOverrides.SoapAttributeOverrides
[SoapAttributeOverrides Methods]
SoapAttributeOverrides.Add
[SoapAttributeOverrides Properties]
SoapAttributeOverrides.Item
SoapAttributeOverrides.Item

System.Xml.Serialization.SoapAttributes class
SoapAttributes.SoapAttributes
[SoapAttributes Properties]
SoapAttributes.SoapAttribute
SoapAttributes.SoapDefaultValue
SoapAttributes.SoapElement
SoapAttributes.SoapEnum
SoapAttributes.SoapIgnore
SoapAttributes.SoapType

System.Xml.Serialization.SoapElementAttribute class
SoapElementAttribute.SoapElementAttribute
[SoapElementAttribute Properties]
SoapElementAttribute.DataType
SoapElementAttribute.ElementName
SoapElementAttribute.IsNullable

System.Xml.Serialization.SoapEnumAttribute class
SoapEnumAttribute.SoapEnumAttribute
[SoapEnumAttribute Properties]
SoapEnumAttribute.Name

System.Xml.Serialization.SoapIgnoreAttribute class
SoapIgnoreAttribute.SoapIgnoreAttribute

System.Xml.Serialization.SoapIncludeAttribute class
SoapIncludeAttribute.SoapIncludeAttribute
[SoapIncludeAttribute Properties]
SoapIncludeAttribute.Type

System.Xml.Serialization.SoapReflectionImporter class
SoapReflectionImporter.SoapReflectionImporter
[SoapReflectionImporter Methods]
SoapReflectionImporter.ImportTypeMapping
SoapReflectionImporter.IncludeType
SoapReflectionImporter.IncludeTypes

System.Xml.Serialization.SoapTypeAttribute class
SoapTypeAttribute.SoapTypeAttribute
[SoapTypeAttribute Properties]
SoapTypeAttribute.Namespace
SoapTypeAttribute.TypeName

System.Xml.Serialization.UnreferencedObjectEventArgs class
UnreferencedObjectEventArgs.UnreferencedObjectEventArgs
[UnreferencedObjectEventArgs Properties]
UnreferencedObjectEventArgs.UnreferencedId
UnreferencedObjectEventArgs.UnreferencedObject

System.Xml.Serialization.UnreferencedObjectEventHandler delegate

System.Xml.Serialization.XmlAnyAttributeAttribute class
XmlAnyAttributeAttribute.XmlAnyAttributeAttribute

System.Xml.Serialization.XmlAnyElementAttribute class
XmlAnyElementAttribute.XmlAnyElementAttribute
[XmlAnyElementAttribute Properties]
XmlAnyElementAttribute.Name
XmlAnyElementAttribute.Namespace
XmlAnyElementAttribute.Order

System.Xml.Serialization.XmlAnyElementAttributes class
XmlAnyElementAttributes.XmlAnyElementAttributes
[XmlAnyElementAttributes Methods]
XmlAnyElementAttributes.Add
XmlAnyElementAttributes.Contains
XmlAnyElementAttributes.CopyTo
XmlAnyElementAttributes.IndexOf
XmlAnyElementAttributes.Insert
XmlAnyElementAttributes.Remove
[XmlAnyElementAttributes Properties]
XmlAnyElementAttributes.Item

System.Xml.Serialization.XmlArrayAttribute class
XmlArrayAttribute.XmlArrayAttribute
[XmlArrayAttribute Properties]
XmlArrayAttribute.ElementName
XmlArrayAttribute.Form
XmlArrayAttribute.IsNullable
XmlArrayAttribute.Namespace
XmlArrayAttribute.Order

System.Xml.Serialization.XmlArrayItemAttribute class
XmlArrayItemAttribute.XmlArrayItemAttribute
[XmlArrayItemAttribute Properties]
XmlArrayItemAttribute.DataType
XmlArrayItemAttribute.ElementName
XmlArrayItemAttribute.Form
XmlArrayItemAttribute.IsNullable
XmlArrayItemAttribute.IsNullableSpecified
XmlArrayItemAttribute.Namespace
XmlArrayItemAttribute.NestingLevel
XmlArrayItemAttribute.Type

System.Xml.Serialization.XmlArrayItemAttributes class
XmlArrayItemAttributes.XmlArrayItemAttributes
[XmlArrayItemAttributes Methods]
XmlArrayItemAttributes.Add
XmlArrayItemAttributes.Contains
XmlArrayItemAttributes.CopyTo
XmlArrayItemAttributes.IndexOf
XmlArrayItemAttributes.Insert
XmlArrayItemAttributes.Remove
[XmlArrayItemAttributes Properties]
XmlArrayItemAttributes.Item

System.Xml.Serialization.XmlAttributeAttribute class
XmlAttributeAttribute.XmlAttributeAttribute
[XmlAttributeAttribute Properties]
XmlAttributeAttribute.AttributeName
XmlAttributeAttribute.DataType
XmlAttributeAttribute.Form
XmlAttributeAttribute.Namespace
XmlAttributeAttribute.Type

System.Xml.Serialization.XmlAttributeEventArgs class
[XmlAttributeEventArgs Properties]
XmlAttributeEventArgs.Attr
XmlAttributeEventArgs.LineNumber
XmlAttributeEventArgs.LinePosition
XmlAttributeEventArgs.ObjectBeingDeserialized

System.Xml.Serialization.XmlAttributeEventHandler delegate

System.Xml.Serialization.XmlAttributeOverrides class
XmlAttributeOverrides.XmlAttributeOverrides
[XmlAttributeOverrides Methods]
XmlAttributeOverrides.Add
[XmlAttributeOverrides Properties]
XmlAttributeOverrides.Item
XmlAttributeOverrides.Item

System.Xml.Serialization.XmlAttributes class
XmlAttributes.XmlAttributes
[XmlAttributes Properties]
XmlAttributes.XmlAnyAttribute
XmlAttributes.XmlAnyElements
XmlAttributes.XmlArray
XmlAttributes.XmlArrayItems
XmlAttributes.XmlAttribute
XmlAttributes.XmlChoiceIdentifier
XmlAttributes.XmlDefaultValue
XmlAttributes.XmlElements
XmlAttributes.XmlEnum
XmlAttributes.XmlIgnore
XmlAttributes.Xmlns
XmlAttributes.XmlRoot
XmlAttributes.XmlText
XmlAttributes.XmlType

System.Xml.Serialization.XmlChoiceIdentifierAttribute class
XmlChoiceIdentifierAttribute.XmlChoiceIdentifierAttribute
[XmlChoiceIdentifierAttribute Properties]
XmlChoiceIdentifierAttribute.MemberName

System.Xml.Serialization.XmlElementAttribute class
XmlElementAttribute.XmlElementAttribute
[XmlElementAttribute Properties]
XmlElementAttribute.DataType
XmlElementAttribute.ElementName
XmlElementAttribute.Form
XmlElementAttribute.IsNullable
XmlElementAttribute.Namespace
XmlElementAttribute.Order
XmlElementAttribute.Type

System.Xml.Serialization.XmlElementAttributes class
XmlElementAttributes.XmlElementAttributes
[XmlElementAttributes Methods]
XmlElementAttributes.Add
XmlElementAttributes.Contains
XmlElementAttributes.CopyTo
XmlElementAttributes.IndexOf
XmlElementAttributes.Insert
XmlElementAttributes.Remove
[XmlElementAttributes Properties]
XmlElementAttributes.Item

System.Xml.Serialization.XmlElementEventArgs class
[XmlElementEventArgs Properties]
XmlElementEventArgs.Element
XmlElementEventArgs.LineNumber
XmlElementEventArgs.LinePosition
XmlElementEventArgs.ObjectBeingDeserialized

System.Xml.Serialization.XmlElementEventHandler delegate

System.Xml.Serialization.XmlEnumAttribute class
XmlEnumAttribute.XmlEnumAttribute
[XmlEnumAttribute Properties]
XmlEnumAttribute.Name

System.Xml.Serialization.XmlIgnoreAttribute class
XmlIgnoreAttribute.XmlIgnoreAttribute

System.Xml.Serialization.XmlIncludeAttribute class
XmlIncludeAttribute.XmlIncludeAttribute
[XmlIncludeAttribute Properties]
XmlIncludeAttribute.Type

System.Xml.Serialization.XmlMapping class
[XmlMapping Properties]
XmlMapping.ElementName
XmlMapping.Namespace

System.Xml.Serialization.XmlNamespaceDeclarationsAttribute class
XmlNamespaceDeclarationsAttribute.XmlNamespaceDeclarationsAttribute

System.Xml.Serialization.XmlNodeEventArgs class
[XmlNodeEventArgs Properties]
XmlNodeEventArgs.LineNumber
XmlNodeEventArgs.LinePosition
XmlNodeEventArgs.LocalName
XmlNodeEventArgs.Name
XmlNodeEventArgs.NamespaceURI
XmlNodeEventArgs.NodeType
XmlNodeEventArgs.ObjectBeingDeserialized
XmlNodeEventArgs.Text

System.Xml.Serialization.XmlNodeEventHandler delegate

System.Xml.Serialization.XmlReflectionImporter class
XmlReflectionImporter.XmlReflectionImporter
[XmlReflectionImporter Methods]
XmlReflectionImporter.ImportTypeMapping
XmlReflectionImporter.IncludeType
XmlReflectionImporter.IncludeTypes

System.Xml.Serialization.XmlRootAttribute class
XmlRootAttribute.XmlRootAttribute
[XmlRootAttribute Properties]
XmlRootAttribute.DataType
XmlRootAttribute.ElementName
XmlRootAttribute.IsNullable
XmlRootAttribute.IsNullableSpecified
XmlRootAttribute.Namespace

System.Xml.Serialization.XmlSchemaProviderAttribute class
XmlSchemaProviderAttribute.XmlSchemaProviderAttribute
[XmlSchemaProviderAttribute Properties]
XmlSchemaProviderAttribute.MethodName

System.Xml.Serialization.XmlSerializer class
XmlSerializer.XmlSerializer
[XmlSerializer Methods]
XmlSerializer.CanDeserialize
XmlSerializer.Deserialize
XmlSerializer.FromTypes
XmlSerializer.Serialize
[XmlSerializer Events]
XmlSerializer.UnknownAttribute
XmlSerializer.UnknownElement
XmlSerializer.UnknownNode
XmlSerializer.UnreferencedObject

System.Xml.Serialization.XmlSerializerNamespaces class
XmlSerializerNamespaces.XmlSerializerNamespaces
[XmlSerializerNamespaces Methods]
XmlSerializerNamespaces.Add
XmlSerializerNamespaces.ToArray
[XmlSerializerNamespaces Properties]
XmlSerializerNamespaces.Count

System.Xml.Serialization.XmlTextAttribute class
XmlTextAttribute.XmlTextAttribute
[XmlTextAttribute Properties]
XmlTextAttribute.DataType
XmlTextAttribute.Type

System.Xml.Serialization.XmlTypeAttribute class
XmlTypeAttribute.XmlTypeAttribute
[XmlTypeAttribute Properties]
XmlTypeAttribute.AnonymousType
XmlTypeAttribute.IncludeInSchema
XmlTypeAttribute.Namespace
XmlTypeAttribute.TypeName

System.Xml.Serialization.XmlTypeMapping class
[XmlTypeMapping Properties]
XmlTypeMapping.TypeFullName
XmlTypeMapping.TypeName

System.Xml.XPath namespace

System.Xml.XPath.XPathException class
XPathException.XPathException

System.Xml.XPath.XPathItem class
XPathItem.XPathItem
[XPathItem Methods]
XPathItem.ValueAs
[XPathItem Properties]
XPathItem.IsNode
XPathItem.TypedValue
XPathItem.Value
XPathItem.ValueAsBoolean
XPathItem.ValueAsDateTime
XPathItem.ValueAsDouble
XPathItem.ValueAsInt
XPathItem.ValueAsLong
XPathItem.ValueType
XPathItem.XmlType

System.Xml.Xsl namespace

System.Xml.Xsl.XsltException class
XsltException.XsltException
[XsltException Properties]
XsltException.LineNumber
XsltException.LinePosition
XsltException.SourceUri


Additions to the .NET Compact Framework for Xbox 360

Additions to the .NET Compact Framework for Xbox 360

The .NET Compact Framework for Xbox 360 implements a subset of the .NET Compact Framework, and adds the following namespaces, types, or members.

New Methods

SetProcessorAffinity Method

Currently, the .NET Compact Framework for Xbox 360 adds just one more method. It belongs to the System.Threading.Thread class.

The SetProcessorAffinity method sets the processor or hardware thread on which a software thread will execute (the thread's processor affinity). The Xbox 360 has six hardware threads (two on each of three cores). Four of these can be used by applications. SetProcessorAffinity has the following signature:

C#
public void SetProcessorAffinity (
         params int[] cpus
)

Expand image See Also

Concepts

Threading (C# Programming Guide)
Thread Pools in the .NET Compact Framework for Xbox 360

Reference

System.Threading.Thread Members
System.Threading.Thread.SetProcessorAffinity Method


Thread.SetProcessorAffinity Method

Thread.SetProcessorAffinity Method

Sets the processor affinity for a managed thread. Processor affinity determines the processors on which a thread runs.

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)

Expand image Syntax

C#
public void SetProcessorAffinity (
         params int[] cpus
)

Parameters

cpus

An array of identifiers that specify the hardware threads on which the managed thread is permitted to run.

For Xbox 360, only a single hardware thread can be specified—the cpus array should contain only one element. The hardware thread number must be in the range 0 through 5.

XNA Game Studio games should not use hardware threads 0 or 2; see Remarks below.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Either an invalid value was passed to the method or the thread attempting the change was different from the target thread.

Expand image Remarks

Each of the three CPU cores on the Xbox 360 has two hardware threads; the hardware thread number selects a specific hardware thread on a specific core. Hardware threads 0 and 1 are the hardware threads on core 0; 2 and 3 are the hardware threads on core 1; and 4 and 5 are the hardware threads on core 2.

Hardware Thread Number | Core
0 or 1 | 0
2 or 3 | 1
4 or 5 | 2

Xbox 360 software threads are associated with, and run on, only a single hardware thread at a time. The hardware thread on which a thread runs (the thread's processor affinity) must be set to a single hardware thread, but can be subsequently changed by calling SetProcessorAffinity with a different hardware thread number. When a thread is created, it is initially assigned to the current hardware thread (that is, the hardware thread on which the current thread is running).

For Xbox 360 threads, you cannot clear the thread's processor affinity by passing an empty array as the cpus parameter. An Xbox 360 thread will always be associated with one hardware thread.

XNA Game Studio games should not use hardware threads 0 or 2, which are reserved for the XNA Framework. The following table identifies Xbox 360 hardware thread usage.

Hardware Thread | Available
0 | No, reserved for XNA Framework.
1 | Yes
2 | No, reserved for XNA Framework.
3 | Yes
4 | Yes
5 | Yes

To determine the number of hardware threads supported by the hardware, use System.Environment.ProcessorCount.

This method should not be used with threads created by the ThreadPool or Timer classes. It should only be called from the thread whose affinity is being changed.

Expand image See Also

Tasks

How To: Create and Terminate Threads (C# Programming Guide)

Concepts

Threading (C# Programming Guide)
Using Threading (C# Programming Guide)

Reference

Thread Class
Thread Members
System.Threading Namespace
System.Environment.ProcessorCount Method

Expand image Platforms

Xbox 360


Thread Pools in the .NET Compact Framework for Xbox 360

Thread Pools in the .NET Compact Framework for Xbox 360

A thread pool is a collection of threads that can be used to perform background tasks, thus freeing the primary application thread to perform other tasks asynchronously. The .NET Compact Framework for Xbox 360 supports thread pools and portions of the System.Threading.ThreadPool class. Thread pools on the Xbox 360 are slightly different than those on the .NET Framework or .NET Compact Framework.

Xbox 360 Thread Pools

The Xbox 360 CPU has six hardware threads (two on each of three cores). Each one is capable of independently executing a software thread. These hardware threads execute independently. However, the two hardware threads executing on a single core do share some resources, such as the vector unit and L1 cache.

The thread pool distributes the threads it creates evenly among four available hardware threads (two are reserved for system use). The thread pool does not try to determine the activity level of the processors before assigning threads, nor does it try to load-balance existing threads. Once a thread is assigned to a hardware thread, the thread pool will not assign that thread to a different hardware thread.

Maximum Number of Threads

The default maximum number of threads in an Xbox 360 thread pool is 256. When a new task is queued with ThreadPool.QueueUserWorkItem, the thread pool first tries to assign the task to an available thread in the pool. If all threads in the thread pool are busy performing tasks, the thread pool will create a new thread to handle the task, up to the maximum number of threads set for the pool. If no threads are available and the maximum number of threads have already been created, the task is queued until a thread in the pool becomes available.

To specify the maximum number of threads for the pool, use ThreadPool.SetMaxThreads. If the threads in a thread pool do not require much processing time and are cycling their tasks quickly, it may be more efficient to lower the maximum number of threads for the pool (from its default of 256). Doing so reduces the amount of context switching that occurs when a large number of ready threads are being scheduled alternately for execution on the available processors.

Using Threading

Thread pools provide an easy and efficient mechanism of scheduling asynchronous background tasks. To achieve finer control of the number, type, scheduling, and processor affinity of your application's threads, use the System.Threading.Thread class directly. You can use threads created with the Thread class instead of, or together with, thread pools.

For more information on using threading and thread pools in the .NET Framework, see Threading and How To: Use a Thread Pool.

Note
The online MSDN .NET Framework documentation has been updated to show the types and members of the System.Threading namespace that are supported on the Xbox 360. Also see Namespaces and Classes Supported by the .NET Compact Framework for Xbox 360 for information on determining all of the types and members supported by the .NET Compact Framework for Xbox 360.

Expand image See Also

Tasks

How To: Use a Thread Pool (C# Programming Guide)

Concepts

Threading (C# Programming Guide)
Namespaces and Classes Supported by the .NET Compact Framework for Xbox 360

Reference

System.Threading Namespace
ThreadPool Class
ThreadPool.QueueUserWorkItem Method
ThreadPool.SetMaxThreads Method


Language, Locales, and Cultures in the .NET Compact Framework for Xbox 360

Language, Locales, and Cultures in the .NET Compact Framework for Xbox 360
See Also
CollapseAll image

Language and locale support on the Xbox 360 video game and entertainment system differs from that provided by managed culture objects in .NET. The Xbox 360 console language and locale are set by the user, and are independent of each other. For example, the console may be using the German language, but be located in Greece.

Managed culture objects (such as CultureInfo), however, are based on both language and region, where the region is dependent on the language. For example, the German language has only five valid culture regions: Austria, Germany, Liechtenstein, Luxembourg, and Switzerland.

In the .NET Compact Framework for Xbox 360, the CultureInfo returned for CurrentCulture and CurrentUICulture is based primarily on the console's current language, not its locale. Only if the locale matches one of a subset of regions for the current language will the locale secondarily affect the returned culture.

For example, if the console's language is German, the culture returned by CurrentCulture will be:

  • 'de-AT' (German - Austria) if the console's locale is Austria,
  • 'de-CH' (German - Switzerland) if the console's locale is Switzerland, and
  • 'de-DE' (German - Germany) for all other locales, including locales that are valid for German (Germany, Liechtenstein, and Luxembourg) and those that are not (Greece, Korea, and India, for example).

Due to these differences, it is important to use static CultureInfo objects (rather than those returned by CurrentCulture) when displaying data from RegionInfo objects or non-Gregorian calendars. If you do not use static CultureInfo objects, note that locale mapping differences may produce unexpected or undesirable results. For example:

  • If the console language is set to Traditional Chinese, and the locale is set to China, CurrentCulture and CurrentUICulture return the culture 'zh-TW' (Chinese - Taiwan).

  • If the console language is set to Simplified Chinese, and the locale is set to Taiwan, CurrentCulture and CurrentUICulture return the culture 'zh-CN' (Chinese - China).

    Important
    Whether it is Traditional Chinese or Simplified Chinese, the console language, not the locale, determines the returned culture.

XNA developers must also be aware of locale mapping differences that can affect application development when they develop for Xbox 360 instead of Windows-based game machines. For example, the behavior of many managed functions, such as ToUpper, can vary based on the value of CurrentCulture and CurrentUICulture.

The following table shows the culture returned by CurrentCulture and CurrentUICulture based on the console's language and locale setting. A default culture is returned when the console's locale doesn't match a region supported for the console's language.

Console Language | Console Locale | Culture
Chinese (Simplified) | China | zh-CN (Chinese - China)
 | Singapore | zh-SG (Chinese - Singapore)
 | (all others) | zh-CN (Chinese - China)
Chinese (Traditional) | Hong Kong SAR | zh-HK (Chinese - Hong Kong SAR)
 | Taiwan | zh-TW (Chinese - Taiwan)
 | (all others) | zh-TW (Chinese - Taiwan)
English | Australia | en-AU (English - Australia)
 | Canada | en-CA (English - Canada)
 | Great Britain | en-GB (English - Great Britain)
 | Ireland | en-IE (English - Ireland)
 | New Zealand | en-NZ (English - New Zealand)
 | South Africa | en-ZA (English - South Africa)
 | United States | en-US (English - United States)
 | (all others) | en-US (English - United States)
French | Belgium | fr-BE (French - Belgium)
 | Canada | fr-CA (French - Canada)
 | France | fr-FR (French - France)
 | Switzerland | fr-CH (French - Switzerland)
 | (all others) | fr-FR (French - France)
German | Austria | de-AT (German - Austria)
 | Germany | de-DE (German - Germany)
 | Switzerland | de-CH (German - Switzerland)
 | (all others) | de-DE (German - Germany)
Italian | Italy | it-IT (Italian - Italy)
 | Switzerland | it-CH (Italian - Switzerland)
 | (all others) | it-IT (Italian - Italy)
Japanese | Japan | ja-JP (Japanese - Japan)
 | (all others) | ja-JP (Japanese - Japan)
Korean | Korea | ko-KR (Korean - Korea)
 | (all others) | ko-KR (Korean - Korea)
Polish | Poland | pl-PL (Polish - Poland)
 | (all others) | pl-PL (Polish - Poland)
Portuguese | Brazil | pt-BR (Portuguese - Brazil)
 | Portugal | pt-PT (Portuguese - Portugal)
 | (all others) | pt-BR (Portuguese - Brazil)
Russian | Russia | ru-RU (Russian - Russia)
 | (all others) | ru-RU (Russian - Russia)
Spanish | Chile | es-CL (Spanish - Chile)
 | Colombia | es-CO (Spanish - Colombia)
 | Mexico | es-MX (Spanish - Mexico)
 | Spain | es-ES (Spanish - Spain)
 | (all others) | es-ES (Spanish - Spain)

Expand image See Also

Concepts

Performing Culture-Insensitive Case Changes
Performing Culture-Insensitive String Operations

Reference

CultureInfo
CurrentCulture
CurrentUICulture


XNA Framework Remote Performance Monitor for Xbox 360

XNA Framework Remote Performance Monitor for Xbox 360

The XNA Framework Remote Performance Monitor for Xbox 360 is a performance analysis tool that provides run-time performance data for XNA Game Studio applications. You can monitor the data while you run the application. Also, you can use the Windows Performance Monitor (PerfMon.exe) to view the data.

In This Section

How to: Monitor Performance at Run Time (Xbox 360)
Describes performance monitoring with the XNA Framework Remote Performance Monitor for Xbox 360.
Performance Counters in the XNA Framework
Describes the performance counters used by the XNA Framework Remote Performance Monitor for Xbox 360.
How to: Generate a Garbage Collector Heap Dump
Explains how to generate a heap dump using the XNA Framework Remote Performance Monitor for Xbox 360.
Heap Dump File Information
Describes the information contained in heap dump files created by the XNA Framework Remote Performance Monitor for Xbox 360.


How to: Monitor Performance at Run Time (Xbox 360)

How to: Monitor Performance at Run Time (Xbox 360)
See Also
CollapseAll image

Describes performance monitoring with the XNA Framework Remote Performance Monitor for Xbox 360.

The XNA Framework Remote Performance Monitor for Xbox 360 is a performance analysis tool included with the XNA Framework. This tool provides a user interface that lets you view performance data at application run time. When you start your application from Remote Performance Monitor, the tool reads statistical data for the XNA Framework performance counters directly from the common language runtime (CLR).

You can also view XNA Framework performance counters using the Windows desktop tool, PerfMon.exe. Using Remote Performance Monitor in combination with PerfMon.exe gives you a live, graphical view of the performance counter data generated by the CLR.

With the Remote Performance Monitor you can:

  • View performance counter data while you run an application.

  • View performance counter data in a graphical format in PerfMon.exe while you run an application.

  • View garbage collector heap dumps. For more information, see How to: Generate a Garbage Collector Heap Dump.

  • View .stat files.

For a list of available performance counters, see Performance Counters in the XNA Framework.

Using XNA Framework Remote Performance Monitor for Xbox 360

Note
Before you use Remote Performance Monitor, you must configure your Xbox 360 console to communicate with XNA Game Studio on your desktop computer. See Configuring XNA Game Studio and Your Xbox 360 Console.

To run an application from Remote Performance Monitor

  1. On the Xbox 360 console, start XNA Game Studio Connect, and then select Launch.

  2. On your desktop computer, click Start, point to All Programs, select Microsoft XNA Game Studio 4.0, point to Tools, and then click XNA Framework Remote Performance Monitor for Xbox 360.

  3. Click the Launch Application icon, which is the green arrow on the toolbar.

  4. In the Device list, click the Xbox device to which you are connected.

  5. In the Application text box, enter the game's name.

    The name is set in Project | Properties | Application | Assembly Information | Title. This is the name of the game displayed in XNA Game Studio Connect.

  6. In the Arguments text box, enter any command-line arguments for the application.

  7. Verify that the application is not currently running on the device, and that the XNA Game Studio Connect screen is visible.

  8. Click OK.

    Remote Performance Monitor starts the application and displays performance data.

To use PerfMon.exe with Remote Performance Monitor

  1. On your desktop computer, click Start, point to All Programs, select Microsoft XNA Game Studio 4.0, point to Tools, and then click XNA Framework Remote Performance Monitor for Xbox 360.

    Caution
    If you are using this tool under Windows Vista, you must run the tool with administrator privileges.

  2. On the Options menu, click Publish to Perfmon.

  3. Start an application from Remote Performance Monitor using the previous procedure.

  4. Start PerfMon.exe.

    This file is located in \Windows\System32.

  5. In the left pane of PerfMon.exe, click Performance Monitor if it is not already selected.

  6. Right-click in the right pane of PerfMon.exe, and then click Add Counters.

  7. In the Performance Object list, select the counter group name (or expand the group and select a single counter) that you want to graph in PerfMon.exe.

    The group names correspond to the categories that appear when you view statistical data in Remote Performance Monitor. For example, the garbage collection group is called "Xbox 360 GC" in PerfMon.exe.

  8. Click Add.

To save performance data

  1. Start an application from Remote Performance Monitor.

  2. Start PerfMon.exe, and then graph performance data.

  3. On the Performance Monitor graph window, right-click, and then select Save Settings As.

  4. Type a name for the file, and specify the folder in which to save the file.

    The file is saved with a .htm extension. Use Internet Explorer or Remote Performance Monitor to open and view the generated .htm file.

Expand image See Also

Concepts

Performance Counters in the XNA Framework
How to: Generate a Garbage Collector Heap Dump


Performance Counters in the XNA Framework

Performance Counters in the XNA Framework

The XNA Framework contains a set of predefined performance counters for analyzing the types of load your application has on the XNA Framework. The counters are not extensible.

You can generate performance statistics about your application at run time. See How to: Monitor Performance at Run Time (Xbox 360) for the procedure.

The performance counters are useful for understanding the impact of garbage collection and just-in-time (JIT) compilation on application performance. From these statistics, you can determine where optimizations should occur.

The statistics file lists performance counters with the following columns.

Column | Description
Total | Summation of occurrences
Last Datum | The last piece of information
N | The number of occurrences
Mean | The intermediate between other values
Min | The minimum value
Max | The maximum value

XNA Framework Counters

Performance counters fall into the following categories.

  • Loader
  • Generics
  • Locks and threads
  • Garbage collection
  • JIT compilation
  • Exceptions

Loader Counters

The following counters pertain to the portion of the common language runtime (CLR) that is responsible for resolving and loading components that are referenced by your application, such as assemblies and classes.

Name | Description
Total Program Run Time (ms) | The elapsed time, in milliseconds, from CLR invocation.
App Domains Created | The number of application domains created in the application's process.
App Domains Unloaded | The number of application domains that have been unloaded during the run time of the application.
Assemblies Loaded | The number of assemblies that have been loaded across all application domains for the application.
Classes Loaded | The number of classes that have been loaded across all application domains during the run time of the application.
Methods Loaded | The total number of methods loaded across all application domains during the run time of the application.

Generics Counters

The generics counters are loader counters that are specific to the generics feature of the XNA Framework. The CLR uses generics internally. Consequently, you might see values in these counters even if your application does not use generics explicitly.

Name Description
Closed Types Loaded

The count of unique generic types that have been loaded across all application domains.

A closed type is a generic class that has been bound with a specific data type. For example, an instance of MyGenericType<Int32> is a closed type.
Closed Types Loaded per Definition

The maximum number of unique generic types created for a given definition across all application domains.

For example, if an application instantiates MyGenericType<Int32>, MyGenericType<String>, and MyGenericType<Single>, the number of closed types loaded for the MyGenericType<T> definition is three (3).

A large number (several hundred or more) in the Max column can indicate working-set pressure in terms of JIT-compiled code and CLR data structures.
Open Types Loaded

The count of open generic types created across all application domains.

An open type is a generic class that has been loaded, but has not been bound with a specific data type. Open types are typically created only in reflection scenarios.

For example, loading an instance of MyGenericType<T> by using reflection will increment the Open Types Loaded counter. When the type has been bound, such as in MyGenericType<Single>, it becomes a closed type and the Closed Types Loaded counter is incremented. The XNA Framework CLR uses reflection internally and can be the source of the open types. For example, Xml serialization and Web services use reflection internally.
Closed Methods Loaded

The count of unique generic methods that have been loaded across all application domains.

A closed method is a generic method that has been bound with a specific data type. The type that contains the method may or may not be a generic type. For example, an instance of MyType.ProcessData<Int32>() is a closed method.
Closed Methods Loaded per Definition

The maximum number of unique generic methods created for a given definition across all application domains.

This counter is similar to the Closed Types Loaded per Definition counter. Using the following instances of MyType.ProcessData<Int32>(), MyType.ProcessData<String>(), and MyType.ProcessData<Single>() will create three closed methods for the MyType.ProcessData<T>() definition.
Open Methods Loaded

The count of open generic methods created across all application domains. Open methods are typically created only in reflection scenarios. An open method is a generic method that has been loaded, but is not bound to a specific type.

The XNA Framework runtime uses reflection internally and can be the source of the open methods.

Locks and Threads Counters

The following counters pertain to threading, locks, timers, and thread pools. These counters can help identify threading-related performance issues by providing data on thread, timer, and lock usage during the run time of your application.

Name | Description
Threads in Thread Pool | The number of threads currently in the thread pool. This counter counts the threads that are started by using the System.Threading.ThreadPool.QueueUserWorkItem method. This counter does not include threads that are started by using the System.Threading.Thread.Start method.
Pending Timers | The number of timers currently queued.
Scheduled Timers | The number of timers that are currently running or scheduled to run.
Timers Delayed by Thread Pool Limit | The number of timers that have been delayed by the thread pool limit.
Work Items Queued | The number of work items queued to the thread pool.
Uncontested Monitor.Enter Calls | Number of calls made to the System.Threading.Monitor.Enter method that were not contested.
Contested Monitor.Enter Calls | Number of calls made to Monitor.Enter that were contested. In multi-threaded applications, if Thread1 is holding a lock and Thread2 needs to access code that is guarded by the lock, the Contested Monitor.Enter Calls counter is incremented.

Garbage Collection Counters

The following counters pertain to garbage collection operations.

Name | Description
Peak Bytes Allocated (native + managed) | The maximum number of bytes in use by the CLR, including both native and managed memory.
Managed Objects Allocated | The count of objects allocated by the garbage collector.
Unused Managed Objects Allocated | The count of objects allocated that were never used.
Managed Bytes Allocated | The count of bytes allocated by the garbage collector.
Unused Managed Bytes Allocated | The count of bytes allocated that were never used.
Managed String Objects Allocated | The number of managed string objects allocated by the garbage collector.
Bytes of String Objects Allocated | The count of bytes of string objects allocated by the garbage collector.
Garbage Collections (GC) | The number of times the garbage collector has run.
Bytes Collected by GC | The count of bytes collected by the garbage collector.
Managed Bytes in Use After GC | The number of bytes allocated to live objects after the last garbage collection.
Total Bytes in Use After GC | The number of bytes of memory, native and managed, in use after the last garbage collection.
GC Compactions | The number of times the garbage collector has compacted the heap.
Code Pitchings | The number of times the garbage collector has discarded JIT-compiled code.
Calls to GC.Collect | The number of times the application has called the System.GC.Collect method.
GC Latency Time (ms)

The total time, in milliseconds, that the garbage collector has taken to collect objects and compact the heap.

The latency time of the garbage collector includes the time to collect managed objects that are no longer in scope and the compaction time, if necessary, of the GC Heap.
Pinned Objects

The count of pinned objects encountered while performing a garbage collection.

Pinned objects are objects whose locations in memory cannot change. For example, a memory buffer that is being used to communicate between managed and unmanaged code is a pinned object. Pinned objects cannot be moved by the garbage collector during heap compaction.
Objects Moved by Compactor | The count of objects moved by the garbage collector during a compaction.
Objects Not Moved by Compactor

The count of the objects that were not moved by the garbage collector during a compaction.

Objects might not be moved for a number of reasons. Some objects cannot be moved, but these objects are rare. Other objects are not moved because they are in a portion of the heap that does not need to be compacted.
Objects Finalized | The count of objects for which a finalizer has been run.
Boxed Value Types | The number of value types that have been boxed.

JIT Counters

The following counters pertain to JIT compiler operations.

Name | Description
Native Bytes Compiled JIT | The count of bytes of native code generated by the JIT compiler.
Methods Compiled JIT | The count of methods generated by the JIT compiler.
Bytes Pitched | The count of bytes of native code generated by the JIT compiler that has been discarded.
Methods Pitched | The count of methods generated by the JIT compiler that have been discarded. Unless your application was moved to the background during its run time, any positive value for the Methods Pitched counter indicates that the application ran under memory pressure.
Method Pitch Latency Time (ms) | The total time, in milliseconds, spent discarding methods generated by the JIT compiler.

Exceptions Counters

The following counters pertain to exceptions.

Name | Description
Exceptions Thrown | The count of managed exceptions that have been thrown. Because throwing an exception consumes significant resources, tracking the number of exceptions thrown by your application can help identify potential design issues.

Expand image See Also

Concepts

How to: Monitor Performance at Run Time (Xbox 360)
Garbage Collection
Automatic Memory Management

Reference

System.Threading.Thread Class
System.Threading.ThreadPool.QueueUserWorkItem Method
System.Threading.Thread.Start Method
System.Threading.Monitor.Enter Method
System.GC.Collect Method


How to: Generate a Garbage Collector Heap Dump

How to: Generate a Garbage Collector Heap Dump

Explains how to generate a heap dump using the XNA Framework Remote Performance Monitor for Xbox 360.

Introduction

To help diagnose memory leaks related to objects that are kept alive inappropriately, the XNA Framework includes a remote heap dump utility. The heap dump utility is integrated with Remote Performance Monitor. Because of this, you can view the heap dump while you are running the monitor.

XNA Framework applications can experience memory leaks, although the garbage collector mitigates this issue by releasing objects that are no longer referenced.

The garbage collector walks the application roots to identify storage locations for objects on the managed heap that are no longer needed. The term object root refers to the object's associated application root, such as a global or static object pointer. The garbage collector will not release any object that is kept alive by a root, even if the application does not need the object any longer. For example, an object might be rooted by a static variable. Because static variables live for the life of the process, unless they are explicitly set to null, the objects they reference will be kept alive as long as the process is alive.

Viewing the heap dump provides the following information about the heap.

  • Garbage collector heap statistics

  • Root of each object in the heap

  • Object references for each object in the heap

This topic describes how to view, save, open, and compare heap dumps.

Generating a Garbage Collector Heap Dump

To view a heap dump

  1. Start Remote Performance Monitor.

  2. Attach it to a process.

    For more information, see How to: Monitor Performance at Run Time (Xbox 360).

  3. In the Live Counters window, click View GC Heap.

    This generates a heap dump in Remote Performance Monitor. The main view of the heap provides general statistics, a tree view of each object and its root, and a table that contains the number of instances of each type together with its cumulative size. By default, only types that are defined by the application are shown in the view. No .NET Compact Framework class library types are shown in the view.

  4. Select the check boxes that correspond to the specific types that you want to see in the heap view.

  5. Click Refresh Tree to update the view.

    You can use this updated view to determine the root that keeps a particular object instance alive.

  6. If you want to view object references for an object in the heap, either right-click the object and click View Object References, or on the File menu, click View Object References.

    The object references appear in a new window.

To save a heap dump

  • Save the current heap dump when you close the view of the current heap dump and you are prompted to save.

To open a previously saved heap dump

  1. Start Remote Performance Monitor.

  2. On the File menu, click Open GC log, and select a previously saved heap dump file.

To compare heap dumps

  1. Start Remote Performance Monitor.

  2. In the Live Counters window, click View GC Heap multiple times to generate heap dumps for comparison.

    You can also open previously saved heap dumps to include in the comparison.

  3. On the View menu, click Compare Heap.

    This generates a table view of all heaps that are currently open. Each column represents a heap, with the oldest heap appearing first and the most recent heap appearing last. Each row in the column displays the number of instances of the specified type contained in the heap. If this number differs from the previous heap, the difference is shown in parentheses. For example, an entry of 152(+90) indicates that the specified object had 90 more instances than it had in the previous heap.

Expand image See Also

Concepts

How to: Monitor Performance at Run Time (Xbox 360)
Heap Dump File Information


Heap Dump File Information

Heap Dump File Information

Introduction

Garbage collector heap dump files are text files that include information for every object present in the garbage collector heap at the time the dump is generated. The XNA Framework Remote Performance Monitor for Xbox 360 creates the heap dumps. For more information about generating heap dumps, see How to: Generate a Garbage Collector Heap Dump.

Heap Dump File Records

Each line in the heap dump text file contains one record. The five types of records in the file are as follows.

  • AppDomain record – identifies the application domain to which the dump file applies.
  • Type record – describes a type that is present in the heap.
  • Object record – describes an instance of a type that is present in the heap.
  • Root record – describes a root instance.
  • End AppDomain record – marks the end of the dump file.

Each record contains several elements separated by spaces. The first element in each line indicates the record type. The following example shows a section of a dump file.

Note
This example is intended to show the format of the file, and may not be semantically accurate.
a 2 bubblecs.exe 763f9d2
t 2 System.RuntimeType
o 7c79f 2 64
t 1 System.NullReferenceException
o 7cb42 2 64
o 1ce004 1 18
t 3 System.OutOfMemoryException
o 1ce056 1d 118 1ce11f 1ce14c 1ce079 1ce113 1ce116 1ce267 1ce26a 1ce26d
r 22c81b 5 0
o 22c81e 1b 24
r 22c81e 5 0
o 22c823 1b 28
r 22c823 5 0
c bubblecs.exe 763fbef

AppDomain Record

An AppDomain record marks the beginning of a file section that pertains to a particular application domain. All the type, object, and root information for the garbage collector heap for that application domain is included in this section of the file. All AppDomain records close with a corresponding End AppDomain record.

The AppDomain record has four elements.

  • Letter "a" – identifies the record as an AppDomain record.
  • Version number – number used to track the file format of the dump file. For example, in the .NET Compact Framework version 2.0 Service Pack 2, this number is always "2".
  • AppDomain name – name of the application domain used to generate the heap dump file. This is typically the name of the executable that ran in the application domain.
  • Time stamp – time that the log data was generated. This value shows the number of milliseconds, represented as a hex value, since the device booted.

The following example shows an AppDomain record.

a 2 HH3.exe 763f9d2

Type Record

Type records identify types in the garbage collector heap. Each Type record contains three elements.

  • Letter "t" – identifies the record as a Type record.

  • Type ID – unique numeric identifier for the type. This identifier ties object instances to their types. (See the description of Object records in the next section.)

    Note
    The type ID is not guaranteed to be unique across dump files. For example, the identifier for the "CorporateContacts" type in the following example is not guaranteed to be "a1" in a different dump that is taken from the same application at a different point in time.
  • Type name – fully qualified name of the type.

The following example shows a Type record.

t a1 com.PBSG.WATS.HH3.Biz.Entity.CorporateContacts

Object Record

Object records describe specific instances of types in the garbage collector heap. Object records have a variable number of elements.

The first four elements are required, and are as follows.

  • Letter "o" – identifies the record as an Object record.

  • Object ID – unique numeric identifier for the object.

    Note
    Object identifiers are not guaranteed to be unique across dump files. Because object identifiers can change in different dumps of the same heap, it is not possible to develop tools that identify trends across dump files.
  • Type ID – identifier for the type of the object.
  • Object size – size, in bytes, of the object instance.

In addition to the four required elements, Object records may have a variable number of the following element.

  • Referenced object IDs – identifies other objects that the object references.

The Type record that corresponds to a particular Object record is not guaranteed to precede the Object record in the dump file.

The following example shows an Object record with three referenced object IDs.

o 1ce056 1d 118 1ce11f 1ce14c 1ce079

Root Record

Root records identify garbage collector roots.

Each Root record contains four required elements.

  • Letter "r" – identifies the record as a root record.
  • Object ID – identifier of the root object.

  • Root descriptor – explains why the object instance is classified as a root.

    The following table shows the possible values for the descriptor.

    Value | Definition
    0 | The object instance is rooted internally by the .NET Compact Framework. For example, this includes object instances for application domains, assemblies, exceptions, and so forth.
    1 | The object instance is a local variable.
    2 | The object instance is on the finalizer queue waiting for its finalizer to run. After the finalizer runs, the object will be collected during the next garbage collection.
    3 | A garbage collector handle (that is, a GCHandle) exists that refers to the object instance.
    4 | The object instance is a static variable.
    5 | The object instance is a root that is specific to the garbage collection implementation in the .NET Compact Framework. For example, this includes interned strings and class descriptions.

  • Root flag – flags that provide more information about the root.

    The following table shows the possible flags.

    Flag | Definition
    0 | Normal root. This value is applied to the root if none of the other flags apply.
    1

    The root is pinned. A root can be pinned for the following reasons.

    • It refers to managed objects that are passed to native code through platform invoke.
    • It is referenced by a GCHandle that is created with a GCHandleType of Pinned.
    • A pointer in unsafe code points to the object.
    • A value type field within the object is referenced directly by a method argument.
    2 | A GCHandle whose GCHandleType is Weak refers to the object.
    4 | The object is pointed to by a pointer in unsafe code or is referenced by a value type field inside another object.

If the root descriptor is static (4), the root record will have an additional element.

  • Root container – identifier of the type that contains the static variable.

The following example shows a root record with an additional root container element.

r b2753 4 0 13c

End AppDomain Record

End AppDomain records close the section that is initiated by a corresponding AppDomain record.

End AppDomain records have three elements.

  • Letter "c" – identifies the record as an End AppDomain record.
  • Application name – name of the application from which the dump file was generated. This name matches the name in the AppDomain record at the beginning of the file.
  • Time stamp – time that the log data was completed. This value shows the number of milliseconds, represented as a hex value, since the device booted.

The following example shows an End AppDomain record.

c HH3.exe 763fbef

Expand image See Also

Tasks

How to: Monitor Performance at Run Time (Xbox 360)
How to: Generate a Garbage Collector Heap Dump

Reference

GCHandle
GCHandleType


Developing Windows Phone Games

Developing Windows Phone Games

This section discusses how to use the XNA Game Studio environment to develop Windows Phone games.

In This Section

Creating a Windows Phone Game or Library Project
Describes how XNA Game Studio includes a set of project templates that will help you to develop game projects for Windows Phone using the XNA Framework.
Deploying a Windows Phone Game
Describes how XNA Game Studio can copy executable and media files to a Windows Phone emulator or device once you are ready to deploy them.
Debugging a Windows Phone Game
Discusses issues that apply to debugging Windows Phone games on your retail console.
Using the Windows Phone Emulator
Describes how the Windows Phone emulator can be used with XNA Game Studio.
Troubleshooting Windows Phone Deployment
Provides some helpful troubleshooting tips for Windows Phone deployment if you are unable to establish a successful connection between your computer and your Windows Phone device.
Migrating from Zune to Windows Phone
Discusses how to migrate games written for Zune and Zune HD on XNA Game Studio 3.1 to Windows Phone with XNA Game Studio 4.0.
Windows Phone Programming
Provides topics that are specific to programming games on Windows Phone.


Creating a Windows Phone Game or Library Project

Creating a Windows Phone Game or Library Project

Describes how XNA Game Studio includes a set of project templates that will help you to develop game projects for Windows Phone using the XNA Framework.
Note

The Windows Phone project templates for XNA Game Studio 4.0 are available only after the Microsoft Windows Phone Developer Tools has been installed.

Starting a New Project

To start a new project

  • To begin a new Windows Phone project, click File, and then click New Project.

    You’ll be presented with a dialog that lists a number of project templates.

XNA Game Studio provides template types for XNA Framework game development in the XNA Game Studio 4.0 section of the Visual C# project types. The templates offered for developing XNA Framework games for Windows Phone are:

  • Windows Phone Game (4.0)—A project for creating an XNA Framework 4.0 game application for Windows Phone.
  • Windows Phone Game Library (4.0)—A project for creating an XNA Framework 4.0 game library for Windows Phone.
  • Content Pipeline Extension Library (4.0)—A project for creating an XNA Framework 4.0 Content Pipeline Extension Library. For more information, see Creating a Windows Game or Library Project.

For information about XNA Game Studio project templates for Windows or Xbox 360, see Creating a Windows Game or Library Project and Creating an Xbox 360 Game or Library Project.

Windows Phone Game (4.0)

XNA Game Studio provides a Windows Phone Game template that creates and loads a set of starter files. This new project contains basic code that renders a colored background.

To create a Windows Phone Game (4.0) project

  1. From the File menu, click New Project.

  2. Select the Windows Phone Game (4.0) project type.

  3. Type the name for the game project in the Name text box.

    You can also modify the default values for the Location and Solution Name controls.

  4. Click OK to create and load the new project.

Results

The new starter project contains the following important features.

References

References to the following assemblies are added automatically to a new Windows Phone Game project:

  • Microsoft.Xna.Framework
  • Microsoft.Xna.Framework.Game
  • Microsoft.Xna.Framework.GamerServices
  • Microsoft.Xna.Framework.Graphics
  • mscorlib
  • System
  • System.Core
  • System.Xml
  • System.Xml.Linq

In addition to these standard assemblies, you can add other assemblies as needed for your project.

Windows Phone Game Library (4.0)

XNA Game Studio provides a Windows Phone Game Library (4.0) template that creates and loads a set of starter files. Typically, projects of this type contain managed classes that implement basic or advanced features used by a game engine. Once completed, these class libraries can be referenced by other Windows Phone projects. Also, they provide common functionality without having that code reside within the game project.

The new project contains basic code that implements an empty library, usable by other Windows Phone Game projects or Windows Phone Game libraries.

Results

The new starter project contains the following important features.

Project Properties

These properties control many aspects of your current project. Some examples include general application settings, debug settings, and additional project resources. You can use the Project Designer to modify the values for these properties.

In addition to these properties, assembly information (such as the library title) is stored in the AssemblyInfo.cs file. You can use the Assembly Information dialog box to modify this information, or you can manually edit the .cs file.

References

References to the following assemblies are added automatically to a new Windows Phone Game Library project:

  • Microsoft.Xna.Framework
  • Microsoft.Xna.Framework.Game
  • Microsoft.Xna.Framework.GamerServices
  • Microsoft.Xna.Framework.Graphics
  • mscorlib
  • System
  • System.Core
  • System.Xml
  • System.Xml.Linq

In addition to these standard assemblies, you can add other assemblies as needed for your project.

Content

The nested Content project stores and builds content that is to be included in the game library. This is useful for including reusable content assets that support the classes and methods in the game library. For more information, see Game Content Project.

Class1.cs File

This file implements an empty C# class within a namespace. It provides a starting point for the class library.

To create a Windows Phone Game Library (4.0) project

  1. From the File menu, click New Project.

  2. Select the Windows Phone Game Library (4.0) project type.

  3. Type the name for the library project in the Name text box.

    You can also modify the default values for the Location and Solution Name controls.

  4. Click OK to create and load the new project.

Expand image See Also

Developing Xbox 360 Games
Creating a Windows Game or Library Project
Sharing Your Game Package


Deploying a Windows Phone Game

Deploying a Windows Phone Game

Describes how XNA Game Studio can copy executable and media files to a Windows Phone emulator or device once you are ready to deploy them. As you develop your Windows Phone game, it is convenient to be able to deploy your game executable to an emulator or your device for testing purposes.

Selecting a Windows Phone Device or Emulator

The active Windows Phone device or emulator for deployment is selected through the XNA Game Studio Device Management toolbar.

Figure 1. Windows Phone selections in the XNA Game Studio Device Management toolbar

If the toolbar is not visible, on the View menu, click Toolbar, and then select XNA Game Studio Device Management.

Note
The default is the first listed Windows Phone emulator. At this time, the default device cannot be changed.

Deploying Your Game

This procedure shows you how to deploy your Windows Phone game from XNA Game Studio to a Windows Phone emulator or device. This assumes you already have a connection between that device and your computer.

To deploy your Windows Phone game

  1. Ensure there is a connection between the device and your computer.

  2. Load a Windows Phone Game project into XNA Game Studio

  3. On the View menu, click Output, or press CTRL+W, and then press the letter O on the keyboard.

    Best Practice
    Ensure the Output window is visible so you can follow the progress of your deployment in detail. If a problem occurs, this information will help you to determine its likely source.

  4. In XNA Game Studio, deploy the game.

    • Right-click the solution name, and then select Deploy Solution.

    Or

    • On the Build menu, select Deploy Solution.

    During this process, the Output window shows the deployment progress. You can view a list of the deployed files and some additional information.

    Tip
    To build, deploy and run your game without debugging, press CTRL+F5.
  5. Start the game from the application list on the device.

Incremental Deployment

When enabled, incremental deployment permits XNA Game Studio to track which files have already been deployed to the device. In subsequent deployments, XNA Game Studio transfers only the files that have changed, or delete files from the device that are no longer part of the project. This limits the time required to redeploy your game to the device.

Note
Incremental deployment for Windows Phone games is not supported in this release of XNA Game Studio 4.0.

Cleaning the Solution Before You Build

Cleaning your game solution before you build removes all intermediate and output files generated by the build. This forces the next build to regenerate everything.

If you select Rebuild on the Build menu, the build automatically regenerates everything. However, you may also want to clean your solution before doing a build. This is particularly true if there are unexpected build errors.

In Microsoft Visual C# Express Edition, the Clean Solution option is not included in the Build menu by default. However, it is easy to add if you want to make cleaning your solution convenient.

To add the Clean Solution option

  1. In XNA Game Studio, right-click the menu or toolbar at the top of the window, and then click Customize.

  2. In the Customize dialog box, click on the Build menu (or on any other menu where you want to add the command).

    This opens the menu, and leaves it open.

  3. In the Customize dialog box, click the Commands tab, and then select Build from the Categories pane on the left.

  4. In the Commands pane on the right, drag the Clean Solution command into the open Build menu, and drop it where you want it.

  5. Close the dialog box.

Now, whenever you want to clean the solution, just click Clean Solution from the menu where you added it.


Debugging a Windows Phone Game

Debugging a Windows Phone Game

Discusses issues that apply to debugging Windows Phone games on your retail console.

The following features are unavailable when debugging a Windows Phone game with XNA Game Studio:

Feature | Description
Interop Debugging | Debug both managed and native code simultaneously.
Assembly Debugging | Debug only your assemblies and not system assemblies.
Edit and Continue | Edit the binary content of your game without interrupting your debugging session.
Exception Interrupting | Stop unhandled exceptions before they unwind so the user can make changes and retry the operation.
Debugger Visualizers | Display a more informative view of a specific data type, such as XML data.
Exception Assistant Support | The additional features provided by Exception Assistant are unavailable when debugging Windows Phone games. Information on exceptions is provided by the standard Exceptions dialog box within XNA Game Studio.
Debugging a Running Process | Attach the debugger to a process that is currently executing.

To debug a game

Debugging a Windows Phone game is similar to the process for deploying your game, with one exception.

  • On the Debug menu, click Start Debugging instead of Deploy Solution. Alternatively, press F5.

    Your game will begin executing immediately after it is successfully deployed to the emulator or device.

To run game without debugging

  • Click Start Without Debugging on the Debug menu.

Expand image See Also

Developing Windows Phone Games


Using the Windows Phone Emulator

The Windows Phone emulator is a software version of the Windows Phone environment that is part of the Microsoft Windows Phone Developer Tools. It may be used as a deployment and debugging platform for Windows Phone applications, as well as for XNA Game Studio games for Windows Phone. It can be especially useful when a physical Windows Phone device is unavailable.

Important

To successfully deploy to the Windows Phone emulator, your development system must have a DirectX 10 or later graphics card and a compatible driver installed.

For more information see Troubleshooting Windows Phone Deployment.

Launching the Windows Phone Emulator

The Windows Phone emulator is launched automatically when an XNA Game Studio game is deployed to it.

For information about this procedure, see Deploying a Windows Phone Game.

Using the Windows Phone Emulator

When the Windows Phone emulator is selected as the current device and an XNA Game Studio game is deployed, the emulator is automatically launched.

Figure 1. Windows Phone emulator

Toolbar

The toolbar displayed alongside the Windows Phone emulator offers the following controls, listed in order from top to bottom:

  • Close - Terminates the Windows Phone emulator.
  • Minimize - Minimizes the Windows Phone emulator to the Windows taskbar.
  • Rotate Left - Rotates the Windows Phone emulator display 90 degrees counterclockwise.
  • Rotate Right - Rotates the Windows Phone emulator display 90 degrees clockwise.
  • Resize - Toggles the Windows Phone emulator display between reduced and full size.
  • Zoom - Invokes the Zoom dialog box to resize the emulator.


Troubleshooting Windows Phone Deployment

Troubleshooting Windows Phone Deployment

Provides some helpful troubleshooting tips for Windows Phone deployment if you are unable to establish a successful connection between your computer and your Windows Phone device.

Deployment to Windows Phone Emulator Fails

To execute and debug an XNA Game Studio project in the Windows Phone emulator, your development system must have a DirectX 10 or later graphics card and a compatible driver installed.

XNA Game Studio check for a DirectX 10 or later graphics card with a compatible driver before deploying to the Windows Phone Emulator. If the graphics card does not support DirectX 10 or later, the following message will be displayed in the error window of Visual Studio:

Deploy failed with the following error: The current display adapter does not meet the emulator requirements to run XNA Framework applications.

The DirectX Caps Viewer Tool can be used to determine if a graphics card supports DirectX 10 or later is installed. This tool is available for download via DirectX SDK.

To determine if a graphics card supports DirectX 10 or later:

  1. In the DirectX Caps Viewer, expand the DXGI 1.1 Devices folder, then expand the next level folder for the video card. Under this folder, you will see folders for Direct3D 10, Direct3D 10.1, and the like.
  2. Expand the Direct3D 10.1 folder and examine the Feature Level entry. In this folder, you will see an entry for D3D10_FEATURE_LEVEL_10_0 or D3D10_FEATURE_LEVEL_10_1 if the graphics card supports DirectX 10 or later. If the Feature Level indicates a feature level of 9_n or less, it cannot support the Direct3D of the Windows Phone Emulator.

If you see this error message and your graphics card is DirectX 10-capable, refer to the Web site for the manufacturer of the graphics card to see if a newer driver is available.


Migrating from Zune to Windows Phone

Migrating from Zune to Windows Phone

Discusses how to migrate games written for Zune and Zune HD on XNA Game Studio 3.1 to Windows Phone with XNA Game Studio 4.0.

Introduction

Games that were written for Zune and Zune HD in previous versions are natural candidates for porting to Windows Phone. Windows Phone shares many common attributes with the Zune HD: a handheld form-factor, small screen, and the primary game inputs are multitouch and the accelerometer.

Since the Zune and Zune HD are only supported in XNA Game Studio versions including and prior to 3.1, and Windows Phone is a new platform as of version , there is no direct way to update applications written for Zune to Windows Phone.

This topic describes how to port a Zune application from XNA Game Studio 3.1 to Windows Phone with XNA Game Studio 4.0.

Creating a new Windows Phone Project

The first thing to do is to create a new Windows Phone project. If you don't already know how to do this, see Creating a Windows Phone Game or Library Project.

Migrating Your Content

Copy your content from the Zune project's Content folder to the content project folder for your new XNA Game Studio 4.0 application. This will be named, by default, ProjectNameContent inside your solution folder. Unlike content projects in XNA Game Studio 3.1, content projects in XNA Game Studio 4.0 are not nested within the game project, but are separate projects in the same solution.

To add the content to your content project

  1. Right-click the content project.
  2. Choose Add, then Existing Item.
  3. Choose your content (you can select multiple files at once), and click Add.
Note
Asset names, as with XNA Game Studio 3.1, are named according to the filename. If you need to, edit the Asset Name field in each content's Properties pane so that it matches the asset name in your game code.

Migrating Your Code

The next step involves moving your old sourcefiles to your new XNA Game Studio 4.0 project.

To migrate your code

  1. Copy the source files from your old application into the new application's project folder, located inside the new application's solution folder. Both of these folders will be named with the project name chosen for your application.

  2. If you renamed either Game1.cs or Program.cs in your old project, remove these files from your new project.

  3. If you have additional files beyond Game1.cs and Program.cs (or renamed these in your old project), add these to your project by right-clicking the project name in Solution Explorer, selecting Add, then Existing Item.

Updating Your Code

Once you've copied over your old source-files, you'll need to update your code for XNA Game Studio 4.0 and Windows Phone. What you do here depends on what features you used in your old project, so this section will provide information specific to common feature areas used with Zune and Zune HD games.

Screen Resolution

The screen size of a Windows Phone 7 device is, at minimum, 800x480. If your application expects a screen-size of 480x272 (Zune HD) or 240x320 (previous Zune models), you will need to adjust your application accordingly. This can be done either by resizing your art assets to take advantage of the higher resolution available on Windows Phone 7, or by taking advantage of the built-in hardware scaling.

For many applications, using the built-in hardware scaling has several advantages:

  • There is no need to convert any of your existing textures to fit the new screen resolution.
  • There is no need to convert screen coordinates for touch input
    • .

To use built-in hardware scaling, simply set the preferred back buffer width and height to match those of the Zune device you're porting from. For example:

C#
    graphics = new GraphicsDeviceManager(this);
    // This makes use of the built-in hardware scaler to work with
    // our original (Zune HD) resolution
    graphics.PreferredBackBufferWidth = 272;
    graphics.PreferredBackBufferHeight = 480;

Button Input

Although Windows Phone 7 devices have hardware buttons, these cannot be used by games on Windows Phone. You will need to manually rewrite code that uses hardware buttons to use the input devices available on Windows Phone: touch input or accelerometer input.

Touch Input

Multitouch input has moved to its own assembly: Microsoft.Xna.Framework.Input.Touch.dll. If this was not added to your project by default, you'll need to add it yourself to access the XNA Game Studio touch input classes and methods.

Make sure that you also have using Microsoft.Xna.Framework.Input.Touch statements in any source files that will be using its classes.

For more information about using touch input, see Working with Touch Input (Windows Phone).

Accelerometer Input

Accelerometer input is now handled by the Microsoft Windows Phone Developer Tools, which requires adding the Microsoft.Devices.Sensors assembly to your project and adding associated using statements in the sourcefiles in which you'll be using its classes and methods.

Accelerometer input, like many Microsoft Windows Phone Developer Tools features, is event-driven, and you'll need to create an event handler to that will be called when accelerometer events are received by the game.

For more information about using accelerometer input, see Retrieving Accelerometer Input (Windows Phone).

Title Storage

StorageContainer.TitleLocation has been deprecated in XNA Game Studio 4.0, and no longer exists—in fact, the entire Microsoft.Xna.Framework.Storage namespace doesn't exist for Windows Phone projects. To access title storage on Windows Phone, use OpenStream to get a filestream to the storage location.

For more information on using OpenStream to access title storage, see Reading Game Data from Title Storage.

User Storage

Writeable user storage on Windows Phone is not provided by XNA Game Studio. To write data to the device to save game state or player progress, you can use IsolatedStorageFile.GetUserStoreForApplication to get an IsolatedStorageFile object that can be used to create files and directories, or to read from or write to existing files. For more infomation, see Writing Data (Windows Phone).


Windows Phone Programming

Windows Phone Programming

Caution

Windows Phone applications and games use the Silverlight Application Security Model. Windows phone code—called Transparent code—is unable to call security critical libraries, types, and methods. A majority of security critical methods and types are in the System.IO namespace. In the Silverlight or .NET Framework libraries supported in the XNA Framework, security critical methods can be identified by the [SecurityCriticalAttribute] attribute. Although these methods will compile, they throw a MethodAccessException at runtime.

Windows and Xbox 360 games do not use the Silverlight Application Security Model, and are not restricted as described above.

Security critical code is permitted on Windows and Xbox 360 platforms.

Game Programming Topics in the Windows Phone Documentation

The Silverlight and XNA Frameworks for Windows Phone
Describes what is supported when using the XNA Framework from a Windows Phone application, and which Silverlight namespaces are not supported in a Windows Phone Game.
Execution Model Overview for Windows Phone
Under the Windows Phone execution model, applications are activated and deactivated dynamically when a user navigates away from the application. This document describes how to persist data correctly for a windows phone application when the application is activated or deactivated.
Execution Model Best Practices for Windows Phone
Windows Phone applications are terminated when the user navigates away from them. This topic highlights some best practices for handling execution model events.

Windows Phone Programming with XNA Game Studio

Cross-Platform Conditional Compilation Symbols
Describes the conditional compilation variables available for maintaining common source code in XNA Game Studio cross-platform projects.
Achieving Good Performance on Different Hardware Types
Demonstrates how to write games for a variety of hardware configurations. Specifically, this topic addresses ways to write a game so that it works on high-end hardware, but continues to give adequate performance when the game is run on a less capable computer.
Working with Multitouch and Accelerometer Input
Topics that provide guidance on writing code to support multitouch and accelerometer input for XNA Game Studio.
Writing Data (Windows Phone)
Describes how to save game data on Windows Phone.
Handling Interruptions on Windows Phone
Provides detail about how to handle interruptions, such as incoming calls, on Windows Phone.
Enable XNA Framework Events in Windows Phone Applications
Describes the the process of manually initializing and updating a FrameworkDispatcher to support XNA Framework functionality from other application models that use the Silverlight application model.


How to: Change the Game Name

How to: Change the Game Name

By default, the game's name that is displayed on the platform device (for example, the selection menu) is the same as the name of the XNA Game Studio solution.

To change the game name

  1. Open an XNA Framework game or library project in XNA Game Studio.
  2. In Solution Explorer, right-click the game project node, and then select Properties.
  3. In the Properties property sheet, click the Application tab.
  4. Click Assembly Information.
  5. Change the value in the Title box to the new name.
  6. Click OK.

An alternative method is to open the AssemblyInfo.cs file in the Properties folder of the game project for editing, and then change the value of AssemblyTitle.

Expand image See Also

Getting Started with XNA Game Studio Development


Troubleshooting XNA Game Studio Projects

Troubleshooting XNA Game Studio Projects

Provides some helpful troubleshooting tips for XNA Game Studio projects.

Project Fails to Deploy/Debug

If your XNA Game Studio project fails to deploy and execute (for example, from an F5 command), it may because the startup project has been mistakenly set to the solution's content project. Since the content project is not executable, the deployment will fail.

To view and change the startup project

  1. In Solution Explorer, right-click the project you want to set as the startup project.
  2. In the context menu, click Set as StartUp Project.

Also, you can either use Solution Explorer to select the project or, on the Project menu, click Set as StartUp Project to select the project.

This condition can occur after Visual Studio encounters errors in a .csproj file. These errors may have been introduced by a faulty manual edit of that file. In this circumstance, Visual Studio may reset the startup project to the content project. This setting will persist even after the error in the .csproj file has been corrected.

Expand image See Also

Troubleshooting Xbox 360 Game Deployment
Troubleshooting Windows Phone Deployment


Upgrading XNA Game Studio Projects

Upgrading XNA Game Studio Projects

In This Section

Upgrading Projects to XNA Game Studio 4.0
Describes how to upgrade your XNA Game Studio 3.0 or XNA Game Studio 3.1 game to target XNA Framework 4.0 in Microsoft Visual Studio 2010.
Troubleshooting Upgrades
Describes common issues with upgrading XNA Game Studio projects.

Expand image See Also

Getting Started with XNA Game Studio Development


Upgrading Projects to XNA Game Studio 4.0

Upgrading Projects to XNA Game Studio 4.0

XNA Game Studio 3.0 or XNA Game Studio 3.1 game projects must be upgraded to target XNA Game Studio 4.0 for development in Microsoft Visual Studio 2010 and XNA Game Studio 4.0. This upgrade is necessary in every case, regardless of the complexity or simplicity of the project.

Note

XNA Game Studio 4.0 does not provide upgrade support for any XNA Game Studio versions prior to 3.0.

For a quick understanding of the features introduced in XNA Game Studio 4.0, see What's New in XNA Game Studio 4.0.

Upgrading Your Projects

Projects created in XNA Game Studio 3.0 or XNA Game Studio 3.1 must be upgraded to work with Microsoft Visual Studio 2010 and XNA Game Studio 4.0.

The Project Upgrade Wizard for XNA Game Studio 4.0 executes automatically whenever you open a project or solution in Microsoft Visual Studio 2010 that was created for XNA Game Studio 3.0 or XNA Game Studio 3.1. The instructions provided by the Project Upgrade Wizard will lead you through the upgrade process.

The Project Upgrade Wizard only upgrades projects so that their structure is compatible with XNA Game Studio 4.0 and Visual Studio 2010. Your game code may still require further update to comply with changes in APIs for XNA Game Studio 4.0. The upgrade wizard does not change your code.

The chief tasks that the Project Upgrade Wizard performs are:

  • Updates XNA Framework references and properties from XNA Framework 3.0/3.1 to XNA Framework 4.0.
  • Updates the import targets file references in the game project for what is required for XNA Framework 4.0.
  • Updates the import targets file references in the content project for what is required for XNA Framework 4.0.
  • Relocates content folders from within game projects to their own content projects, and updates the code project's content references to the new content project.
  • Establishes the Game Profile and C# version settings for each game project according to the platform defaults.
Note

Projects for Zune are excluded from the upgrade process because the platform is not supported in XNA Game Studio 4.0. For information about how to convert Zune projects to Windows Phone, see the topic Migrating from Zune to Windows Phone.


Troubleshooting Upgrades

Troubleshooting Upgrades

Projects do not build because a reference to assembly version X is missing, but I am not targeting X.

Check the dependencies of all assemblies included with your projects. Also, ensure that any assemblies you're using in your projects target the same version of the XNA Framework that your project is targeting. Projects (or libraries) that target different versions of the XNA Framework cannot interact and should not be located in the same solution.

Projects do not build because a type cannot be converted (from assembly version X to assembly version Y).

Check to see that all classes in your project use the classes, methods, properties, and events that exist in the XNA Framework version you are targeting. In some cases, methods may have been deprecated or some parameters may have changed.

My importer or processor is missing from the list of importers or processors available in the Content Pipeline.

The importer or processor used by your project may not support the version of XNA Framework that you are targeting. Ensure you have updated versions of all components used by your title.

My content will not build because the importer or processor cannot be found, but I have a reference to it.

The importer or processor used by your project may not support the version of XNA Framework that you are targeting. Ensure you have updated versions of all components used by your title.

Expand image See Also

Upgrading XNA Game Studio Projects


Writing Game Code

Writing Game Code

This section describes how to use XNA Game Studio and the XNA Framework to develop multiplatform games for Windows, Xbox 360, and Windows Phone.

In This Section

Initializing, Updating, and Exiting a Game
The XNA Framework Game Class provides a game loop and overloadable methods to update and draw the game.
Displaying Graphics
Describes using XNA graphics for rendering 2D and 3D graphics.
Responding to User Input
Demonstrates techniques for accessing various input devices and responding to user input.
Creating and Playing Sounds
Provides overviews about audio technology, and presents predefined scenarios to demonstrate how to use audio.
Displaying Pictures and Playing Video
Provides overviews about how to use the Media API to retrieve system media, including pictures, songs, and video.
Reading and Writing Data Files
Provides classes that allow reading and writing of files.
Adding Xbox LIVE Features to Your Game
Contains introductory articles describing how to add Xbox LIVE to your game with XNA Gamer Services.
Adding Xbox LIVE Multiplayer Support on Xbox 360 and Windows
Contains introductory articles describing how to create and join multiplayer game sessions, to manage game state across clients, and to interact with the friends list on Xbox 360 and Windows.


Initializing, Updating, and Exiting a Game

Initializing, Updating, and Exiting a Game

The XNA Framework Game Class provides a game loop and overloadable methods to update and draw the game.

In This Section

Restricting Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode
Demonstrates how to create a custom GraphicsDeviceManager that only selects graphics devices with widescreen aspect ratios in full-screen mode.
What Is a Game Loop?
The XNA Framework Game class implements a game loop, which provides not only the window which displays your game, but also provides overloadable methods that your game implements to facilitate communication between your game and the operating system.
Automatic Rotation and Scaling (Windows Phone)
Describes automatic rotation and scaling in the XNA Framework. Rotation and scaling are done in hardware at no performance cost to the game.
Exiting a Game Immediately
Demonstrates how to exit a game in response to user input.
Resizing a Game
Demonstrates how to resize an active game window.
Exiting a Game After a Time Out
Demonstrates how to exit a game after a period of time (such as inactivity) has passed.
Creating a Full-Screen Game
Demonstrates how to start a game in full-screen mode.
Updating with Variable or Fixed Timing
Demonstrates how to set up the runtime to call your Update method using variable or fixed timing.
Working with Asynchronous Methods in XNA Game Studio
Describes how you can work with asynchronous methods in XNA Game Studio.
Achieving Good Performance on Different Hardware Types
Demonstrates how to write games for a variety of hardware configurations. Specifically, this topic addresses ways to write a game so that it works on high-end hardware, but continues to give adequate performance when the game is run on a less capable computer.
Handling Interruptions on Windows Phone
Provides detail about how to handle interruptions, such as incoming calls, on Windows Phone.
Enable XNA Framework Events in Windows Phone Applications
Describes the the process of manually initializing and updating a FrameworkDispatcher to support XNA Framework functionality from other application models that use the Silverlight application model.


Restricting Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode

Restricting Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode
CollapseAll image

Demonstrates how to create a custom GraphicsDeviceManager that only selects graphics devices with widescreen aspect ratios in full-screen mode.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download AspectRatio_Sample.zip.

Restricting Graphics Devices

To restrict graphics devices to widescreen aspect ratios in full-screen mode

  1. Create a class that derives from GraphicsDeviceManager.

    C#
    public class CustomGraphicsDeviceManager : GraphicsDeviceManager
{
    public CustomGraphicsDeviceManager( Game game )
        : base( game )
    {
    }

}

  2. Add a WideScreenOnly property to the class.

    The property is used to turn on and off the widescreen-only behavior.

    C#
    private bool isWideScreenOnly;
public bool IsWideScreenOnly
{
    get { return isWideScreenOnly; }
    set { isWideScreenOnly = value; }
}

  3. Determine the minimum desired aspect ratio.

    C#
    static float WideScreenRatio = 1.6f; //1.77777779f;

  4. Override the RankDevices method of GraphicsDeviceManager.

    Note the call to base.RankDevices. This call ensures that the new version of RankDevices has an already ranked list of available devices with which to work.

    C#
    protected override void RankDevices(
    List<GraphicsDeviceInformation> foundDevices )
{
    base.RankDevices( foundDevices );
}

  5. Add a check to see if the WideScreenOnly property is true.

    C#
    if (IsWideScreenOnly)
{
    ...
}

  6. In the if block, loop through all found devices, and check whether the PresentationParameters indicate the device is full-screen.

  7. If the device is full-screen, determine the aspect ratio of the device by dividing the BackBufferWidth by the BackBufferHeight.

  8. If the aspect ratio is less than the desired aspect ratio, remove the device from the list of found devices.

    C#
    for (int i = 0; i < foundDevices.Count; )
{
    PresentationParameters pp =
        foundDevices[i].PresentationParameters;
    if (pp.IsFullScreen == true)
    {
        float aspectRatio = (float)(pp.BackBufferWidth) /
            (float)(pp.BackBufferHeight);

        // If the device does not have a widescreen aspect
        // ratio, remove it.
        if (aspectRatio < WideScreenRatio)
        {
            foundDevices.RemoveAt( i );
        }
        else { i++; }
    }
    else i++;
}
  9. Replace the default GraphicsDeviceManager with the derived GraphicsDeviceManager.

  10. To test the new component, set the WideScreenOnly and IsFullScreen properties to true.

    C#
            public Game1()
        {
            graphics = new CustomGraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            this.graphics.PreferMultiSampling = false;
#if WINDOWS
            this.graphics.PreferredBackBufferWidth = 1280;
            this.graphics.PreferredBackBufferHeight = 720;
#endif
#if WINDOWS_PHONE
            this.graphics.PreferredBackBufferWidth = 400;
            this.graphics.PreferredBackBufferHeight = 600;
#endif

            this.graphics.IsFullScreen = true;
            this.graphics.IsWideScreenOnly = true;
            graphics.ApplyChanges();
        }


What Is a Game Loop?

What Is a Game Loop?
CollapseAll image

The XNA Framework Game class implements a game loop, which provides not only the window which displays your game, but also provides overloadable methods that your game implements to facilitate communication between your game and the operating system.

This overview covers the following topics.

  • Making a New Game
  • Game Loop Timing
  • Game Components
  • Game Services
  • Game Components Consuming Game Services

Making a New Game

The first step in creating a new game is to make a class that derives from Game. The new class needs to override Update, Draw, and Initialize. The Update method is responsible for handling game logic, and the Draw method is responsible for drawing each frame. The Initialize method is responsible for game setup before the first frame of the game.

Game Loop Timing

A Game is either fixed step or variable step, defaulting to fixed step. The type of step determines how often Update will be called and affects how you need to represent time-based procedures such as movement and animation.

Fixed-Step Game Loops

A fixed-step Game tries to call its Update method on the fixed interval specified in TargetElapsedTime. Setting Game.IsFixedTimeStep to true causes a Game to use a fixed-step game loop. A new XNA project uses a fixed-step game loop with a default TargetElapsedTime of 1/60th of a second.

In a fixed-step game loop, Game calls Update once the TargetElapsedTime has elapsed. After Update is called, if it is not time to call Update again, Game calls Draw. After Draw is called, if it is not time to call Update again, Game idles until it is time to call Update.

If Update takes too long to process, Game sets IsRunningSlowly to true and calls Update again, without calling Draw in between. When an update runs longer than the TargetElapsedTime, Game responds by calling Update extra times and dropping the frames associated with those updates to catch up. This ensures that Update will have been called the expected number of times when the game loop catches up from a slowdown. You can check the value of IsRunningSlowly in your Update if you want to detect dropped frames and shorten your Update processing to compensate. You can reset the elapsed times by calling ResetElapsedTime.

When your game pauses in the debugger, Game will not make extra calls to Update when the game resumes.

Variable-Step Game Loops

A variable-step game calls its Update and Draw methods in a continuous loop without regard to the TargetElapsedTime. Setting Game.IsFixedTimeStep to false causes a Game to use a variable-step game loop.

Animation and Timing

For operations that require precise timing, such as animation, the type of game loop your game uses (fixed-step or variable-step) is important.

Using a fixed step allows game logic to use the TargetElapsedTime as its basic unit of time and assume that Update will be called at that interval. Using a variable step requires the game logic and animation code to be based on ElapsedGameTime to ensure smooth gameplay. Because the Update method is called immediately after the previous frame is drawn, the time between calls to Update can vary. Without taking the time between calls into account, the game would seem to speed up and slow down. The time elapsed between calls to the Update method is available in the Update method's gameTime parameter. You can reset the elapsed times by calling ResetElapsedTime.

When using a variable-step game loop, you should express rates—such as the distance a sprite moves—in game units per millisecond (ms). The amount a sprite moves in any given update can then be calculated as the rate of the sprite times the elapsed time. Using this approach to calculate the distance the sprite moved ensures that the sprite will move consistently if the speed of the game or computer varies.

Game Components

Game components provide a modular way of adding functionality to a game. You create a game component by deriving the new component either from the GameComponent class, or, if the component loads and draws graphics content, from the DrawableGameComponent class. You then add game logic and rendering code to the game component by overriding GameComponent.Update,DrawableGameComponent.Draw and GameComponent.Initialize. A game component is registered with a game by passing the component to Game.Components.Add. A registered component will have its draw, update, and initialize methods called from the Game.Initialize, Game.Update, and Game.Draw methods.

Game Services

Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers request services from Game.Services. This arrangement allows an object that requires a service to request the service without knowing the name of the service provider.

Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service being implemented and a reference to the object providing the service. For example, to register an object that provides a service represented by the interface IMyService, you would use the following code.

Services.AddService( typeof( IMyService ), myobject );

Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.

IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( typeof(IGraphicsDeviceService) );

Game Components Consuming Game Services

The GameComponent class provides the Game property so a GameComponent can determine what Game it is attached to. With the Game property, a GameComponent can call Game.Services.GetService to find a provider of a particular service. For example, a GameComponent would find the IGraphicsDeviceService provider by using the following code.

IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Game.Services.GetService( typeof( IGraphicsDeviceService ) );


Automatic Rotation and Scaling (Windows Phone)

Automatic Rotation and Scaling (Windows Phone)
CollapseAll image

Describes automatic rotation and scaling in the XNA Framework. Rotation and scaling are done in hardware at no performance cost to the game.

If your game supports more than one display orientation, as specified by SupportedOrientations and described with DisplayOrientation, the XNA Framework automatically rotates and scales the game when the OrientationChanged event is raised.

The current back buffer resolution is scaled, and can be queried by using PreferredBackBufferWidth and PreferredBackBufferHeight. These values will not be the same as the nonscaled screen resolution, which can be queried by using DisplayMode or ClientBounds.

If you leave SupportedOrientations set to DisplayOrientation.Default, orientation automatically is determined from your PreferredBackBufferWidth and PreferredBackBufferHeight. If the PreferredBackBufferWidth is greater than the PreferredBackBufferHeight, the game will run in the landscape orientation and automatically switch between LandscapeLeft and LandscapeRight depending on the position which the user holds the phone. To run a game in the portrait orientation, set the PreferredBackBufferWidth to a value smaller than the PreferredBackBufferHeight.

Expand image Remarks

Windows Phone Specific Information
Orientation settings only apply to Windows Phone-based games. There is no concept of display rotation for Windows and Xbox 360 games.


Exiting a Game Immediately

Exiting a Game Immediately

Demonstrates how to exit a game in response to user input.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download GameLoop_Sample.zip.

Exiting a Game Without Finishing the Current Update

To exit the game loop without running any remaining code in the update handler

  1. Derive a class from Game.

  2. Create a method that checks KeyboardState.IsKeyDown for the state of the ESC key.

  3. If the ESC key has been pressed, call Game.Exit and return true.

    C#
    bool checkExitKey(KeyboardState keyboardState, GamePadState gamePadState)
{
    // Check to see whether ESC was pressed on the keyboard
    // or BACK was pressed on the controller.
    if (keyboardState.IsKeyDown(Keys.Escape) ||
        gamePadState.Buttons.Back == ButtonState.Pressed)
    {
        Exit();
        return true;
    }
    return false;
}

  4. Call the method in Game.Update, and return from Update if the method returned true.

    C#
    GamePadState gamePadState = GamePad.GetState(PlayerIndex.One);
KeyboardState keyboardState = Keyboard.GetState();

// Check to see if the user has exited
if (checkExitKey(keyboardState, gamePadState))
{
    base.Update(gameTime);
    return;
}

  5. Create a method to handle the Game.Exiting event.

    The Exiting event is issued at the end of the tick in which Game.Exit is called.

    C#
    void Game1_Exiting(object sender, EventArgs e)
{
    // Add any code that must execute before the game ends.
}


Resizing a Game

Resizing a Game

Demonstrates how to resize an active game window.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download GameLoop_Sample.zip.

Adding Window Resizing Functionality

To add player window resizing to a game

  1. Derive a class from Game.

  2. Set Game.GameWindow.AllowUserResizing to true.

  3. Add an event handler for the ClientSizeChanged event of Game.Window.

    C#
    this.Window.AllowUserResizing = true;
this.Window.ClientSizeChanged += new EventHandler<EventArgs>(Window_ClientSizeChanged);

  4. Implement a method to handle the ClientSizeChanged event of Game.Window.

    C#
    void Window_ClientSizeChanged(object sender, EventArgs e)
{
    // Make changes to handle the new window size.
}


Exiting a Game After a Time Out

Exiting a Game After a Time Out

Demonstrates how to exit a game after a period of time (such as inactivity) has passed.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download GameLoop_Sample.zip.

Adding Time-Out Functionality to a Game

To make a game time out

  1. Create a class that derives from Game.

  2. Determine the desired time-out limit in milliseconds.

    C#
    // Time out limit in ms.
static private int TimeOutLimit = 4000; // 4 seconds

  3. Add a variable for tracking the elapsed time since the most recent user activity.

    C#
    // Amount of time that has passed.
private double timeoutCount = 0;

  4. When user input is checked, set a flag indicating whether any user activity has taken place.

    C#
    GamePadState blankGamePadState = new GamePadState(
    new GamePadThumbSticks(), new GamePadTriggers(), new GamePadButtons(),
    new GamePadDPad());

    bool checkActivity(KeyboardState keyboardState, GamePadState gamePadState)
{
    // Check to see if the input states are different from last frame
    GamePadState nonpacketGamePadState = new GamePadState(
        gamePadState.ThumbSticks, gamePadState.Triggers,
        gamePadState.Buttons, gamePadState.DPad);
    bool keybidle = keyboardState.GetPressedKeys().Length == 0;
    bool gamepidle = blankGamePadState == nonpacketGamePadState;
    if (keybidle && gamepidle)
    {
        // no activity;
        return false;
    }
    return true;
}

  5. In Update, if there has not been any user activity, increment the tracking variable by the elapsed time since the last call to Update.

  6. If there has been some user activity, set the tracking variable to zero.

    C#
    // Check to see if there has been any activity
if (checkActivity(keyboardState, gamePadState) == false)
{
    timeoutCount += gameTime.ElapsedGameTime.Milliseconds;
}
else
    timeoutCount = 0;

  7. Check whether the value of the tracking variable is greater than the time-out limit.

  8. If the variable is greater than the limit, perform some time-out logic such as playing an idle animation or, in this case, exit the game.

    C#
    // Timeout if idle long enough
if (timeoutCount > TimeOutLimit)
{
    Exit();
    base.Update(gameTime);
    return;
}


Creating a Full-Screen Game

Demonstrates how to start a game in full-screen mode.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download FullScreenWindows.zip.

Creating a Full-Screen Game

To create a full-screen game

  1. Derive a class from Game.

  2. After creating the GraphicsDeviceManager, set its PreferredBackBufferWidth and PreferredBackBufferHeight to the desired screen height and width.

  3. Set IsFullScreen to true.

    C#
    this.graphics.PreferredBackBufferWidth = 480;
this.graphics.PreferredBackBufferHeight = 800;

this.graphics.IsFullScreen = true;


Updating with Variable or Fixed Timing

Updating with Variable or Fixed Timing

Demonstrates how to set up the runtime to call your Update method using variable or fixed timing.

There are two techniques for setting how often your Update method is called. Variable timing means to call Update as soon as other work finishes; this implies that it is up to a game developer to ensure that your render loop happens quickly enough so that Update will be called often enough to exceed your minimum frame rate. Fixed timing means that Update is called each time a fixed interval of time has passed. Fixed timing guarantees that Update will be called, however, so you may drop frames if the previous work needs to be interrupted to call Update.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download AppModelDemo_Sample.zip.

Updating with Variable Timing

To use a variable time step

  1. Create a class that derives from Game.

  2. Set IsFixedTimeStep to false.

    This causes the Update method to be called as often as possible, instead of being called on a fixed interval.

    C#
    this.IsFixedTimeStep = false;

Updating with Fixed Timing

To use a fixed time step

  1. Create a class that derives from Game.

  2. Set IsFixedTimeStep to true.

    C#
    this.IsFixedTimeStep = true;

    This causes the Update method to be called each time the fixed time interval has passed.

  3. Set TargetElapsedTime to a fixed interval of time.

    This example sets the time between calls to 16 milliseconds.

    C#
    this.TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 16);    // Update() is called every 16 milliseconds


Working with Asynchronous Methods in XNA Game Studio

Working with Asynchronous Methods in XNA Game Studio

This topic decribes how you can work with asynchronous methods in XNA Game Studio.

Complete Sample

The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

Download StorageDemo_AsyncDevice.zip

Download GuideUIWP7.zip

Note
You must download the above sample code in order to access the 3D models used in this tutorial.

XNA Game Studio provides many methods that operate asynchronously for operations that may take longer than the desired render-cycle length.

Asynchronous methods consist of four elements:

  • A Begin call that begins the asynchronous process. Begin methods return an IASyncResult object that can be used to poll for completion if a callback function is not used to detect the completion of the operation.
  • An End call that ends the asynchronous process and returns objects or data requested by the Begin call. Calling the corresponding End method for each Begin method is important to prevent deadlocks and other undesirable behavior.
  • An optional callback method that is called by the system when the asynchronous operation completes. This is passed to the Begin call.
  • An optional, arbitrary tracking object that can be supplied to Begin to uniquely identify a particular asynchronous request. This object is part of the IASyncResult returned by Begin, and is also present in the callback method's IASyncResult parameter. Because of this, it also can be used to pass arbitrary data to the callback method when the asynchronous process completes.

The two most common methods of working with asynchronous methods are to check for completion by polling or by callback. This topic describes both methods.

Note
For exhaustive information about asynchronous methods, see Asynchronous Programming Design Patterns on MSDN.

To poll for asynchronous method completion

  1. Call the asynchronous Begin method, and save the returned IASyncResult object to a variable that will be checked for completion.

  2. In your update code, check IsCompleted.

  3. When IsCompleted is true, call the End method that corresponds to the Begin method called in step 1.

The following code demonstrates the polling method.

C#
public Game1()
{
    graphics = new GraphicsDeviceManager(this);
    Content.RootDirectory = "Content";

    this.Components.Add(new GamerServicesComponent(this));
}
IAsyncResult result;
Object stateobj;
bool GameSaveRequested = false;
GamePadState currentState;

protected override void Update(GameTime gameTime)
{
    GamePadState previousState = currentState;
    currentState = GamePad.GetState(PlayerIndex.One);
    // Allows the default game to exit on Xbox 360 and Windows
    if (currentState.Buttons.Back == ButtonState.Pressed)
        this.Exit();

    if ((currentState.Buttons.A == ButtonState.Pressed) &&
        (previousState.Buttons.A == ButtonState.Released))
    {
        // Set the request flag
        if ((!Guide.IsVisible) && (GameSaveRequested == false))
        {
            GameSaveRequested = true;
            result = StorageDevice.BeginShowSelector(
                    PlayerIndex.One, null, null);
        }
    }

    // If a save is pending, save as soon as the
    // storage device is chosen
    if ((GameSaveRequested) && (result.IsCompleted))
    {
        StorageDevice device = StorageDevice.EndShowSelector(result);
        if (device != null && device.IsConnected)
        {
            DoSaveGame(device);
        }
        // Reset the request flag
        GameSaveRequested = false;
    }
    base.Update(gameTime);
}

To use a callback to check for asynchronous method completion

  1. Call the asyncronous Begin method, passing it an AsyncCallback method that will be called when the asynchronous process is completed.

    AsyncCallback methods must return void, and take a single parameter: IASyncResult.

  2. In the callback, call the End method that corresponds to the Begin method called in step 1.

    The End method typically returns any data or objects requested by the Begin call.

The following code demonstrates the callback method. First, a callback method is defined.

C#
protected void GetTypedChars(IAsyncResult r)
{
    typedText = Guide.EndShowKeyboardInput(r);
}

Then, this callback is passed in when calling the Begin method.

C#
kbResult = Guide.BeginShowKeyboardInput(PlayerIndex.One,
        "Here's your Keyboard", "Type something...",
        ((typedText == null) ? "" : typedText),
        GetTypedChars, null);

Expand image See Also

Asynchronous Programming Design Patterns


Achieving Good Performance on Different Hardware Types

Achieving Good Performance on Different Hardware Types

Demonstrates how to write games for a variety of hardware configurations. Specifically, this topic addresses ways to write a game so that it works on high-end hardware, but continues to give adequate performance when the game is run on a less capable computer.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample

Different hardware platforms provide different levels of performance. Even on the same platform—on a PC for example—variations in processing power, graphics capabilities, and hard-drive performance can create a high variance in the performance of your application.

By writing game code that prepares for, and adapts to, slower and less capable hardware, you allow your games to reach a larger audience while providing a great experience for gamers on all the platforms you target.

Hardware Specific Degradation

Single vs. Multiple CPUs

If a computer has multiple CPUs, some work can be offloaded to the other CPUs. The following code sample shows how to determine the number of available CPUs in the computer. For the game that takes advantage of, but does not require, multiple CPUs, this code sample describes where to place code for single processor and multiprocessor computers.

C#
// Scale appropriately for the number of processors on this computer

if (Environment.ProcessorCount == 1)
{
    // Perform tasks specific to single processor systems.
}
else
{
    // Perform tasks specific to multi-processor systems.
}

Performance-Specific Degradation

You can measure performance levels by the number of times the Update method is called each second. Once the update rate falls below a certain level (the default is 60 frames per second [fps]), GameTime.IsRunningSlowly is set to true.

This code sample shows where to place code that should be skipped if the game's performance falls below 60 fps.

C#
// Perform the following only if the game is running
// at 60 frames per second or faster

if (gameTime.IsRunningSlowly == false)
{
    // Perform time consuming update or draw here.
}

If 60 fps is not ideal for the game, you can change the default by altering TargetElapsedTime. To have IsRunningSlowly become true when the game slows to less than 30 fps, include this in the program's initialization code.

C#
// Alert the program when the frame rate falls below 30 frames per second.

TargetElapsedTime = new TimeSpan(10000000L / 30L);

To test for a different frame rate, change the 30 of the 30L to the desired fps (for example, 45L for 45 fps, or 100L for 100 fps).

Best Practice
To provide the best experience for your players, find the frame rate that your game can sustain continuously, and set that as the default frame rate. Having a smooth, constant frame rate is better than having a high, but variable, frame rate.

Expand image See Also

Concepts

Threading (C# Programming Guide)
Using Threading (C# Programming Guide)

Reference

IsRunningSlowly
TargetElapsedTime
System.Environment.ProcessorCount Property
ElapsedGameTime


Handling Interruptions on Windows Phone

Handling Interruptions on Windows Phone

On Windows Phone, your game can be shut down at any time due to a number of events, such as:

  • A call, text message, or other top-level communication comes in, and the user decides to take it.
  • The user presses the phone's Home button while the game is running.
  • The user turns off the phone while the game is running.
  • The phone turns itself off because the user did not provide input within the system-wide timeout period.

To handle these interruptions, care must be taken to make sure that your game responds in a predictable way, and that game data is not lost.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample Code

To handle game interruptions on Windows Phone:

  1. Override Game.OnExiting in your Game class.

  2. When Game.OnExiting is called, save any game data necessary to restart the game in its current state to the game's isolated storage. For example:

    C#
    protected override void OnExiting(object sender, System.EventArgs args)
{
    // Save the game state (in this case, the typed text).
    IsolatedStorageFile savegameStorage = IsolatedStorageFile.GetUserStoreForApplication();

    // open isolated storage, and write the savefile.
    IsolatedStorageFileStream fs = null;
    fs = savegameStorage.OpenFile(SAVEFILENAME, System.IO.FileMode.Create);
    if (fs != null)
    {
        // just overwrite the existing info for this example.
        fs.WriteByte(gameState); // a single byte
        if ((typedText != null) && (typedText.Length > 0))
        {
            fs.Write(System.Text.Encoding.UTF8.GetBytes(typedText), 0, typedText.Length);
        }
        fs.Close();
    }

    base.OnExiting(sender, args);
}

  3. Handle the PhoneApplicationService.Activated event to detect when an application is resuming after having been interrupted. For example:

    C#
    bool isActivated = false;

public Game1()
{
    Microsoft.Phone.Shell.PhoneApplicationService service = Microsoft.Phone.Shell.PhoneApplicationService.Current;
    service.Activated += new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(service_Activated);
}

void service_Activated(object sender, Microsoft.Phone.Shell.ActivatedEventArgs e)
{
    isActivated = true;
}
    Note
    To work with this event, you'll need to add the Microsoft.Phone assembly to your project's references. You can do this in Visual Studio by right-clicking References in Solution Explorer, and then clicking Add Reference.

  4. In your game's constructor or initialization methods, look for the presence of saved game data in the game's isolated storage, and if found, restore the game's state. For example:

    C#
    protected override void Initialize()
{
    gameState = 0;

    IsolatedStorageFile savegameStorage = IsolatedStorageFile.GetUserStoreForApplication();

    // open isolated storage, and write the savefile.
    if(savegameStorage.FileExists(SAVEFILENAME))
    {
        IsolatedStorageFileStream fs = null;
        try
        {
            fs = savegameStorage.OpenFile(SAVEFILENAME, System.IO.FileMode.Open);
        }
        catch (IsolatedStorageException e)
        {
            // The file couldn't be opened, even though it's there.
            // You can use this knowledge to display an error message
            // for the user (beyond the scope of this example).
        }

        if (fs != null)
        {
            // Reload the last state of the game.  This consists of the UI mode
            // and any text that was typed on the keyboard input screen.
            byte[] saveBytes = new byte[256];
            int count = fs.Read(saveBytes, 0, 256);
            if (count > 0)
            {
                // the first byte is the mode, the rest is the string.
                gameState = saveBytes[0];
                if (count > 1)
                {
                    typedText = System.Text.Encoding.UTF8.GetString(saveBytes, 1, count - 1);
                }
                fs.Close();
            }
        }
    }

    base.Initialize();
}

  5. If the PhoneApplicationService.Activated event was fired, you can bypass initial menus and start the player immediately in the state recorded in the save file. For example:

    C#
    bool isActivated = false;

public Game1()
{
    Microsoft.Phone.Shell.PhoneApplicationService service = Microsoft.Phone.Shell.PhoneApplicationService.Current;
    service.Activated += new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(service_Activated);
}

void service_Activated(object sender, Microsoft.Phone.Shell.ActivatedEventArgs e)
{
    isActivated = true;
}
    Best Practice
    When restoring a game that has been re-activated, you should return the player to whatever mode or screen he or she was working with when the game was interrupted. If the game is not being re-activated, but re-launched instead, you can start the player at the main menu, adding an option to restore the game to the saved position.

For more information about using isolated storage on Windows Phone, see Writing Data (Windows Phone).

Testing Game Reactivation

You can test game reactivation in the Windows Phone Emulator, or using a Windows Phone device.

To test game reactivation

  • Run your game in the debugger on the emulator or phone.

  • When the game is running, press the Home button on the emulator or phone.

  • Press the Back button on the emulator or phone to reactivate the game without relaunching it.

    • Note
    If you re-launch the game by tapping its icon on the phone, or press F5 to restart debugging in Visual Studio, the game will not fire the PhoneApplicationService.Activated event.

    Expand image See Also

    Concepts

    Windows Phone Programming

    Topics in the Windows Phone Documentation

    Execution Model Overview for Windows Phone
    Under the Windows Phone execution model, applications are activated and deactivated dynamically when a user navigates away from the application. This document describes how to persist data correctly for a windows phone application when the application is activated or deactivated.
    Execution Model Best Practices for Windows Phone
    Windows Phone applications are terminated when the user navigates away from them. This topic highlights some best practices for handling execution model events.


Enable XNA Framework Events in Windows Phone Applications

Enable XNA Framework Events in Windows Phone Applications

Event-based systems place messages in a queue where they wait to be dispatched. XNA Framework event messages are placed in a queue that is processed by the XNA FrameworkDispatcher.

In an application that implements the Game class, the FrameworkDispatcher.Update method is called automatically whenever Game.Update is processed. This FrameworkDispatcher.Update method triggers event processing in the XNA Framework.

If you use the XNA Framework from an application that does not implement the Game class—for example, a Windows Phone application that uses the Silverlight application model—you must call the FrameworkDispatcher.Update method yourself to dispatch messages that are in the XNA Framework message queue. You can do this once per frame in a ticking timer loop, or you can implement the IApplicationService interface with a DispatcherTimer and a Tick event handler.

To do this, you can create an application service, and then register the service with the application.

To create an XNA Framework dispatcher service

  1. Add a reference to the XNA Framework.

    • On the Project menu, click Add Reference, click the .NET tab, select Microsoft.Xna.Framework, and then click OK.

  2. Create using directives to use the types in the Microsoft.Xna.Framework and System.Windows.Threading namespaces without having to specify the namespace.
    C#
    using System.Windows.Threading;
using Microsoft.Xna.Framework;
  3. Create a class that implements IApplicationService.
    C#
    public class XNAFrameworkDispatcherService : IApplicationService
{
}
  4. Add a DispatcherTimer member.
    C#
    private DispatcherTimer frameworkDispatcherTimer;

  5. In the contructor for the XNA Framework dispatcher service, do the following:

    • Create a DispatcherTimer object and configure it to tick at 30fps, which is the standard rendering rate.
    • Subscribe to the Tick event handler of the DispatcherTimer
    • Call FrameworkDispatcher.Update once. This is important and must be done in the contructor to ensure proper behavior from the XNA Framework.
    C#
    public XNAFrameworkDispatcherService()
{
    this.frameworkDispatcherTimer = new DispatcherTimer();
    this.frameworkDispatcherTimer.Interval = TimeSpan.FromTicks(333333);
    this.frameworkDispatcherTimer.Tick += frameworkDispatcherTimer_Tick;
    FrameworkDispatcher.Update();
}
  6. Call FrameworkDispatcher.Update in the Tick event handler.
    C#
    void frameworkDispatcherTimer_Tick(object sender, EventArgs e) { FrameworkDispatcher.Update(); }
  7. Call StartService to start the dispatcher timer.
    C#
    void IApplicationService.StartService(ApplicationServiceContext context) { this.frameworkDispatcherTimer.Start(); }
  8. Call StopService to stop the dispatcher timer.
    C#
    void IApplicationService.StopService() { this.frameworkDispatcherTimer.Stop(); }

To register the service with the application

Your implementation of the IApplicationService class must to be added to the ApplicationLifeTimeObjects collection. This can be done by editing App.xaml.

  1. In the Application element of App.xaml, add an attribute called xmlsn:s and set the value to clr-namespace:WindowsPhoneApplication;assembly=WindowsPhoneApplication. This will allow you to reference the class in the <ApplicationLifetimeObjects> element. Note that WindowsPhoneApplication is the name of the namespace for the sample in this example, your application namespace should be used instead.
  2. Add to or create an <ApplicationLifetimeObjects/> element as a child to the <Application/> element.
  3. In the <ApplicationLifetimeObjects/> element, add an element which specifies the name of your implementation of the application service. In this example, the class that was created is named XNAFrameworkDispatcherService, so the element is added as <s:XNAFrameworkDispatcherService/>.
          <Application
          x:Class="WindowsPhoneApplication.App"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:System="clr-namespace:System;assembly=mscorlib"
          xmlns:navigation="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Navigation"
          xmlns:s="clr-namespace:WindowsPhoneApplication;assembly=WindowsPhoneApplication">

          <Application.ApplicationLifetimeObjects>
          <s:XNAFrameworkDispatcherService />
          </Application.ApplicationLifetimeObjects>
          .
          .
          .
          </Application>
          </code>
          </li>

Expand image See Also

Concepts

Initializing, Updating, and Exiting a Game

Reference

SoundEffect
DynamicSoundEffectInstance
Microphone


Displaying Graphics

Displaying Graphics

Describes using XNA graphics for rendering 2D and 3D graphics.

In This Section

Rendering 2D with Sprites and Text
Describes step-by-step procedures for using 2D graphics techniques.
Rendering 3D with Effects
Describes step-by-step procedures for using 3D graphics techniques.
"What Is" Articles for Sprites and Effects
These articles provide a brief introduction into graphics pipeline functionality.

Expand image See Also

Getting Started with 2D Games at XNA Creators Club Online
Getting Started with 3D Games at XNA Creators Club Online


Rendering 2D with Sprites and Text

Rendering 2D with Sprites and Text

Describes step-by-step procedures for using 2D graphics techniques.

In This Section

What Is a Sprite?
Summarizes the basics of using sprites.
Animating a Sprite
Demonstrates how to animate a sprite from a texture using a custom class.
Drawing a Sprite
Demonstrates how to draw a sprite by using the SpriteBatch class.
Rotating a Sprite
Demonstrates how to rotate a sprite around its center.
Rotating a Group of Sprites
Demonstrates how to rotate a group of sprites around a single point using a rotation Matrix.
Scaling a Sprite
Demonstrates how to scale a sprite using a uniform scale.
Scaling Sprites Based On Screen Size
Demonstrates how to scale sprites using a matrix that is created based on the viewport width.
Tinting a Sprite
Demonstrates how to tint a sprite using a Color value.
Tiling a Sprite
Demonstrates how to draw a sprite repeatedly in the x and y directions in one Draw call.
Drawing a Masked Sprite over a Background
Demonstrates how to draw a foreground and background sprite using the SpriteBatch class, where only part of the foreground sprite masks the background.
Making a Scrolling Background
Demonstrates how to draw a scrolling background sprite using the SpriteBatch class.
Drawing Text with a Sprite
Demonstrates how to import a SpriteFont into a project and to draw text using DrawString.

Related Overview Topics

Accessing Pictures from a Picture Album
Demonstrates how to access pictures in a picture album using the Media API on Windows Phone.


What Is a Sprite?

What Is a Sprite?
See Also
CollapseAll image

Sprites are 2D bitmaps that are drawn directly to a render target without using the pipeline for transformations, lighting or effects. Sprites are commonly used to display information such as health bars, number of lives, or text such as scores. Some games, especially older games, are composed entirely of sprites.

  • Overview
  • Sprite Origin
  • Sprite Depth
  • Sampling Textures
  • Sprite Scaling
  • Sprite Transformation Matrices
  • Sprite Fonts
  • Sprite Batching

Overview

Sprites are positioned on the screen by coordinates. The width and height of the screen is the same as the back buffer. The x-axis represents the screen width and the y-axis represents the screen height. The y-axis is measured from the top of the screen and increases as you move down the screen, and the x-axis is measured from left to right. For example, when the graphics back buffer is 800×600, 0,0 is the upper left of the screen, and 800,600 is the lower right of the screen (see Figure 1).

Figure 1. A sprite's location in screen coordinates (x-axis 400, y-axis 200)

To draw a sprite, create a SpriteBatch object, initialize it by calling Begin, and then call Draw for each sprite. The bitmap data for a sprite is taken from a Texture2D object. The texture may contain alpha channel information to make part of the texture transparent or semi-transparent. You can tint, rotate, or scale sprites by using Draw. This method also gives you the option of drawing only part of the texture on the screen. After you draw a sprite, call End before calling Present.

Sprite Origin

When you draw a sprite, the sprite origin is an important concept. The origin is a specific point on the sprite, which is by default the upper-left corner of the sprite, or (0,0). Draw draws the origin of the sprite at the screen location you specify. For example, if you draw a 50×50 pixel sprite at location (400,200) without specifying an origin, the upper left of the sprite will be on pixel (400,200). If you use the center of the 50×50 sprite as the origin (25,25), to draw the sprite in the same position you must add the origin coordinates to the position. In this case, the position is (425,225) and the origin is (25,25), as shown in Figure 2.

Figure 2. The blue dot indicates the center coordinate of the sprite

When rotating a sprite, the method uses the origin as the center of the rotation. In these cases, it is common to use the center of the sprite as the origin when calculating where to draw the sprite on the screen.

Sprite Depth

Sprites also have a concept of depth which is a floating-point number between 0 and 1. Sprites drawn at a depth of 0 are drawn in front of sprites which have a depth of greater than 0; sprites drawn at a depth of 1 are covered by sprites drawn at a depth less than 1.

Sampling Textures

A sprite is based on a Texture2D object—in other words, a bitmap. Use Draw to draw the entire texture or a portion of the texture. To draw a portion of the texture, use the sourceRectangle parameter to specify which texels, or texture pixel, to draw. A 32×32 texture has 1024 texels, specified as x and y values similar to how screen coordinates are specified. Specifying a sourceRectangle of (0, 0, 16, 16) would select the upper-left quadrant of a 32×32 texture.

Sprite Scaling

Draw provides three options for scaling a sprite: using a uniform scaling parameter, a nonuniform scaling parameter, or a source and destination rectangle. The uniform scaling parameter is a floating-point number that multiplies the sprite size through both the x- and y-axes. This will shrink or expand the sprite along each axis equally, maintaining the original ratio between the sprite width and height.

To scale the x- and y-axes independently, Draw accepts a Vector2 value as a scalar. This Vector2 specifies nonuniform scaling: x- and y-axes are scaled independently according to the X and Y fields of the Vector2.

Draw also accepts a source and destination rectangle. The destination rectangle is specified in screen coordinates, while the source rectangle is specified in texels. Draw takes the pixels on the texture specified in sourceRectangle and scales them independently along the x- and y-axes until they fit the screen coordinates specified by destinationRectangle.

Sprite Transformation Matrices

You can also specify a transformation matrix that the batch can apply to each sprite before drawing. The transformation matrix can be any combination of translation, rotation, or scaling matrices multiplied together into a single matrix. This matrix is combined with the sprite position, rotation, scaling, and depth parameters supplied to Draw. Because the matrix also applies to depth, any z-coordinate transformation that makes the sprite depth greater than 1.0 or less than 0.0 will cause the sprite to disappear.

See Rotating a Group of Sprites for an example of matrix rotation and Scaling Sprites Based On Screen Size for an example of matrix scaling.

Sprite Fonts

Use a SpriteBatch to draw text. The DrawString method will draw text on screen with position, color, rotation, origin, and scaling. DrawString also requires a special type of texture encapsulated by the SpriteFont class. A SpriteFont is created by the content pipeline when you add a Sprite Font file to your project. The sprite font file has information such as the name and point size of the font, and which Unicode characters to include in the SpriteFont texture. At run time, a SpriteFont is loaded with ContentManager.Load just like a Texture2D object.

See Sprite Font XML Schema Reference for a list of Sprite Font tags. You can use the content pipeline to determine your character regions automatically. For more information, see How to: Extend the Font Description Processor to Support Additional Characters.

Sprite Batching

In normal drawing, the SpriteBatch object does not change any render states or draw any sprites until you call End. This is known as Deferred mode. In Deferred mode, SpriteBatch saves the information from each Draw call until you call End.

If you call Begin, specifying SpriteSortMode.Immediate, it triggers Immediate mode. In Immediate mode, the SpriteBatch immediately changes the graphics device render states to begin drawing sprites. Thereafter, each call to Draw immediately draws the sprite using the current device settings.

In Immediate mode, once you call Begin on one SpriteBatch instance, do not call it on any other SpriteBatch instance until you call End for the first SpriteBatch.

Deferred mode is slower than Immediate mode, but it allows multiple instances of SpriteBatch to accept Begin and Draw calls without interfering with each other.

Expand image See Also

Getting Started with 2D Games at XNA Creators Club Online


Animating a Sprite

Animating a Sprite

Demonstrates how to animate a sprite from a texture using a custom class.

The example assumes the texture you are loading contains four frames of the same size in a texture whose size is 256×64 pixels, and uses a class named AnimatedTexture, which is included with the sample.

Complete Sample

The code in this topic shows you the animation technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download AnimatedSprite_Sample.zip.

Drawing an Animated Sprite

To draw an animated sprite

  1. In your game's constructor, create an instance of the AnimatedTexture class.

    This example uses (0,0) as the origin of the texture, no rotation, a scale of 2, and a depth of 0.5.

    C#
            private AnimatedTexture SpriteTexture;
        private const float Rotation = 0;
        private const float Scale = 2.0f;
        private const float Depth = 0.5f;
        public Game1()
        {
            ...
            SpriteTexture = new AnimatedTexture(Vector2.Zero,
                Rotation, Scale, Depth);
#if ZUNE
            // Frame rate is 30 fps by default for Zune.
            TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);
#endif
        }

  2. Load one or more textures to provide the image data for the animation.

    In this example, the AnimatedTexture class loads a single texture and divides it into frames of animation. It uses the last parameter to determine how many frames to draw each second. In this case, it draws four frames at two frames per second (fps).

    C#
    private Viewport viewport;
private Vector2 shipPos;
private const int Frames = 4;
private const int FramesPerSec = 2;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);

    // "shipanimated" is the name of the sprite asset in the project.
    SpriteTexture.Load(Content, "shipanimated", Frames, FramesPerSec);
    viewport = graphics.GraphicsDevice.Viewport;
    shipPos = new Vector2(viewport.Width / 2, viewport.Height / 2);
}

  3. In your game's Update method, determine which animation frame to display.

    C#
    protected override void Update(GameTime gameTime)
{
    ...
    float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;

    // TODO: Add your game logic here.
    SpriteTexture.UpdateFrame(elapsed);
    base.Update(gameTime);
}

    This is handled by AnimatedTexture's UpdateFrame method, which takes the elapsed seconds between updates as a parameter.

    C#
    // class AnimatedTexture
public void UpdateFrame(float elapsed)
{
    if (Paused)
        return;
    TotalElapsed += elapsed;
    if (TotalElapsed > TimePerFrame)
    {
        Frame++;
        // Keep the Frame between 0 and the total frames, minus one.
        Frame = Frame % framecount;
        TotalElapsed -= TimePerFrame;
    }
}

  4. In your game's Draw method, call SpriteBatch.Draw on the AnimatedTexture object.

    C#
    protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);

    // TODO: Add your drawing code here
    spriteBatch.Begin();
    SpriteTexture.DrawFrame(spriteBatch, shipPos);
    spriteBatch.End();

    base.Draw(gameTime);
}

    AnimatedTexture draws the sprite using the subrectangle of the texture that contains the desired animation.

    C#
    // class AnimatedTexture
public void DrawFrame(SpriteBatch batch, Vector2 screenPos)
{
    DrawFrame(batch, Frame, screenPos);
}
public void DrawFrame(SpriteBatch batch, int frame, Vector2 screenPos)
{
    int FrameWidth = myTexture.Width / framecount;
    Rectangle sourcerect = new Rectangle(FrameWidth * frame, 0,
        FrameWidth, myTexture.Height);
    batch.Draw(myTexture, screenPos, sourcerect, Color.White,
        Rotation, Origin, Scale, SpriteEffects.None, Depth);
}

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch
Draw
Texture2D


Drawing a Sprite

Demonstrates how to draw a sprite by using the SpriteBatch class.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download SpriteDemo_Sample.zip.

Drawing a Sprite

To draw a sprite on screen

  1. Derive a class from Game.

  2. Define a SpriteBatch object as a field on your game class.

  3. In your LoadContent method, construct the SpriteBatch object, passing the current graphics device.

  4. Load the textures that will be used for drawing sprites in LoadContent.

    In this case, the example uses the Content member to load a texture from the XNA Framework Content Pipeline. The texture must be in the project, with the same name passed to Load.

    C#
    private Texture2D SpriteTexture;
private Rectangle TitleSafe;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);
    SpriteTexture = Content.Load<Texture2D>("ship");
    TitleSafe = GetTitleSafeArea(.8f);
}

  5. In the overridden Draw method, call Clear.

  6. After Clear, call Begin on your SpriteBatch object.

  7. Create a Vector2 to represent the screen position of the sprite.

    On Xbox 360, be careful not to draw foreground sprites on the outer 10 or 20 percent of the screen. Some televisions may obscure the edges of the screen. The GetTitleSafeArea function calculates the area of the current Viewport that is safe, given a specified safety percentage.

    C#
            protected Rectangle GetTitleSafeArea(float percent)
        {
            Rectangle retval = new Rectangle(
                graphics.GraphicsDevice.Viewport.X,
                graphics.GraphicsDevice.Viewport.Y,
                graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height);
#if XBOX
            // Find Title Safe area of Xbox 360.
            float border = (1 - percent) / 2;
            retval.X = (int)(border * retval.Width);
            retval.Y = (int)(border * retval.Height);
            retval.Width = (int)(percent * retval.Width);
            retval.Height = (int)(percent * retval.Height);
            return retval;
#else
            return retval;
#endif
        }

  8. Call Draw on your SpriteBatch object, passing the texture to draw, the screen position, and the color to apply.

  9. Use Color.White to draw the texture without any color effects.

  10. When all the sprites have been drawn, call End on your SpriteBatch object.

    C#
    protected override void Draw(GameTime gameTime)
{
    graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
    spriteBatch.Begin();
    Vector2 pos = new Vector2(TitleSafe.Left, TitleSafe.Top);
    spriteBatch.Draw(SpriteTexture, pos, Color.White);
    spriteBatch.End();
    base.Draw(gameTime);
}

Expand image See Also

Concepts

What Is a Sprite?

Reference

SpriteBatch
Draw
Texture2D


Rotating a Sprite

Rotating a Sprite

Demonstrates how to rotate a sprite around its center.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download RotateSprite_Sample.zip.

Drawing a Rotated Sprite

To draw a rotated sprite on screen

  1. Follow the procedures of Drawing a Sprite.

  2. Determine the screen location of the sprite, and the point within the texture that will serve as the origin.

    By default, the origin of a texture is (0,0), the upper-left corner. When you draw a sprite, the origin point in the texture is placed on the screen coordinate specified by the at parameter. In this example, the origin is the center of the texture, and the screen position is the center of the screen.

    C#
    private Texture2D SpriteTexture;
private Vector2 origin;
private Vector2 screenpos;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);
    SpriteTexture = Content.Load<Texture2D>("ship");
    Viewport viewport = graphics.GraphicsDevice.Viewport;
    origin.X = SpriteTexture.Width / 2;
    origin.Y = SpriteTexture.Height / 2;
    screenpos.X = viewport.Width / 2;
    screenpos.Y = viewport.Height / 2;
}

  3. In your Update method, determine the rotation angle to use for the sprite.

    The angle is specified in radians, and it can be greater than two times p, but does not need to be.

    C#
    private float RotationAngle;
protected override void Update(GameTime gameTime)
{
    // Allows the game to exit
    if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
        this.Exit();

    if (Keyboard.GetState().IsKeyDown(Keys.Escape))
        this.Exit();

    // The time since Update was called last.
    float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;

    // TODO: Add your game logic here.
    RotationAngle += elapsed;
    float circle = MathHelper.Pi * 2;
    RotationAngle = RotationAngle % circle;

    base.Update(gameTime);
}

  4. In your Draw method, call SpriteBatch.Draw with the texture, angle, screen position, and origin of the texture.

    C#
    protected override void Draw(GameTime gameTime)
{
    graphics.GraphicsDevice.Clear(Color.CornflowerBlue);

    // TODO: Add your drawing code here
    spriteBatch.Begin();
    spriteBatch.Draw(SpriteTexture, screenpos, null, Color.White, RotationAngle,
        origin, 1.0f, SpriteEffects.None, 0f);
    spriteBatch.End();

    base.Draw(gameTime);
}

  5. When all the sprites have been drawn, call End on your SpriteBatch object.

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch
Draw
Texture2D


Rotating a Group of Sprites

Rotating a Group of Sprites

Demonstrates how to rotate a group of sprites around a single point using a rotation Matrix. The example uses two techniques. The first technique rotates the sprite positions manually during Update. The second technique creates a rotation matrix during Update that SpriteBatch can use during Draw.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download RotateSpriteGroup_Sample.zip.

Drawing a Rotated Group of Sprites

To draw a rotated group of sprites on screen

  1. Follow the steps of Drawing a Sprite.

  2. Create one set of Vector2 objects that represents the unrotated positions of the sprites and one set to hold the rotated values.

    C#
    private Vector2[] myVectors;
private Vector2[] drawVectors;
protected override void Initialize()
{
    myVectors = new Vector2[9];
    drawVectors = new Vector2[9];

    base.Initialize();
}

  3. After loading the sprite, calculate the positions of the unrotated group of sprites based on the sprite's size.

    C#
    private Texture2D SpriteTexture;
private Vector2 origin;
private Vector2 screenpos;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);

    SpriteTexture = Content.Load<Texture2D>("ship");
    origin.X = SpriteTexture.Width / 2;
    origin.Y = SpriteTexture.Height / 2;
    Viewport viewport = graphics.GraphicsDevice.Viewport;
    screenpos.X = viewport.Width / 2;
    screenpos.Y = viewport.Height / 2;
}

  4. In your Update method, copy the unrotated vectors and determine the screen position around which all the sprites will rotate.

    C#
    private float RotationAngle = 0f;
private bool batchAutoRotate = false;
private Matrix rotationMatrix = Matrix.Identity;
protected override void Update(GameTime gameTime)
{
    ...
    float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;

    RotationAngle += elapsed;
    float circle = MathHelper.Pi * 2;
    RotationAngle = RotationAngle % circle;

    // Copy and rotate the sprite positions.
    drawVectors = (Vector2[])myVectors.Clone();

    if (!batchAutoRotate)
        RotatePoints(ref screenpos, RotationAngle, ref drawVectors);
    else
        UpdateMatrix(ref screenpos, RotationAngle);

    base.Update(gameTime);
}

    Transform each vector using a rotation matrix created for the rotation angle.

  5. To rotate around the origin, transform each vector relative to the origin by subtracting the origin vector.

  6. Add the origin vector to the transformed vector to create the final rotated vector.

    C#
    private static void RotatePoints(ref Vector2 origin, float radians,
    ref Vector2[] Vectors)
{
    Matrix myRotationMatrix = Matrix.CreateRotationZ(radians);

    for (int i = 0; i < 9; i++)
    {
        // Rotate relative to origin.
        Vector2 rotatedVector =
            Vector2.Transform(Vectors[i] - origin, myRotationMatrix);

        // Add origin to get final location.
        Vectors[i] = rotatedVector + origin;
    }
}

  7. Draw each sprite using the rotated vectors as screen locations.

    C#
    private void DrawPoints()
{
    // Draw using manually rotated vectors
    spriteBatch.Begin();
    for (int i = 0; i < drawVectors.Length; i++)
        spriteBatch.Draw(SpriteTexture, drawVectors[i], null,
            Color.White, RotationAngle, origin, 1.0f,
            SpriteEffects.None, 0f);
    spriteBatch.End();
}

  8. When all the sprites have been drawn, call End.

To draw a rotated group of sprites on screen using SpriteBatch transformation

  1. Follow the steps of Drawing a Sprite.

  2. Create one set of Vector2 objects that represents the unrotated positions of the sprites and one set to hold the rotated values.

    C#
    private Vector2[] myVectors;
private Vector2[] drawVectors;
protected override void Initialize()
{
    myVectors = new Vector2[9];
    drawVectors = new Vector2[9];

    base.Initialize();
}

  3. After loading the sprite, calculate the positions of the unrotated group of sprites based on the sprite's size.

    C#
    private Texture2D SpriteTexture;
private Vector2 origin;
private Vector2 screenpos;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);

    SpriteTexture = Content.Load<Texture2D>("ship");
    origin.X = SpriteTexture.Width / 2;
    origin.Y = SpriteTexture.Height / 2;
    Viewport viewport = graphics.GraphicsDevice.Viewport;
    screenpos.X = viewport.Width / 2;
    screenpos.Y = viewport.Height / 2;
}

  4. In your Update method, copy the unrotated vectors and determine the screen position around which all the sprites will rotate.

    C#
    private float RotationAngle = 0f;
private bool batchAutoRotate = false;
private Matrix rotationMatrix = Matrix.Identity;
protected override void Update(GameTime gameTime)
{
    ...
    float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;

    RotationAngle += elapsed;
    float circle = MathHelper.Pi * 2;
    RotationAngle = RotationAngle % circle;

    // Copy and rotate the sprite positions.
    drawVectors = (Vector2[])myVectors.Clone();

    if (!batchAutoRotate)
        RotatePoints(ref screenpos, RotationAngle, ref drawVectors);
    else
        UpdateMatrix(ref screenpos, RotationAngle);

    base.Update(gameTime);
}

  5. Create a rotation matrix for SpriteBatch to use during Draw.

  6. To rotate around a point that is not the upper-left corner of the screen, first subtract the origin of your rotation using a translation matrix.

  7. Multiply the translation matrix by the rotation matrix.

  8. Multiply the result by a translation matrix adding the origin of your rotation.

    This is because a rotation matrix must rotate around (0,0,0).

    C#
    private void UpdateMatrix(ref Vector2 origin, float radians)
{
    // Translate sprites to center around screen (0,0), rotate them, and
    // translate them back to their original positions
    Vector3 matrixorigin = new Vector3(origin, 0);
    rotationMatrix = Matrix.CreateTranslation(-matrixorigin) *
        Matrix.CreateRotationZ(radians) *
        Matrix.CreateTranslation(matrixorigin);
}

  9. In your Draw method, call SpriteBatch.Begin, specifying the rotation matrix as the fourth parameter.

    C#
    private void DrawMatrix()
{
    // Draw using a rotation matrix with SpriteBatch
    spriteBatch.Begin();
    for (int j = 0; j < myVectors.Length; j++)
        spriteBatch.Draw(SpriteTexture, myVectors[j], null, Color.White,
            0, origin, 1.0f, SpriteEffects.None, 0f);
    spriteBatch.End();
}

  10. When all the sprites have been drawn, call End.

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch
Draw
Texture2D
CreateRotationZ


Scaling a Sprite

Scaling a Sprite

Demonstrates how to scale a sprite using a uniform scale.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download ScaleSprite_Sample.zip.

Drawing a Scaled Sprite

To draw a scaled sprite with a uniform scale

  1. Follow the procedures of Drawing a Sprite.

  2. In your Update method, determine how your sprite will be scaled.

    The normal size of the sprite is multiplied by the scale specified. For example, a value of 1.0 draws the sprite full size, where 0.5 will draw it half-sized and 2.0 will draw it at twice its original size.

    C#
            protected float scale = 1f;
        protected override void Update(GameTime gameTime)
        {
            ...

#if WINDOWS
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
                this.Exit();
#endif

            // The time since Update was called last.
            float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;

            // TODO: Add your game logic here.
            scale += elapsed;
            scale = scale % 6;

            base.Update(gameTime);
        }

  3. When drawing the sprite, specify the scale of the sprite as a parameter to draw.

    Specifying a floating-point scale parameter scales the sprite evenly in both the x and y directions.

    C#
    protected virtual void DrawForeground(SpriteBatch batch)
{
    Rectangle safeArea = GetTitleSafeArea(.8f);
    Vector2 position = new Vector2(safeArea.X, safeArea.Y);
    batch.Begin();
    batch.Draw(SpriteTexture, position, null,
        Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f);
    batch.End();
}
  4. When all the sprites have been drawn, call End on your SpriteBatch object.

To draw a scaled sprite using a nonuniform scale

  1. Follow the procedures of Drawing a Sprite.

  2. In your Update method, determine how your sprite will be scaled along each axis and store those values in a Vector2 object.

    C#
    protected Vector2 nonuniformscale = Vector2.One;
protected override void Update(GameTime gameTime)
{
    base.Update(gameTime);
    float basescale = nonuniformscale.Y;
    basescale += (float)gameTime.ElapsedGameTime.TotalSeconds;
    basescale = basescale % 6;
    nonuniformscale.Y = basescale;
    nonuniformscale.X = basescale * .8f;
}

  3. When drawing the sprite, specify the scale of the sprite using the Vector2 object that you updated earlier.

    Specifying a Vector2 scales the sprite independently in both the x and y directions.

    C#
    protected override void DrawForeground(SpriteBatch batch)
{
    Rectangle safeArea = GetTitleSafeArea(.8f);
    Vector2 position = new Vector2(safeArea.X, safeArea.Y);
    batch.Begin();
    batch.Draw(SpriteTexture, position, null, Color.White, 0, Vector2.Zero,
        nonuniformscale, SpriteEffects.None, 0);
    batch.End();
}

  4. When all of the sprites have been drawn, call End on your SpriteBatch object.

To draw a scaled sprite using a destination rectangle

  1. Follow the procedures of Drawing a Sprite.

  2. In your Update method, construct a rectangle that defines where on screen the sprite will be drawn.

    This rectangle does not need to be the same shape or size as the original sprite. Each dimension of the sprite is scaled independently to fit the destination rectangle.

    C#
    protected Rectangle destrect;
protected override void Update(GameTime gameTime)
{
    destrect = new Rectangle();
    Rectangle safeArea = GetTitleSafeArea(.8f);
    destrect.X = safeArea.X;
    destrect.Y = safeArea.Y;
    destrect.Width = (int)scale * 100;
    destrect.Height = (int)scale * 80;
    base.Update(gameTime);
}

  3. When drawing the sprite, specify the destination rectangle as a parameter to Draw.

    The sprite will be drawn, filling the destination rectangle.

    C#
    protected override void DrawForeground(SpriteBatch batch)
{
    batch.Begin();
    batch.Draw(SpriteTexture, destrect, Color.White);
    batch.End();
}

  4. When all of the sprites have been drawn, call End on your SpriteBatch object.

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch
Draw
Texture2D


Scaling Sprites Based On Screen Size

Demonstrates how to scale sprites using a matrix that is created based on the viewport width.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download ScaleScreen_Sample.zip.

Scaling Sprites Based on Screen Size

To scale sprites based on screen size

  1. Use the PreferredBackBufferHeight and PreferredBackBufferWidth properties of GraphicsDeviceManager during your game's Initialize to set the default screen size of your game.

  2. In your LoadContent method, use Matrix.CreateScale to create a scaling matrix.

    This matrix is recreated any time the resolution of the GraphicsDevice changes.

    Because you are scaling sprites, you should use only the x and y parameters to create the scaling matrix. Scaling the depth of sprites can result in their depth shifting above 1.0. If that happens, they will not render.

    C#
    protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);

    ...

    // Default resolution is 800x600; scale sprites up or down based on
    // current viewport
    float screenscale =
        (float)graphics.GraphicsDevice.Viewport.Width / 800f;
    // Create the scale transform for Draw.
    // Do not scale the sprite depth (Z=1).
    SpriteScale = Matrix.CreateScale(screenscale, screenscale, 1);
}

  3. In your Update method, determine whether the game needs to change screen resolution.

    This example uses game pad buttons to switch between two resolutions.

    C#
    protected override void Update(GameTime gameTime)
{
    ...
    // Change the resolution dynamically based on input
    if (GamePad.GetState(PlayerIndex.One).Buttons.A ==
        ButtonState.Pressed)
    {
        graphics.PreferredBackBufferHeight = 768;
        graphics.PreferredBackBufferWidth = 1024;
        graphics.ApplyChanges();
    }
    if (GamePad.GetState(PlayerIndex.One).Buttons.B ==
        ButtonState.Pressed)
    {
        graphics.PreferredBackBufferHeight = 600;
        graphics.PreferredBackBufferWidth = 800;
        graphics.ApplyChanges();
    }

    if (Keyboard.GetState().IsKeyDown(Keys.A))
    {
        graphics.PreferredBackBufferHeight = 768;
        graphics.PreferredBackBufferWidth = 1024;
        graphics.ApplyChanges();
    }
    if (Keyboard.GetState().IsKeyDown(Keys.B))
    {
        graphics.PreferredBackBufferHeight = 600;
        graphics.PreferredBackBufferWidth = 800;
        graphics.ApplyChanges();
    }

    base.Update(gameTime);
}

  4. In your Draw method, call SpriteBatch.Begin, passing the scaling matrix created in LoadContent.

  5. Draw your scene normally, then call SpriteBatch.End.

    All of the sprites you draw will be scaled according to the matrix.

    C#
    protected override void Draw(GameTime gameTime)
{
    ...
    // Initialize the batch with the scaling matrix
    spriteBatch.Begin();
    // Draw a sprite at each corner
    for (int i = 0; i < spritepos.Length; i++)
    {
        spriteBatch.Draw(square, spritepos[i], null, Color.White,
            rotation, origin, scale, SpriteEffects.None, depth);
    }
    spriteBatch.End();
    base.Draw(gameTime);
}

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch
Draw
Texture2D
Matrix.CreateScale


Tinting a Sprite

Tinting a Sprite

Demonstrates how to tint a sprite using a Color value.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download TintSprite_Sample.zip.

Drawing a Tinted Sprite

To draw a tinted sprite

  1. Follow the procedures of Drawing a Sprite.

  2. In the Update method, determine how to tint the sprite.

    In this example, the value of the game pad thumbsticks determine the Red, Green, Blue, and Alpha values to apply to the sprite.

    C#
    protected Color tint;
protected override void Update(GameTime gameTime)
{
    ...
    GamePadState input = GamePad.GetState(PlayerIndex.One);
    tint = new Color(GetColor(input.ThumbSticks.Left.X),
        GetColor(input.ThumbSticks.Left.Y),
        GetColor(input.ThumbSticks.Right.X),
        GetColor(input.ThumbSticks.Right.Y));

    base.Update(gameTime);
}

  3. In the Draw method, pass the color value created in Update to SpriteBatch.Draw.

    C#
    protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);

    spriteBatch.Begin();
    spriteBatch.Draw(SpriteTexture, position, tint);
    spriteBatch.End();

    base.Draw(gameTime);
}

  4. When all of the sprites have been drawn, call End on your SpriteBatch object.

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch
Draw
Texture2D
Color


Tiling a Sprite

Demonstrates how to draw a sprite repeatedly in the x and y directions in one Draw call.

This sample uses a texture addressing mode to duplicate a texture across the area defined by SpriteBatch.Draw. Other address modes, such as mirroring, can create interesting results.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download TiledSprites_Sample.zip.

Tiling a Sprite

To tile a sprite

  1. Follow the procedures of Drawing a Sprite.

  2. In the Draw method, create a Rectangle to define the area to fill.

    The destination Rectangle can be any size. In this example, the width and height of the destination rectangle are integer multiples of the source sprite. This will cause the sprite texture to be tiled, or drawn several times, to fill the destination area.

    C#
    spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.Opaque, SamplerState.LinearWrap,
    DepthStencilState.Default, RasterizerState.CullNone);

  3. Call SpriteBatch.Begin to set the sprite state.

  4. Set the TextureAddressMode in the SamplerState to TextureAddressMode.LinearWrap.

    C#
    spriteBatch.Draw(spriteTexture, Vector2.Zero, destRect, color, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
  5. Call SpriteBatch.Draw with the sprite, the destination rectangle, and other relevant parameters.
  6. Call End on your SpriteBatch object.
    C#
    spriteBatch.End();

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch
Draw
SpriteSortMode
Texture2D


Drawing a Masked Sprite over a Background

Drawing a Masked Sprite over a Background

Demonstrates how to draw a foreground and background sprite using the SpriteBatch class, where only part of the foreground sprite masks the background.

The foreground sprite in this example must include masking information.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download BackgroundSprite_Sample.zip.

Drawing a Foreground and Background Sprite

To draw a foreground and background sprite

  1. Create the game class, and load your content as described in the procedures of Drawing a Sprite.

    C#
    private Vector2 ViperPos;  // Position of foreground sprite on screen
private int ScrollHeight; // Height of background sprite
private Viewport viewport;
Texture2D ShipTexture;
Texture2D StarTexture;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);

    StarTexture = Content.Load<Texture2D>("starfield");
    ShipTexture = Content.Load<Texture2D>("ship");
    viewport = graphics.GraphicsDevice.Viewport;

    ViperPos.X = viewport.Width / 2;
    ViperPos.Y = viewport.Height - 100;
    ScrollHeight = StarTexture.Height;
}

  2. In Draw, call Begin for the SpriteBatch.

  3. Specify BlendState.None.

    This will tell the SpriteBatch to ignore alpha color values when drawing sprites. By default, the z-order of sprites is the order in which they are drawn.

  4. Draw the background sprites, and then call End.

    C#
    spriteBatch.Begin();
DrawBackground(spriteBatch);
spriteBatch.End();

  5. Call Begin for the SpriteBatch again.

  6. This time, specify BlendState.AlphaBlend.

    This will cause pixels on the sprite with an alpha value less than 255 to become progressively transparent based on the magnitude of the alpha value. An alpha of 0 will make the pixel completely transparent. Calling Begin with no parameters causes SpriteBatch to default to BlendState.AlphaBlend.

  7. Draw the foreground sprites, then call End.

    C#
    spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
DrawForeground(spriteBatch);
spriteBatch.End();

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch
Draw
Texture2D


Making a Scrolling Background

Making a Scrolling Background

Demonstrates how to draw a scrolling background sprite using the SpriteBatch class.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download ScrollingBackground_Sample.zip.

Drawing a Scrolling Background Sprite

To draw a scrolling background sprite

  1. Create the game class.

  2. Load resources as described in the procedures of Drawing a Sprite.

  3. Load the background texture.

    C#
    private ScrollingBackground myBackground;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);
    myBackground = new ScrollingBackground();
    Texture2D background = Content.Load<Texture2D>("starfield");
    myBackground.Load(GraphicsDevice, background);
}

  4. Determine the size of the background texture and the size of the screen.

    The texture size is determined using the Height and Width properties, and the screen size is determined using the Viewport property on the graphics device.

  5. Using the texture and screen information, set the origin of the texture to the center of the top edge of the texture, and the initial screen position to the center of the screen.

    C#
    // class ScrollingBackground
private Vector2 screenpos, origin, texturesize;
private Texture2D mytexture;
private int screenheight;
public void Load( GraphicsDevice device, Texture2D backgroundTexture )
{
    mytexture = backgroundTexture;
    screenheight = device.Viewport.Height;
    int screenwidth = device.Viewport.Width;
    // Set the origin so that we're drawing from the
    // center of the top edge.
    origin = new Vector2( mytexture.Width / 2, 0 );
    // Set the screen position to the center of the screen.
    screenpos = new Vector2( screenwidth / 2, screenheight / 2 );
    // Offset to draw the second texture, when necessary.
    texturesize = new Vector2( 0, mytexture.Height );
}

  6. To scroll the background, change the screen position of the background texture in your Update method.

    This example moves the background down 100 pixels per second by increasing the screen position's Y value.

    C#
    protected override void Update(GameTime gameTime)
{
    ...
    // The time since Update was called last.
    float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;

    // TODO: Add your game logic here.
    myBackground.Update(elapsed * 100);

    base.Update(gameTime);
}

    The Y value is kept no larger than the texture height, making the background scroll from the bottom of the screen back to the top.

    C#
    public void Update( float deltaY )
{
    screenpos.Y += deltaY;
    screenpos.Y = screenpos.Y % mytexture.Height;
}
// ScrollingBackground.Draw

  7. Draw the background using the origin and screen position calculated in LoadContent and Update.

    C#
    protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);

    spriteBatch.Begin();
    myBackground.Draw(spriteBatch);
    spriteBatch.End();

    base.Draw(gameTime);
}

    In case the texture doesn't cover the screen, another texture is drawn. This subtracts the texture height from the screen position using the texturesize vector created at load time. This creates the illusion of a loop.

    C#
    public void Draw( SpriteBatch batch )
{
    // Draw the texture, if it is still onscreen.
    if (screenpos.Y < screenheight)
    {
        batch.Draw( mytexture, screenpos, null,
             Color.White, 0, origin, 1, SpriteEffects.None, 0f );
    }
    // Draw the texture a second time, behind the first,
    // to create the scrolling illusion.
    batch.Draw( mytexture, screenpos - texturesize, null,
         Color.White, 0, origin, 1, SpriteEffects.None, 0f );
}

Expand image See Also

Tasks

Drawing a Sprite
Drawing a Masked Sprite over a Background

Concepts

What Is a Sprite?

Reference

SpriteBatch
Draw
Texture2D


Drawing Text with a Sprite

Drawing Text with a Sprite

Demonstrates how to import a SpriteFont into a project and to draw text using DrawString.

Important
As with most types of software, font files are licensed rather than sold. Font licenses vary from vendor to vendor, but most do not allow redistribution of fonts, including the redistribution of reproductions such as bitmaps containing the rasterized character set. This is true for many of the licenses covering fonts that Microsoft supplies with applications and the Windows operating systems. Therefore, be careful that you have the required license rights to redistribute any font you include as a bitmap containing the rasterized character set in your game.
Note

The following list of fonts are installed by XNA Game Studio and are redistributable:

Font | Filename(s)
Kootenay | Kooten.ttf
Lindsey | Linds.ttf
Miramonte | Miramo.ttf, Bold Miramob.ttf (bold)
Pericles | Peric.ttf, Pericl.ttf (bold)
Pescadero | Pesca.ttf, Pescab.ttf (bold)

These OpenType fonts, created by Ascender Corporation and licensed by Microsoft, are free for you to use in your XNA Game Studio game. You may redistribute these fonts in their original format as part of your game. These fonts were previously available only on the XNA Creators Club Online Web site.

Complete Sample

The code in this topic shows you the draw technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download FontDemo_Sample.zip.

Adding a Sprite Font and Drawing Text

To add a sprite font

  1. Right-click your Content project in Solution Explorer, click Add, and then click New Item.

  2. In the Add New Item dialog box, click Sprite Font.

    You may find it convenient at this point to change the name of the new file from "SpriteFont1" to the friendly name of the font you intend to load (keeping the .spritefont file extension). The friendly name identifies the font once it is installed on your computer, for example, "Courier New" or "Times New Roman." When you reference the font in your code, you must use the friendly name you have assigned it.

    XNA Game Studio creates a new .spritefont file for your font and opens it.

  3. If you did not name the new file with the font's friendly name, type the friendly name of the font to load into the FontName element.

    Again, this is not the name of a font file, but rather the name that identifies the font once it is installed on your computer. You can use the Fonts folder in the Control Panel to see the names of fonts installed on your system, and to install new ones. The content pipeline supports the same fonts as the System.Drawing.Font class, including TrueType fonts, but not bitmap (.fon) fonts. You may find it convenient to save the new .spritefont file using this friendly name. When you reference the font in your code, you must use the friendly name you have assigned it.

  4. If necessary, change the Size entry to the point size you desire for your font.

  5. If necessary, change the Style entry to the style of font to import.

    You can specify Regular, Bold, Italic, or Bold, Italic. The Style entry is case sensitive.

  6. Specify the character regions to import for this font.

    Character regions specify which characters in the font are rendered by the SpriteFont. You can specify the start and end of the region by using the characters themselves, or by using their decimal values with an &# prefix. The default character region includes all the characters between the space and tilde characters, inclusive.

To draw text on the screen

  1. Add a Sprite Font to your project as described above.

  2. Create a SpriteFont object to encapsulate the imported font.

  3. Create a SpriteBatch object for drawing the font on the screen.

  4. In your LoadContent method, call ContentManager.Load, specifying the SpriteFont class and the asset name of the imported font.

  5. Create your SpriteBatch object, passing the current GraphicsDevice.

    C#
    SpriteFont Font1;
Vector2 FontPos;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);
    Font1 = Content.Load<SpriteFont>("Courier New");

    // TODO: Load your game content here
    FontPos = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2,
        graphics.GraphicsDevice.Viewport.Height / 2);
}

  6. In your Draw method, call Begin on the SpriteBatch object.

  7. If necessary, determine the origin of your text.

    If you want to draw your text centered on a point, you can find the center of the text by calling MeasureString and dividing the returned vector by 2.

  8. Call DrawString to draw your output text, specifying the SpriteFont object for the font you want to use.

    All other parameters of DrawString produce the same effects as a call to SpriteBatch.Draw.

  9. Call SpriteBatch.End after all text is drawn.

    C#
    protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);

    spriteBatch.Begin();

    // Draw Hello World
    string output = "Hello World";

    // Find the center of the string
    Vector2 FontOrigin = Font1.MeasureString(output) / 2;
    // Draw the string
    spriteBatch.DrawString(Font1, output, FontPos, Color.LightGreen,
        0, FontOrigin, 1.0f, SpriteEffects.None, 0.5f);

    spriteBatch.End();
    base.Draw(gameTime);
}

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch
DrawString
SpriteFont
ContentManager.Load


Rendering 3D with Effects

Rendering 3D with Effects

Describes step-by-step procedures for using 3D graphics techniques.

In This Section

3D Pipeline Basics
The 3D graphics pipeline uses a graphics device to load resources and render a 3D scene using an effect.
Creating a Basic Effect
Demonstrates how to create and initialize an instance of the BasicEffect class and use it to draw simple geometry.
Using a Basic Effect with Texturing
Demonstrates how to create and draw a simple quad—two triangles that form a rectangle or square—using DrawUserIndexedPrimitives.
Rendering a Model with a Basic Effect
Demonstrates how to load and render a model using the XNA Framework Content Pipeline.
Creating a Custom Effect
Demonstrates how to create a custom effect that transforms an object and applies a texture.
Creating a Custom Effect with Texturing
Demonstrates how to use a custom effect and a texture to render a 3D object.
Drawing a Sprite Over a Model
Demonstrates how to draw a sprite so that it obscures a model.
Enabling Antialiasing (Multisampling)
Demonstrates how to enable antialiasing for your game.
Creating a Render Target
Demonstrates how to create a render target using the RenderTarget2D class.
Creating a State Object
Demonstrates how to create a state object using any of the state object classes: BlendState, DepthStencilState, RasterizerState, or SamplerState.
Creating a Custom Vertex Declaration
Demonstrates how to create a custom vertex declaration and use it to render a 3D object.
Drawing 3D Primitives using Lists or Strips
Demonstrates how to draw 3D primitives using lines and triangles arranged as strips or lists.
Dynamically Updating Vertices
Describes several techniques for implementing dynamic vertex buffers in an XNA Framework game.
Displaying Multiple Screens with Viewports
Demonstrates how to use viewports to display different scenes simultaneously using two cameras.
Creating a SkySphere
Demonstrates how to create an effect that will apply a skybox-style cube map to a sphere.
Creating a Depth Texture
Demonstrates how to create a texture that contains depth information for a scene using a render target and a custom effect.
Transformations and Collision Testing
Provides classes and methods for manipulating vectors and matrices.


3D Pipeline Basics

3D Pipeline Basics

The 3D graphics pipeline uses a graphics device to load resources and render a 3D scene using an effect.

In general, the 3D pipeline requires the following state for initialization:

  • World, view, and projection transforms to transform 3D vertices into a 2D space.
  • A vertex buffer which contains the geometry to render.
  • An effect that sets the render state necessary for drawing the geometry.

As you become comfortable with these ideas, you may want to learn more about the following: manipulating vertices, creating your own effects, applying textures, or improving performance by using index buffers.

The XNA Framework uses a shader-driven programmable pipeline. It requires a graphics card capable of at least Shader Model 2.0. The XNA Framework provides a class called BasicEffect that encapsulates most of these common operations.

The Graphics Device

When you create a game with XNA Game Studio, the XNA application model initializes a graphics device for you.

The GraphicsDeviceManager initializes the GraphicsDevice before you call Game.Initialize. Before you call Initialize, there are three ways to change the GraphicsDevice settings:

  1. Set the appropriate properties (e.g. PreferredBackBufferHeight, PreferredBackBufferWidth) on the GraphicsDeviceManager in your game's constructor.

  2. Handle the PreparingDeviceSettings event on the GraphicsDeviceManager, and change the PreparingDeviceSettingsEventArgs.GraphicsDeviceInformation.PresentationParameters member properties.

    Any changes made to the PreparingDeviceSettingsEventArgs will override the GraphicsDeviceManager preferred settings.

  3. Handle the DeviceCreated event on the GraphicsDeviceManager, and change the PresentationParameters of the GraphicsDevice directly.

When you call Game.Initialize, GraphicsDeviceManager creates and configures GraphicsDevice. You can safely access GraphicsDevice settings such as the backbuffer, depth/stencil buffer, viewport, and render states in Initialize.

After you call Game.Initialize, changes to the PresentationParameters of the GraphicsDevice will not take effect until you call GraphicsDeviceManager.ApplyChanges. Other changes, such as render states, will take effect immediately.

Resources

A resource is a collection of data stored in memory that can be accessed by the CPU or GPU. Types of resources that an application might use include render targets, vertex buffers, index buffers, and textures.

Based on the resource management mode that was used when a resource is created, it should be reloaded when the device is reset. For more information, see Loading Resources.

Vertex and Index Buffers

A vertex buffer contains a list of 3D vertices to be streamed to the graphics device. Each vertex in a vertex buffer may contain data about not only the 3D coordinate of the vertex, but also other information describing the vertex, such as the vertex normal, color, or texture coordinate. The XNA Framework contains several classes to describe common vertex declaration types, such as VertexPositionColor, VertexPositionColorTexture, VertexPositionNormalTexture, and VertexPositionTexture. Use the VertexElement class to compose custom vertex types.

Vertex buffers contain indexed or non-indexed vertex data.

If a vertex buffer is not indexed, all of the vertices are placed in the vertex buffer in the order they are to be rendered. Because 3D line lists or triangle lists often reference the same vertices multiple times, this can result in a large amount of redundant data.

Index buffers allow you to list each vertex only once in the vertex buffer. An index buffer is a list of indices into the vertex buffer, given in the order that you want the vertices to render.

To render a non-indexed vertex buffer, call the GraphicsDevice.DrawPrimitives Method or GraphicsDevice.DrawUserPrimitives Method. To render an indexed buffer, call the GraphicsDevice.DrawIndexedPrimitives Method or GraphicsDevice.DrawUserIndexedPrimitives Method.

Textures

A texture resource is a structured collection of texture data. The data in a texture resource is made up of one or more subresources that are organized into arrays and mipmap chains. Textures are filtered by a texture sampler as they are read. The type of texture influences how the texture is filtered.

You can apply textures by using the Texture property of the BasicEffect class, or choose to write your own effect methods to apply textures.

Expand image See Also

Concepts

Getting Started with 3D Games at XNA Creators Club Online
Shader Content Catalog at XNA Creators Club Online


Creating a Basic Effect

Creating a Basic Effect

Demonstrates how to create and initialize an instance of the BasicEffect class and use it to draw simple geometry.
Note
The steps described here apply to effects created with the BasicEffect class. Use the Effect class to write a custom effect.

The Complete Sample

You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download UseBasicEffect.zip.

Using BasicEffect

To use BasicEffect

Using the basic effect class requires a set of world, view, and projection matrices, a vertex buffer, a vertex declaration, and an instance of the BasicEffect class.

  1. Declare these objects at the beginning of the game.

    C#
    Matrix worldMatrix;
Matrix viewMatrix;
Matrix projectionMatrix;
VertexPositionNormalTexture[] cubeVertices;
VertexDeclaration vertexDeclaration;
VertexBuffer vertexBuffer;
BasicEffect basicEffect;

  2. Initialize the world, view, and projection matrices.

    In this example, you create a world matrix that rotates the geometry 22.5 degrees along the x and y axes. The view matrix is a look-at matrix with a camera position at (0, 0, 5), pointing at the origin. The projection matrix is a perspective projection matrix based on a a 45-degree field of view, an aspect ratio equal to the client window, and a set of near and far planes.

    C#
    float tilt = MathHelper.ToRadians(0);  // 0 degree angle
// Use the world matrix to tilt the cube along x and y axes.
worldMatrix = Matrix.CreateRotationX(tilt) * Matrix.CreateRotationY(tilt);
viewMatrix = Matrix.CreateLookAt(new Vector3(5, 5, 5), Vector3.Zero, Vector3.Up);

projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
    MathHelper.ToRadians(45),  // 45 degree angle
    (float)GraphicsDevice.Viewport.Width /
    (float)GraphicsDevice.Viewport.Height,
    1.0f, 100.0f);

  3. Initialize BasicEffect with transformation and light values.

    C#
    basicEffect = new BasicEffect(graphics.GraphicsDevice);

basicEffect.World = worldMatrix;
basicEffect.View = viewMatrix;
basicEffect.Projection = projectionMatrix;

// primitive color
basicEffect.AmbientLightColor = new Vector3(0.1f, 0.1f, 0.1f);
basicEffect.DiffuseColor = new Vector3(1.0f, 1.0f, 1.0f);
basicEffect.SpecularColor = new Vector3(0.25f, 0.25f, 0.25f);
basicEffect.SpecularPower = 5.0f;
basicEffect.Alpha = 1.0f;

basicEffect.LightingEnabled = true;
if (basicEffect.LightingEnabled)
{
    basicEffect.DirectionalLight0.Enabled = true; // enable each light individually
    if (basicEffect.DirectionalLight0.Enabled)
    {
        // x direction
        basicEffect.DirectionalLight0.DiffuseColor = new Vector3(1, 0, 0); // range is 0 to 1
        basicEffect.DirectionalLight0.Direction = Vector3.Normalize(new Vector3(-1, 0, 0));
        // points from the light to the origin of the scene
        basicEffect.DirectionalLight0.SpecularColor = Vector3.One;
    }

    basicEffect.DirectionalLight1.Enabled = true;
    if (basicEffect.DirectionalLight1.Enabled)
    {
        // y direction
        basicEffect.DirectionalLight1.DiffuseColor = new Vector3(0, 0.75f, 0);
        basicEffect.DirectionalLight1.Direction = Vector3.Normalize(new Vector3(0, -1, 0));
        basicEffect.DirectionalLight1.SpecularColor = Vector3.One;
    }

    basicEffect.DirectionalLight2.Enabled = true;
    if (basicEffect.DirectionalLight2.Enabled)
    {
        // z direction
        basicEffect.DirectionalLight2.DiffuseColor = new Vector3(0, 0, 0.5f);
        basicEffect.DirectionalLight2.Direction = Vector3.Normalize(new Vector3(0, 0, -1));
        basicEffect.DirectionalLight2.SpecularColor = Vector3.One;
    }
}

  4. Create a vertex declaration for the type VertexPositionNormalTexture.

    • If lighting is enabled, the vertex must have a normal type.

    • If vertex colors are enabled, the vertex must have colors.

    • If texturing is enabled, the vertex must have a texture coordinate.

    C#
    vertexDeclaration = new VertexDeclaration(new VertexElement[]
    {
        new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
        new VertexElement(12, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0),
        new VertexElement(24, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0)
    }
);

  5. Create the per vertex data. This example shows the data for one face of the cube.

    C#
    Vector3 topLeftFront = new Vector3(-1.0f, 1.0f, 1.0f);
Vector3 bottomLeftFront = new Vector3(-1.0f, -1.0f, 1.0f);
Vector3 topRightFront = new Vector3(1.0f, 1.0f, 1.0f);
Vector3 bottomRightFront = new Vector3(1.0f, -1.0f, 1.0f);
Vector3 topLeftBack = new Vector3(-1.0f, 1.0f, -1.0f);
Vector3 topRightBack = new Vector3(1.0f, 1.0f, -1.0f);
Vector3 bottomLeftBack = new Vector3(-1.0f, -1.0f, -1.0f);
Vector3 bottomRightBack = new Vector3(1.0f, -1.0f, -1.0f);

Vector2 textureTopLeft = new Vector2(0.0f, 0.0f);
Vector2 textureTopRight = new Vector2(1.0f, 0.0f);
Vector2 textureBottomLeft = new Vector2(0.0f, 1.0f);
Vector2 textureBottomRight = new Vector2(1.0f, 1.0f);

Vector3 frontNormal = new Vector3(0.0f, 0.0f, 1.0f);
Vector3 backNormal = new Vector3(0.0f, 0.0f, -1.0f);
Vector3 topNormal = new Vector3(0.0f, 1.0f, 0.0f);
Vector3 bottomNormal = new Vector3(0.0f, -1.0f, 0.0f);
Vector3 leftNormal = new Vector3(-1.0f, 0.0f, 0.0f);
Vector3 rightNormal = new Vector3(1.0f, 0.0f, 0.0f);

// Front face.
cubeVertices[0] =
    new VertexPositionNormalTexture(
    topLeftFront, frontNormal, textureTopLeft);
cubeVertices[1] =
    new VertexPositionNormalTexture(
    bottomLeftFront, frontNormal, textureBottomLeft);
cubeVertices[2] =
    new VertexPositionNormalTexture(
    topRightFront, frontNormal, textureTopRight);
cubeVertices[3] =
    new VertexPositionNormalTexture(
    bottomLeftFront, frontNormal, textureBottomLeft);
cubeVertices[4] =
    new VertexPositionNormalTexture(
    bottomRightFront, frontNormal, textureBottomRight);
cubeVertices[5] =
    new VertexPositionNormalTexture(
    topRightFront, frontNormal, textureTopRight);

  6. Call GraphicsDevice.Clear to clear the render target.

  7. Set the rasterizer state to turn off culling using the RasterizerState property.

  8. Call EffectPass.Apply to set the effect state in preparation for rendering.

  9. Draw the geometry by calling GraphicsDevice.DrawPrimitives.

    C#
    graphics.GraphicsDevice.Clear(Color.SteelBlue);

RasterizerState rasterizerState1 = new RasterizerState();
rasterizerState1.CullMode = CullMode.None;
graphics.GraphicsDevice.RasterizerState = rasterizerState1;
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
    pass.Apply();

    graphics.GraphicsDevice.DrawPrimitives(
        PrimitiveType.TriangleList,
        0,
        12
    );
}

base.Draw(gameTime);


Using a Basic Effect with Texturing

Using a Basic Effect with Texturing

Demonstrates how to create and draw a simple quad—two triangles that form a rectangle or square—using DrawUserIndexedPrimitives.

This sample introduces the Quad class, which is used to construct a quad with a list of vertices and indices suitable for drawing with DrawUserIndexedPrimitives. The sample also demonstrates how to use BasicEffect to render the quad and to apply a texture to the primitive. For more information about BasicEffect, see Creating a Basic Effect.

Complete Sample

The code in the topic shows you the technique for creating and drawing a quad. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download TexturedQuad_Sample.zip.

Textured Quad

To create a quad

  1. Determine the location of each of the four vertices in the quad.

    The Quad constructor calculates the four corners given the origin, width, height, and facing information supplied by the caller.

    C#
    public Quad( Vector3 origin, Vector3 normal, Vector3 up,
    float width, float height )
{
    Vertices = new VertexPositionNormalTexture[4];
    Indexes = new short[6];
    Origin = origin;
    Normal = normal;
    Up = up;

    // Calculate the quad corners
    Left = Vector3.Cross( normal, Up );
    Vector3 uppercenter = (Up * height / 2) + origin;
    UpperLeft = uppercenter + (Left * width / 2);
    UpperRight = uppercenter - (Left * width / 2);
    LowerLeft = UpperLeft - (Up * height);
    LowerRight = UpperRight - (Up * height);

    FillVertices();
}

  2. Determine the UV coordinates for the texture you want to apply to the quad.

    Note

    UV coordinates are derived from texture coordinates that are mapped into values along a u-axis and a v-axis. The u represents width, and v represents height.

    The Quad constructor calls FillVertices, which assigns UV coordinates ranging from (0,0) to (1,1), and makes the entire texture appear on the quad.

    C#
    private void FillVertices()
{
    // Fill in texture coordinates to display full texture
    // on quad
    Vector2 textureUpperLeft = new Vector2( 0.0f, 0.0f );
    Vector2 textureUpperRight = new Vector2( 1.0f, 0.0f );
    Vector2 textureLowerLeft = new Vector2( 0.0f, 1.0f );
    Vector2 textureLowerRight = new Vector2( 1.0f, 1.0f );

  3. Determine the normals for your vertices.

    FillVertices copies the normal vector you provide to each vertex.

    C#
    // Provide a normal for each vertex
for (int i = 0; i < Vertices.Length; i++)
{
    Vertices[i].Normal = Normal;
}

  4. Copy the position and texture coordinate data to your vertex array.

    C#
    // Set the position and texture coordinate for each
// vertex
Vertices[0].Position = LowerLeft;
Vertices[0].TextureCoordinate = textureLowerLeft;
Vertices[1].Position = UpperLeft;
Vertices[1].TextureCoordinate = textureUpperLeft;
Vertices[2].Position = LowerRight;
Vertices[2].TextureCoordinate = textureLowerRight;
Vertices[3].Position = UpperRight;
Vertices[3].TextureCoordinate = textureUpperRight;

  5. Fill out the index buffer to determine what order your vertices are drawn by the graphics hardware.

    Drawing two triangles requires four vertices, but six index entries if you are using a PrimitiveType.TriangleList. The indices are specified in clockwise order. XNA is a right-handed coordinate system so triangles drawn in counter-clockwise order are assumed to be facing away from the camera which causes them to be culled.

    C#
        // Set the index buffer for each vertex, using
    // clockwise winding
    Indexes[0] = 0;
    Indexes[1] = 1;
    Indexes[2] = 2;
    Indexes[3] = 2;
    Indexes[4] = 1;
    Indexes[5] = 3;
}

To draw a quad

  1. In your game's Initialize method, create a new Quad object specifying the location, the normal (the direction the quad faces), the Up vector, and the width and height of the quad.

    You can also create a view and projection matrix to use when rendering.

    C#
    Quad quad;
VertexDeclaration vertexDeclaration;
Matrix View, Projection;
protected override void Initialize()
{
    quad = new Quad(Vector3.Zero, Vector3.Backward, Vector3.Up, 1, 1);
    View = Matrix.CreateLookAt(new Vector3(0, 0, 2), Vector3.Zero,
        Vector3.Up);
    Projection = Matrix.CreatePerspectiveFieldOfView(
        MathHelper.PiOver4, 4.0f / 3.0f, 1, 500);

    base.Initialize();
}

  2. In your game's LoadContent method, load the texture you want to apply to the quad using the ContentManager.

  3. Create and initialize a new BasicEffect object.

  4. Set TextureEnabled to true, and assign the texture to draw to the Texture property.

    C#
    Texture2D texture;
BasicEffect quadEffect;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);
    texture = Content.Load<Texture2D>("Glass");
    quadEffect = new BasicEffect(graphics.GraphicsDevice);
    quadEffect.EnableDefaultLighting();

    quadEffect.World = Matrix.Identity;
    quadEffect.View = View;
    quadEffect.Projection = Projection;
    quadEffect.TextureEnabled = true;
    quadEffect.Texture = texture;

  5. In LoadContent, create a VertexDeclaration for the vertex type used to define the quad, which included position, normal and texture coordinates.

    C#
    vertexDeclaration = new VertexDeclaration(new VertexElement[]
    {
        new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
        new VertexElement(12, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0),
        new VertexElement(24, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0)
    }
);

  6. Use DrawUserIndexedPrimitives in each EffectPass to draw the quad.

  7. Use the Vertices and Indices properties on the Quad structure to supply the primitive data, and specify two triangles to draw.

    C#
    GraphicsDevice.Clear(Color.CornflowerBlue);

foreach (EffectPass pass in quadEffect.CurrentTechnique.Passes)
{
    pass.Apply();

    GraphicsDevice.DrawUserIndexedPrimitives
        <VertexPositionNormalTexture>(
        PrimitiveType.TriangleList,
        quad.Vertices, 0, 4,
        quad.Indexes, 0, 2);
}

Expand image See Also

Concepts

3D Pipeline Basics

Tasks

Creating a Basic Effect

Reference

BasicEffect
VertexDeclaration
DrawUserIndexedPrimitives


Rendering a Model with a Basic Effect

Rendering a Model with a Basic Effect

Demonstrates how to load and render a model using the XNA Framework Content Pipeline. It is assumed that an existing Windows game project is loaded in XNA Game Studio. In this example, the project is called "CPModel."

This example has three main parts: importing and processing the model, drawing the resultant managed object as a model with full lighting effect in the game, and enabling movement of the model with the Xbox 360 game pad.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download CPModel_Sample.zip.

Adding and Rendering a Model

To add the model to the game

  1. Right-click the Content project, click Add, and then click Existing Item.

  2. Navigate to the correct folder and select the model to be added.

    For this example, use the ship.fbx file.

  3. Open the Properties window and verify that the correct importer and processor are specified.

    For this example, the Content Importer is AutoDesk FBX - XNA Framework and the Content Processor is Model - XNA Framework.

  4. Save the solution.

Build the solution.

The remaining parts render the model and add some user control of the model. All code modifications for this part occur within the game1.cs file of the game project.

To render the model

  1. From Solution Explorer, double-click the game1.cs file.

  2. Modify the Game1 class by adding the following code at the beginning of the declaration.

    C#
    private Model gameShip;

    This member holds the ship model.

  3. Modify the LoadGraphicsContent method by adding the following code.

    C#
    gameShip = Content.Load<Model>("ship");

    This code loads the model into the gameShip member (using Load).

  4. Create a new private method (called DrawModel) in the Game1 class by adding the following code before the existing Draw method.

    C#
    private void DrawModel(Model m)
{
    Matrix[] transforms = new Matrix[m.Bones.Count];
    float aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;
    m.CopyAbsoluteBoneTransformsTo(transforms);
    Matrix projection =
        Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f),
        aspectRatio, 1.0f, 10000.0f);
    Matrix view = Matrix.CreateLookAt(new Vector3(0.0f, 50.0f, Zoom),
        Vector3.Zero, Vector3.Up);

    foreach (ModelMesh mesh in m.Meshes)
    {
        foreach (BasicEffect effect in mesh.Effects)
        {
            effect.EnableDefaultLighting();

            effect.View = view;
            effect.Projection = projection;
            effect.World = gameWorldRotation *
                transforms[mesh.ParentBone.Index] *
                Matrix.CreateTranslation(Position);
        }
        mesh.Draw();
    }
}

    This code sets up the lighting effects for each sub-mesh of the model. The gameWorldRotation and Zoom variables are used for player control. This functionality is added later.

    Note
    This render code is designed for only those models with a BasicEffect. For custom effects, the inner for-each loop should be changed to use the Effect class instead of the BasicEffect class. In addition, you must use EffectParameter objects to manually set the world, view, and projection matrices.

  5. Modify the Game1.Draw method by replacing the following code // TODO: Add your drawing code here with the following code:

    C#
    DrawModel(gameShip);

    This initializes the model's effects before the model is rendered.

  6. Save the solution.

At this point, the rendering code for the model is complete, but the user control code still needs implementation.

To move the model:

  1. Modify the Game1 class by adding the following code after the gameShip declaration.

    C#
    private Vector3 Position = Vector3.One;
private float Zoom = 2500;
private float RotationY = 0.0f;
private float RotationX = 0.0f;
private Matrix gameWorldRotation;

    These members store the current position, zoom, and rotation values. In addition, the gameWorldRotation simplifies the UpdateGamePad code.

  2. Add a private method (called UpdateGamePad) before the call to Update.

    C#
    private void UpdateGamePad()
{
    GamePadState state = GamePad.GetState(PlayerIndex.One);

    if (state.Buttons.A == ButtonState.Pressed)
    {
        Exit();
    }

    Position.X += state.ThumbSticks.Left.X * 10;
    Position.Y += state.ThumbSticks.Left.Y * 10;
    Zoom += state.ThumbSticks.Right.Y * 10;
    RotationY += state.ThumbSticks.Right.X;
    if (state.DPad.Up == ButtonState.Pressed)
    {
        RotationX += 1.0f;
    }
    else if (state.DPad.Down == ButtonState.Pressed)
    {
        RotationX -= 1.0f;
    }
    gameWorldRotation =
        Matrix.CreateRotationX(MathHelper.ToRadians(RotationX)) *
        Matrix.CreateRotationY(MathHelper.ToRadians(RotationY));
}

    This code implements an exit method for the game (pressing the A button), and updates the position members with the current input of the game controller.

  3. Modify the Update method by adding a call to UpdateGamePad, before the call to Update.

    C#
    UpdateGamePad();

    This code updates the state of the position variables with the latest input.

  4. Save the solution.

Development is complete so you are ready to build and run the game. Control the ship location with the game pad, and exit by pressing the A button.

Expand image See Also

Adding Content to a Game


Creating a Custom Effect

Demonstrates how to create a custom effect that transforms an object and applies a texture.

Note
These steps create and use a custom effect using the Effect class. Custom shaders are not supported on Windows Phone. If you want to create an effect that works on all platforms, use a built-in effect. See this example, Creating a Basic Effect, which uses the BasicEffect class.

Complete Sample

The code in this topic shows you the technique for creating and applying special effects. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download ApplyAnEffect_Sample.zip.

Creating a Custom Effect

To create a custom effect

  1. Add the effect file to the Content directory of your XNA Framework game.

  2. Right-click your Content node, point to Add, and then click Existing Item.

  3. In the Files of type list, click All Files.

  4. Navigate to your .fx file, and click Add.

    Tip
    To create a new .fx file, point to Add, click New Item, and then select the Effect File template.

  5. Create a new Effect by using the ContentManager.Load method to load the .fx file.

    C#
    effect = Content.Load<Effect>("ReallySimpleEffect");

    The .fx file contains a parameter named WorldViewProj which is a matrix used by the vertex shader. The following code looks up the WorldViewProj parameter in Effect.Parameters, and calls EffectParameter.SetValue to initialize the value of the transform matrix.

    C#
    effect.Parameters["WorldViewProj"].SetValue(worldViewProjection);

  6. Set Effect.CurrentTechnique to a technique from the .fx file.

    In this case, use the Effect.Techniques property to look up the technique named TransformTechnique from the .fx file.

    C#
    effect.CurrentTechnique = effect.Techniques["TransformTechnique"];

  7. Use the GraphicsDevice.RasterizerState property to turn culling off so that all primitives will be drawn regardless of the order of the vertices.

  8. Call EffectPass.Apply to apply the effect state before rendering.

  9. Call DrawUserIndexedPrimitives to render the effect.

    C#
    GraphicsDevice.Clear(Color.CornflowerBlue);

RasterizerState rasterizerState = new RasterizerState();
rasterizerState.CullMode = CullMode.None;
GraphicsDevice.RasterizerState = rasterizerState;

GraphicsDevice.SetVertexBuffer(vertexBuffer);

foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
    pass.Apply();

    GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionColor>(
        PrimitiveType.TriangleList,
        vertices,
        0,   // vertex buffer offset to add to each element of the index buffer
        24,  // number of vertices to draw
        indices,
        0,   // first index element to read
        12   // number of primitives to draw
    );
}

Expand image See Also

Concepts

Shader Content Catalog at XNA Creators Club Online


Creating a Custom Effect with Texturing

Creating a Custom Effect with Texturing

Demonstrates how to use a custom effect and a texture to render a 3D object.

Complete Sample

The code in the topic shows you the technique for creating an effect to apply a texture. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download ApplyTextures_Sample.zip.

Using a custom effect and a texture

To use a custom effect and a texture

  1. Create a vertex declaration that contains a position and a texture coordinate.

  2. Create a vertex buffer from the vertex declaration.

    C#
    vertexDeclaration = new VertexDeclaration(new VertexElement[]
    {
        new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
        new VertexElement(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0)
    }
);

vertexBuffer = new VertexBuffer(
    graphics.GraphicsDevice,
    vertexDeclaration,
    number_of_vertices,
    BufferUsage.None
    );

  3. Create a custom effect using the Effect class.

  4. Load the Effect object using the ContentManager.Load<Effect> method to load the .fx file.

  5. Load a Texture2D object using the ContentManager.Load<Texture2D> method to load the asset.

  6. Call SetValue to initialize each effect parameter using the corresponding game property.

  7. Initialize the CurrentTechnique to a technique that exists in the .fx file.

    C#
    effect = Content.Load<Effect>("ReallySimpleTexture");

Texture2D texture = Content.Load<Texture2D>("XNA_pow2");

effect.Parameters["WorldViewProj"].SetValue(worldViewProjection);
effect.Parameters["UserTexture"].SetValue(texture);

effect.CurrentTechnique = effect.Techniques["TransformAndTexture"];

  8. Render the effect.

  9. Set the RasterizerState property to turn culling off so that all primitives will be drawn regardless of the order of the vertices.

  10. Loop through each pass in the effect calling DrawPrimitives.

    C#
    graphics.GraphicsDevice.Clear(Color.SteelBlue);

RasterizerState rasterizerState1 = new RasterizerState();
rasterizerState1.CullMode = CullMode.None;
graphics.GraphicsDevice.RasterizerState = rasterizerState1;
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
    pass.Apply();

    graphics.GraphicsDevice.DrawPrimitives(
        PrimitiveType.TriangleList,
        0,  // start vertex
        12  // number of primitives to draw
    );
}

Expand image See Also

Concepts

3D Pipeline Basics


Drawing a Sprite Over a Model

Demonstrates how to draw a sprite so that it obscures a model. In this example, we are drawing an animated sprite representing an explosion over the current screen position of a 3D model.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download ViewportProjection_Sample.zip.

For this sample, the camera is a standard arc ball camera, implemented by camera.cs. The 3D model file is a simple ring, implemented by ring16b.x. The animated explosion sprite is implemented by explosion.dds. These files can be found in the complete sample. See Animating a Sprite for an example of the AnimatedTexture class.

Drawing a Sprite Over a Model

To draw a sprite over a model

  1. In your Update method, handle the input to move your camera, then call UpdateFrame on the AnimatedTexture.

    C#
    GamePadState PlayerOne = GamePad.GetState(PlayerIndex.One);

// Move the camera using thumbsticks
MoveCamera(PlayerOne);

// Start or stop the animated sprite using buttons
if (PlayerOne.Buttons.A == ButtonState.Pressed)
    explosion.Play();
if (PlayerOne.Buttons.B == ButtonState.Pressed)
    explosion.Stop();

// Update the animated sprite
explosion.UpdateFrame((float)gameTime.ElapsedGameTime.TotalSeconds);

  2. Use CreateMerged to create a BoundingSphere that contains all the BoundingSphere values for each ModelMesh in the Model.

  3. Use Viewport.Project to find the center point of that sphere, which is the center of the model in screen coordinates.

    C#
    // Create a total bounding sphere for the mesh
BoundingSphere totalbounds = new BoundingSphere();
foreach (ModelMesh mesh in Ring.Meshes)
{
    totalbounds = BoundingSphere.CreateMerged(totalbounds,
        mesh.BoundingSphere);
}

// Project the center of the 3D object to the screen, and center the
// sprite there
Vector3 center = GraphicsDevice.Viewport.Project(totalbounds.Center,
    projectionMatrix, Camera1.ViewMatrix, Matrix.Identity);
explosionpos.X = center.X;
explosionpos.Y = center.Y;

  4. Take the BoundingSphere for the model and use it to create a BoundingBox with CreateFromSphere.

  5. Use Project to find the corner of the box farthest from the center and use the return value to scale the sprite appropriately.

    C#
    // Create a bounding box from the bounding sphere,
// and find the corner that is farthest away from
// the center using Project
BoundingBox extents = BoundingBox.CreateFromSphere(totalbounds);
float maxdistance = 0;
float distance;
Vector3 screencorner;
foreach (Vector3 corner in extents.GetCorners())
{
    screencorner = GraphicsDevice.Viewport.Project(corner,
    projectionMatrix, Camera1.ViewMatrix, Matrix.Identity);
    distance = Vector3.Distance(screencorner, center);
    if (distance > maxdistance)
        maxdistance = distance;
}

// Scale the sprite using the two points (the sprite is
// 75 pixels square)
explosion.Scale = maxdistance / 75;

  6. In your Draw method, draw the Model normally, and then draw the animated sprite using the position calculated in Update.

    C#
    protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);

    //Draw the model, a model can have multiple meshes, so loop
    foreach (ModelMesh mesh in Ring.Meshes)
    {
        //This is where the mesh orientation is set, as well as
        //our camera and projection
        foreach (BasicEffect effect in mesh.Effects)
        {
            effect.EnableDefaultLighting();
            effect.World = Matrix.Identity *
                Matrix.CreateRotationY(RingRotation) *
                Matrix.CreateTranslation(RingPosition);
            effect.View = Camera1.ViewMatrix;
            effect.Projection = projectionMatrix;
        }
        //Draw the mesh, will use the effects set above.
        mesh.Draw();
    }

    // Draw the sprite over the 3D object
    //            spriteBatch.Begin(SpriteBlendMode.AlphaBlend,
    //                SpriteSortMode.Deferred, SaveStateMode.SaveState);
    spriteBatch.Begin();
    explosion.DrawFrame(spriteBatch, explosionpos);
    spriteBatch.End();

    base.Draw(gameTime);
}

Expand image See Also

Concepts

What Is a Sprite?
What Is Color Blending?


Enabling Antialiasing (Multisampling)

Enabling Antialiasing (Multisampling)
See Also
CollapseAll image

Demonstrates how to enable antialiasing for your game.

Figure 1. Antialiasing the edges of a cube: multisampling is disabled on the left, and enabled on the right.

Antialiasing is a technique for minimizing distortion artifacts caused by aliasing when rendering a high-resolution signal (such as a sharp edge) at a low resolution (such as in a render target with a fixed number of pixel locations). Antialiasing smoothes sharp edges by partially rendering to neighboring pixels. This technique is also called multisampling because each pixel value can be the result of multiple samples. Enabling antialiasing on the Xbox 360 will have a small performance impact; enabling antialiasing on PCs may have a large impact on performance.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download AntiAliasing_Sample.zip.

Enabling Antialiasing

To enable antialiasing in your game

  • Render 3D geometry. One way to do this is by creating a BasicEffect using the BasicEffect class. For more detail, see Creating a Basic Effect.

  • Set PreferMultiSampling to true in your Game class constructor.

    C#
    graphics.PreferMultiSampling = true;

  • Set the view matrix to place the camera close to the object so you can more clearly see the smoothed, antialiased edges.

    C#
    worldMatrix = Matrix.CreateRotationX(tilt) * Matrix.CreateRotationY(tilt);

viewMatrix = Matrix.CreateLookAt(new Vector3(1.75f, 1.75f, 1.75f), Vector3.Zero, Vector3.Up);

projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
    MathHelper.ToRadians(45),  // 45 degree angle
    (float)GraphicsDevice.Viewport.Width /
    (float)GraphicsDevice.Viewport.Height,
    1.0f, 100.0f);

  • Draw the geometry by calling GraphicsDevice.DrawPrimitives.

    C#
    RasterizerState rasterizerState1 = new RasterizerState();
rasterizerState1.CullMode = CullMode.None;
graphics.GraphicsDevice.RasterizerState = rasterizerState1;
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
    pass.Apply();

    graphics.GraphicsDevice.DrawPrimitives(
        PrimitiveType.TriangleList,
        0,
        12
    );
}

Expand image See Also

Concepts

3D Pipeline Basics
What Is Antialiasing?

Reference

GraphicsDeviceManager
PreparingDeviceSettings
PresentationParameters


Creating a Render Target

Creating a Render Target

Demonstrates how to create a render target using the RenderTarget2D class.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download RenderTarget1.zip.

Creating a RenderTarget

To create a render target

  1. Declare variables for a render target using the RenderTarget2D class and the render target texture using a Texture2D class.

    C#
    SpriteBatch spriteBatch;
Texture2D grid;
RenderTarget2D renderTarget;

  2. Create a render target, giving it the same size as the back buffer.

    C#
    renderTarget = new RenderTarget2D(
    GraphicsDevice,
    GraphicsDevice.PresentationParameters.BackBufferWidth,
    GraphicsDevice.PresentationParameters.BackBufferHeight);

  3. Load a grid for a texture, which contains two vertical and two horizontal lines.

    C#
    protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);

    grid = Content.Load<Texture2D>("grid");
}

  4. Render the texture to the render target.

    This function sets the render target on the device, draws the texture (to the render target) using a SpriteBatch, and sets the device render target to null (which resets the device to the back buffer).

    C#
    private void DrawRenderTarget()
{
    // Set the device to the render target
    graphicsDeviceManager.GraphicsDevice.SetRenderTarget(renderTarget);

    graphicsDeviceManager.GraphicsDevice.Clear(Color.Black);

    spriteBatch.Begin();
    Vector2 pos = Vector2.Zero;
    spriteBatch.Draw(grid, pos, Color.White);
    spriteBatch.End();

    // Reset the device to the back buffer
    graphicsDeviceManager.GraphicsDevice.SetRenderTarget(null);
}

  5. Draw the render target texture to the back buffer.

    C#
    graphicsDeviceManager.GraphicsDevice.Clear(Color.CornflowerBlue);

spriteBatch.Begin();
spriteBatch.Draw((Texture2D)renderTarget,
    new Vector2(200, 50),          // x,y position
    new Rectangle(0, 0, 32, 32),   // just one grid
    Color.White                    // no color scaling
    );
spriteBatch.End();


Creating a State Object

Demonstrates how to create a state object using any of the state object classes: BlendState, DepthStencilState, RasterizerState, or SamplerState.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download StateObject.zip.

Creating a State Object

To create a state object

  1. Declare three state object variables as fields in your game.

    This example declares three rasterizer state objects and uses them to change the culling state.

    C#
    RasterizerState rsCullNone;

  2. Create a customizable state object.

    Create a state object from the RasterizerState class and initialize it by explicitly setting the cull mode.

    C#
    rsCullNone = new RasterizerState();
rsCullNone.CullMode = CullMode.None;
rsCullNone.FillMode = FillMode.WireFrame;
rsCullNone.MultiSampleAntiAlias = false;

  3. Respond to the user pressing the A key on a gamepad to change the culling mode.

    The application starts with culling turned off; toggle between culling modes by pushing the A key on a gamepad. Unlike a customizable state object, use a built-in state object to create an object with a set of predefined state.

    C#
    if (GamePad.GetState(PlayerIndex.One).Buttons.A == ButtonState.Pressed)
    changeState = true;

if ((changeState) && (GamePad.GetState(PlayerIndex.One).Buttons.A == ButtonState.Released))
{
    if (GraphicsDevice.RasterizerState.CullMode == CullMode.None)
        GraphicsDevice.RasterizerState = RasterizerState.CullCounterClockwise;
    else if (GraphicsDevice.RasterizerState.CullMode == CullMode.CullCounterClockwiseFace)
        GraphicsDevice.RasterizerState = RasterizerState.CullClockwise;
    else if (GraphicsDevice.RasterizerState.CullMode == CullMode.CullClockwiseFace)
        GraphicsDevice.RasterizerState = rsCullNone;

    changeState = false;
}

    The example contains two triangles. The first one is rendered if you select clockwise winding order; the second triangle is rendered if you select counterclockwise winding order; both triangles are rendered if you select no culling.


Creating a Custom Vertex Declaration

Demonstrates how to create a custom vertex declaration and use it to render a 3D object.

Game Studio includes a few predefined classes for common vertex buffer declarations such as VertexPositionColor and VertexPositionColorTexture. If you need to create a vertex buffer declaration that includes additional user-defined types, create a custom vertex declaration.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download UseCustomVertexWindows.zip.

Creating a Custom Vertex Declaration

A custom vertex declaration is a class that implements fully customizable per-vertex data. Furthermore, if you derive the class from IVertexType, you will not need to create a vertex declaration when creating your vertex buffer or drawing the geometry.

To create a custom vertex declaration

  1. Declare a structure that derives from IVertexType.

    C#
    public struct CustomVertex1 : IVertexType

  2. Add members to the struct that describe the per-vertex data.

    This example uses position as a Vector3 Structure type, a texture coordinate using a Vector2 Structure type, and a vertex declaration using the VertexDeclaration type.

    C#
    Vector3 vertexPosition;
Vector2 vertexTextureCoordinate;

public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration
(
    new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
    new VertexElement(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0)
);

  3. Implement a constructor and public accessor methods.

    C#
    //The constructor for the custom vertex. This allows similar
//initialization of custom vertex arrays as compared to arrays of a
//standard vertex type, such as VertexPositionColor.
public CustomVertex1(Vector3 pos, Vector2 textureCoordinate)
{
    vertexPosition = pos;
    vertexTextureCoordinate = textureCoordinate;
}

//Public methods for accessing the components of the custom vertex.
public Vector3 Position
{
    get { return vertexPosition; }
    set { vertexPosition = value; }
}

public Vector2 TextureCoordinate
{
    get { return vertexTextureCoordinate; }
    set { vertexTextureCoordinate = value; }
}

  4. Implement a nonpublic method for accessing the vertex declaration.

    C#
    VertexDeclaration IVertexType.VertexDeclaration
{
    get { return VertexDeclaration; }
}

  5. Create a built-in effect to render the object with a texture using the BasicEffect class as demonstrated in Creating a Basic Effect.

  6. Create the vertex buffer passing in the typeof(CustomVertex1) instead of a vertex declaration to describe the vertex buffer data.

    C#
    vertexBuffer = new VertexBuffer(
    graphics.GraphicsDevice,
    typeof(CustomVertex1),
    number_of_vertices,
    BufferUsage.None
    );

  7. Create the per-vertex data; this shows a portion of the code.

    C#
    Vector3 LeftTopFront = new Vector3(-1.0f, 1.0f, 1.0f);
Vector3 LeftBottomFront = new Vector3(-1.0f, -1.0f, 1.0f);
Vector3 LeftTopBack = new Vector3(-1.0f, 1.0f, -1.0f);
Vector3 LeftBottomBack = new Vector3(-1.0f, -1.0f, -1.0f);

Vector3 RightTopFront = new Vector3(1.0f, 1.0f, 1.0f);
Vector3 RightBottomFront = new Vector3(1.0f, -1.0f, 1.0f);
Vector3 RightTopBack = new Vector3(1.0f, 1.0f, -1.0f);
Vector3 RightBottomBack = new Vector3(1.0f, -1.0f, -1.0f);

Vector2 textureLeftTop = new Vector2(0.0f, 0.0f);
Vector2 textureLeftBottom = new Vector2(0.0f, 1.0f);
Vector2 textureRightTop = new Vector2(1.0f, 0.0f);
Vector2 textureRightBottom = new Vector2(1.0f, 1.0f);

// Front face.
cubeVertices[0] = new CustomVertex1(LeftTopFront, textureLeftTop);
cubeVertices[1] = new CustomVertex1(LeftBottomFront, textureLeftBottom);
cubeVertices[2] = new CustomVertex1(RightTopFront, textureRightTop);
cubeVertices[3] = new CustomVertex1(LeftBottomFront, textureLeftBottom);
cubeVertices[4] = new CustomVertex1(RightBottomFront, textureRightBottom);
cubeVertices[5] = new CustomVertex1(RightTopFront, textureRightTop);

    For a triangle list, you need three vertices for a triangle and two triangles to make the front face of a cube.

  8. Set the data into the vertex buffer data by calling SetData and set the vertex buffer to the device by calling SetVertexBuffer.

    C#
    vertexBuffer.SetData<CustomVertex1>(cubeVertices);

graphics.GraphicsDevice.SetVertexBuffer(vertexBuffer);

  9. Draw the object by calling DrawPrimitives.

    C#
    RasterizerState rasterizerState1 = new RasterizerState();
rasterizerState1.CullMode = CullMode.None;
graphics.GraphicsDevice.RasterizerState = rasterizerState1;

foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
    pass.Apply();

    graphics.GraphicsDevice.DrawPrimitives(
        PrimitiveType.TriangleList,
        0,  // start vertex
        12  // number of primitives to draw
    );
}


Drawing 3D Primitives using Lists or Strips

Drawing 3D Primitives using Lists or Strips

Demonstrates how to draw 3D primitives using lines and triangles arranged as strips or lists.

A 3D primitive describes how vertex data is ordered. This example demonstrates line and triangle primitive types that are the basis for all drawing calls in the XNA Framework. To render primitives, you need to create a basic effect and transformation matrices. This topic follows the steps described in Creating a Basic Effect to create an instance of BasicEffect. This sample uses orthographic projection, but you can also use perspective projection to render primitives. The vertices used in the sample are of type VertexPositionColor Structure which contains per-vertex position and color.

Complete Sample

You can download a complete code sample for this topic including full source code and any additional supporting files required by the sample.

Download DrawUserPrimitives_Sample.zip.

The major steps for this example are:

  • Creating Vertices
  • Drawing a Line List
  • Drawing a Line Strip
  • Drawing A Triangle List
  • Drawing a Triangle Strip

Creating Vertices

To create vertices

  1. Create a list of vertices in 3D space that represent the points to draw.

    The following code creates eight vertices and stores them in an array of type VertexPositionColor.

    C#
    pointList = new VertexPositionColor[points];

for (int x = 0; x < points / 2; x++)
{
    for (int y = 0; y < 2; y++)
    {
        pointList[(x * 2) + y] = new VertexPositionColor(
            new Vector3(x * 100, y * 100, 0), Color.White);
    }
}

    These eight points form a triangle strip consisting of six triangles drawn along the plane z = 0, with the first point at (0, 0, 0). The camera is positioned at (0, 0, 1) looking at (0, 0, 0). An orthogonal projection matrix is created with the upper-left point at (0, 0) and the lower-right point at (800, 600). In addition, a translation matrix shifts the point set to the center of the screen. The code below positions the points, the camera and the required transformations.

    C#
    viewMatrix = Matrix.CreateLookAt(
    new Vector3(0.0f, 0.0f, 1.0f),
    Vector3.Zero,
    Vector3.Up
    );

projectionMatrix = Matrix.CreateOrthographicOffCenter(
    0,
    (float)GraphicsDevice.Viewport.Width,
    (float)GraphicsDevice.Viewport.Height,
    0,
    1.0f, 1000.0f);

Drawing a Line List

The example in this section uses the sample vertex list created by following step 1 in the Creating Vertices procedure.

To draw a line list

  1. Create an index array that indexes into the vertex buffer.

    This identifies a series of lines.

    C#
    // Initialize an array of indices of type short.
lineListIndices = new short[(points * 2) - 2];

// Populate the array with references to indices in the vertex buffer
for (int i = 0; i < points - 1; i++)
{
    lineListIndices[i * 2] = (short)(i);
    lineListIndices[(i * 2) + 1] = (short)(i + 1);
}

  2. Render the lines by calling DrawUserIndexedPrimitives, which specifies PrimitiveType.LineList to determine how to interpret the data in the vertex array.

    C#
    GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionColor>(
    PrimitiveType.LineList,
    pointList,
    0,  // vertex buffer offset to add to each element of the index buffer
    8,  // number of vertices in pointList
    lineListIndices,  // the index buffer
    0,  // first index element to read
    7   // number of primitives to draw
);

Drawing a Line Strip

The example in this section uses the same point list and renders the same output as the Drawing a Line List procedure. However, it uses a line strip primitive type when it identifies the indices of the vertex array to draw. Fewer indices are stored when you use a line strip.

To draw a line strip

  1. Create a list of indices to identify the order in which to draw the points in the specified point list.

    Only half the number of indices used for the line list are needed here because the data consist of a series of connected lines.

    C#
    // Initialize an array of indices of type short.
lineStripIndices = new short[points];

// Populate the array with references to indices in the vertex buffer.
for (int i = 0; i < points; i++)
{
    lineStripIndices[i] = (short)(i);
}

    This is equivalent to setting lineStripIndices to the following array, which consists of a series of connected lines between pointList[0], pointList[1], and pointList[2], and so forth.

    C#
    lineStripIndices = new short[8]{ 0, 1, 2, 3, 4, 5, 6, 7 };

  2. Render the line strip by calling DrawUserIndexedPrimitives, which specifies PrimitiveType.LineStrip to determine how to interpret the data in the vertex array.

    Fewer vertices are used to render the same number of primitives rendered earlier by the line list.

    Note

    In the example code, the line strip is rendered by a series of red lines instead of the white lines used for the previous line list. This is accomplished by changing the vertex color before you draw the line strip. After you complete the drawing, it reverts to the original color. In addition, vertex coloring was enabled for the basic effect (using BasicEffect.VertexColorEnabled Property).

    The color change indicates a different primitive type was used to achieve the same result.

    C#
    for (int i = 0; i < pointList.Length; i++)
    pointList[i].Color = Color.Red;

GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionColor>(
    PrimitiveType.LineStrip,
    pointList,
    0,   // vertex buffer offset to add to each element of the index buffer
    8,   // number of vertices to draw
    lineStripIndices,
    0,   // first index element to read
    7    // number of primitives to draw
);
for (int i = 0; i < pointList.Length; i++)
    pointList[i].Color = Color.White;

Drawing A Triangle List

A triangle list, like a line list, is a primitive type that indicates you need to interpret the vertices in the vertex buffer as a series of separately drawn triangles.

To draw a triangle list

  1. Create an array to hold the list of indices that identify a series of triangles to draw from the specified point list.

    C#
    triangleListIndices = new short[(width - 1) * (height - 1) * 6];

for (int x = 0; x < width - 1; x++)
{
    for (int y = 0; y < height - 1; y++)
    {
        triangleListIndices[(x + y * (width - 1)) * 6] = (short)(2 * x);
        triangleListIndices[(x + y * (width - 1)) * 6 + 1] = (short)(2 * x + 1);
        triangleListIndices[(x + y * (width - 1)) * 6 + 2] = (short)(2 * x + 2);

        triangleListIndices[(x + y * (width - 1)) * 6 + 3] = (short)(2 * x + 2);
        triangleListIndices[(x + y * (width - 1)) * 6 + 4] = (short)(2 * x + 1);
        triangleListIndices[(x + y * (width - 1)) * 6 + 5] = (short)(2 * x + 3);
    }
}

    This is equivalent to setting triangleListIndices to the following array, which consists of a series of triangles between pointList[0], pointList[1], and pointList[2], and so forth.

    C#
    triangleListIndices = new short[18]{ 0, 1, 2, 2, 1, 3, 2, 3, 4, 4, 3, 5, 4, 5, 6, 6, 5, 7 };

  2. Render the lines by calling DrawUserIndexedPrimitives

    This specifies PrimitiveType.TriangleList, which determines how the data in the vertex array is interpreted.

    C#
    GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionColor>(
    PrimitiveType.TriangleList,
    pointList,
    0,   // vertex buffer offset to add to each element of the index buffer
    8,   // number of vertices to draw
    triangleListIndices,
    0,   // first index element to read
    6    // number of primitives to draw
);

Drawing a Triangle Strip

A triangle strip is a set of triangles that share multiple vertices. This example shows you how to render an object that looks the same as the object rendered with a triangle list. However, fewer vertices are needed because the triangles share multiple vertices.

To draw a triangle strip

  1. Create an array to hold the list of indices that identify a strip of triangles.

    C#
    // Initialize an array of indices of type short.
triangleStripIndices = new short[points];

// Populate the array with references to indices in the vertex buffer.
for (int i = 0; i < points; i++)
{
    triangleStripIndices[i] = (short)i;
}

    This is equivalent to setting triangleStripIndices to the following array, which consists of a series of connected triangles between pointList[0], pointList[1], and pointList[2], and so forth.

    C#
    triangleStripIndices = new short[8]{ 0, 1, 2, 3, 4, 5, 6, 7 };

  2. Render the lines by calling DrawUserIndexedPrimitives.

    This specifies PrimitiveType.TriangleStrip to determine how to interpret the data in the vertex array. Fewer vertices are used to render the same number of primitives rendered earlier by the triangle list.

    Note
    In the example code, the triangle strip is rendered by a series of red lines instead of the white lines used for the previous triangle list. The color change indicates a different primitive type was used to achieve the same result.
    C#
    for (int i = 0; i < pointList.Length; i++)
    pointList[i].Color = Color.Red;

GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionColor>(
    PrimitiveType.TriangleStrip,
    pointList,
    0,  // vertex buffer offset to add to each element of the index buffer
    8,  // number of vertices to draw
    triangleStripIndices,
    0,  // first index element to read
    6   // number of primitives to draw
);
for (int i = 0; i < pointList.Length; i++)
    pointList[i].Color = Color.White;


Dynamically Updating Vertices

Dynamically Updating Vertices

Describes several techniques for implementing dynamic vertex buffers in an XNA Framework game.

Geometry in a 3D game ultimately is defined as a set of vertices. Commonly, a game either needs to modify the position of one or more existing vertices or generate the vertices at run time. Because the graphics device can access these buffers at any time, be careful when modifying existing vertex buffers and rendering the resulting geometry. The following sections discuss several techniques you can implement in your game.

Tip

For index or vertex buffers that are frequently updated during game run time, use the DynamicIndexBuffer and DynamicVertexBuffer classes. They are optimized to render faster when updated frequently.

Use VertexBuffer and IndexBuffer when index or vertex buffer data is infrequently updated.

Updating a Set of Primitives Dynamically

You can use the DrawUserPrimitives method as the basis for rendering a set of primitives that are generated dynamically each frame. The Primitives Sample, located on the XNA Creators Club Online Web site, implements an abstraction layer around this method similar to the SpriteBatch class.

The sample renders primitives by first calling Begin, adding the necessary vertices, using the Add method, and then calling End. This forces the buffer to be drawn to the current device. The Flush method calls DrawUserPrimitives method when End is called or when the buffer has no room for new vertices. If there is no room, the buffer is written to the device, it is reset, and the pending vertices are added.

For a complete code listing, download the Primitives Sample from the XNA Creators Club Online Web site.

Dynamically Rendering a Persistent Set of Primitives

The Particle 3D Sample, located on the XNA Creators Club Online Web site, implements a dynamic vertex buffer that contains custom vertices with a limited lifespan. The application adds particles and removes them to a fixed length buffer. The custom shader of the sample renders the active subset of vertices dynamically.

Because particles have a limited lifespan, the sample code must manage the vertex buffer in real time. The ParticleSystem class handles all adding, updating, and deleting.

Generating Geometry Programmatically

Sometimes, geometry to be rendered either is not known at design-time or it changes based on events during run time.

To generate geometry

  1. Create a vertex buffer to store the vertices of the geometry to be generated.

  2. Create an index buffer that stores the indices used to render the geometry represented by the vertex buffer.

  3. Once the vertex and index data have been generated, call SetData for the vertex buffer and SetData for the index buffer.

  4. In the method that renders your frame (the Draw method for a default XNA game project), set the vertex stream and index data of the current graphics device.

    For a specific example of this, see DrawIndexedPrimitives.

  5. Call DrawIndexedPrimitives.

For a more advanced solution for this problem, download the Generated Geometry Sample from the XNA Creators Club Online Web site. This sample uses the MeshBuilder helper class and a custom processor to generate a terrain map from a bitmap loaded by the content manager. Specifically, examine the Process method, located in TerrainProcessor.cs. This method programmatically creates the terrain geometry based on input from the specified bitmap.


Displaying Multiple Screens with Viewports

Displaying Multiple Screens with Viewports

Demonstrates how to use viewports to display different scenes simultaneously using two cameras.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download SplitScreenWindows.zip.

Using Viewports to Display Multiple Screens

To create multiple screens

  1. In your LoadContent method, create two new Viewport objects to define the two new "split" regions of the screen.

    In this example, the screen is split in half vertically.

    C#
    Viewport defaultViewport;
Viewport leftViewport;
Viewport rightViewport;
Matrix projectionMatrix;
Matrix halfprojectionMatrix;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);

    defaultViewport = GraphicsDevice.Viewport;
    leftViewport = defaultViewport;
    rightViewport = defaultViewport;
    leftViewport.Width = leftViewport.Width / 2;
    rightViewport.Width = rightViewport.Width / 2;
    rightViewport.X = leftViewport.Width;
    //            rightViewport.X = leftViewport.Width + 1;

  2. Create a projection matrix to fit each new viewport.

    In this case, because the screen is split in half, only one new projection matrix is necessary. It has the same settings as the 4:3 full screen projection matrix, except the aspect ratio is now 2:3.

    C#
        projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
        MathHelper.PiOver4, 4.0f / 3.0f, 1.0f, 10000f);
    halfprojectionMatrix = Matrix.CreatePerspectiveFieldOfView(
        MathHelper.PiOver4, 2.0f / 3.0f, 1.0f, 10000f);
}

  3. In your Draw method, assign one of the viewports to draw as the GraphicsDevice Viewport.

  4. Draw your scene as normal, using the camera (or view matrix) associated with this perspective along with the proper projection matrix.

    C#
    protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Viewport = defaultViewport;
    GraphicsDevice.Clear(Color.CornflowerBlue);

    GraphicsDevice.Viewport = leftViewport;
    DrawScene(gameTime, Camera1.ViewMatrix, halfprojectionMatrix);

  5. After drawing the first scene, assign the other viewport to the Viewport property.

  6. Draw your scene again with the associated camera or view matrix, and the proper projection matrix.

    C#
        GraphicsDevice.Viewport = rightViewport;
    DrawScene(gameTime, Camera2.ViewMatrix, halfprojectionMatrix);

    base.Draw(gameTime);

}

Expand image See Also

Concepts

What Is a Viewport?

Reference

GraphicsDevice.Viewport
Viewport Structure


Creating a SkySphere

Creating a SkySphere

Demonstrates how to create an effect that will apply a skybox-style cube map to a sphere.

This example assumes you have a Camera object for handling the position and view matrix of the 3D camera, along with a simple Model to display. The SkySphere effect also requires a sphere model and a skybox cube map.

Complete Sample

The code in this topic shows you the creation technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download SkySphere_Sample.zip.

Skysphere Effect

The vertex shader for the SkySphere effect takes the position of each vertex, extracts the rotation of the camera from the view matrix, and applies a projection matrix for the final vertex position. For calculating the pixel values between the vertices, the vertex shader passes the unmodified position.

C#
uniform extern float4x4 ViewMatrix;
uniform extern float4x4 ProjectionMatrix;

void SkyboxVertexShader( float3 pos : POSITION0,
                         out float4 SkyPos : POSITION0,
                         out float3 SkyCoord : TEXCOORD0 )
{
    // Calculate rotation. Using a float3 result, so translation is ignored
    float3 rotatedPosition = mul(pos, ViewMatrix);
    // Calculate projection, moving all vertices to the far clip plane
    // (w and z both 1.0)
    SkyPos = mul(float4(rotatedPosition, 1), ProjectionMatrix).xyww;

    SkyCoord = pos;
};

The pixel shader for the SkySphere effect uses texCUBE to choose a pixel on the cube map.

To create the SkySphere effect

  1. Imagine the sphere model surrounding the camera viewpoint, and the cube map surrounding the sphere model.

  2. Draw a line from the camera position to a point on the sphere model, and continue that line until it hits the cube map.

    This is the pixel returned by texCUBE. This has the effect of transforming the cube into a different shape, which makes the sky look more realistic (the cube often has obvious corners). You do not have to use a sphere for this effect. A flattened or oblong sphere may look better for some applications.

    C#
    uniform extern texture SkyboxTexture;
sampler SkyboxS = sampler_state
{
    Texture = <SkyboxTexture>;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
    MipFilter = LINEAR;
    AddressU = CLAMP;
    AddressV = CLAMP;
};
float4 SkyboxPixelShader( float3 SkyCoord : TEXCOORD0 ) : COLOR
{
    // grab the pixel color value from the skybox cube map
    return texCUBE(SkyboxS, SkyCoord);
};

    The technique for the SkySphere effect has one pass. Because you want all the triangles on the sphere to render, the technique has to disable culling. Since the camera is inside the sphere, normal culling would result in no vertices to shade. Depth writes also are disabled because we want the environment to render behind everything else, without appearing to clip any objects.

    C#
    technique SkyboxTechnique
{
    pass P0
    {
        vertexShader = compile vs_2_0 SkyboxVertexShader();
        pixelShader = compile ps_2_0 SkyboxPixelShader();

        // We're drawing the inside of a model
        CullMode = None;
        // We don't want it to obscure objects with a Z < 1
        ZWriteEnable = false;
    }
}

To apply the SkySphere effect

  1. In your Game.LoadContent, load the content that you normally draw in your scene.

    C#
    Vector3 ModelPosition;
float ModelRotation = 0.0f;
Model Model;
Model SkySphere;
Effect SkySphereEffect;
Matrix projectionMatrix;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);
    Model = Content.Load<Model>("redtorus");
    ModelPosition = Vector3.Zero;
    projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
        MathHelper.PiOver4, 4.0f / 3.0f, 1.0f, 10000f);

  2. Load the SkySphere effect from the Content Manager.

  3. Load a cube map into a TextureCube object.

    A cube map is a texture with six sides that form a cube. For a skybox (or sphere), the cube map is a picture of the far distance in the scene.

  4. Set the parameters the SkySphere requires, including the TextureCube to draw.

    C#
    // Load the effect, the texture it uses, and
// the model used for drawing it
SkySphereEffect = Content.Load<Effect>("SkySphere");
TextureCube SkyboxTexture =
    Content.Load<TextureCube>("uffizi_cross");
SkySphere = Content.Load<Model>("SphereHighPoly");

// Set the parameters of the effect
SkySphereEffect.Parameters["ViewMatrix"].SetValue(
    myCamera.ViewMatrix);
SkySphereEffect.Parameters["ProjectionMatrix"].SetValue(
    projectionMatrix);
SkySphereEffect.Parameters["SkyboxTexture"].SetValue(
    SkyboxTexture);

  5. Since the Effect and the Model are loaded separately, apply the SkySphere effect to each Effect property on the ModelMeshPart of the SkySphere model.

    C#
        // Set the Skysphere Effect to each part of the Skysphere model
    foreach (ModelMesh mesh in SkySphere.Meshes)
    {
        foreach (ModelMeshPart part in mesh.MeshParts)
        {
            part.Effect = SkySphereEffect;
        }
    }

}

  6. In your Game.Draw, draw your scene as normal.

    C#
    protected override void Draw(GameTime gameTime)
{
    graphics.GraphicsDevice.Clear(Color.CornflowerBlue);

    //Draw the model, a model can have multiple meshes, so loop
    foreach (ModelMesh mesh in Model.Meshes)
    {
        //This is where the mesh orientation is set,
        //as well as our camera and projection
        foreach (BasicEffect effect in mesh.Effects)
        {
            effect.EnableDefaultLighting();
            effect.World = Matrix.Identity *
                Matrix.CreateRotationY(ModelRotation) *
                Matrix.CreateTranslation(ModelPosition);
            //effect.View = myCamera.View;
            effect.View = myCamera.ViewMatrix;
            effect.Projection = projectionMatrix;
        }
        //Draw the mesh, will use the effects set above.
        mesh.Draw();
    }

  7. Draw the SkySphere by setting parameters to the SkySphere Effect.

  8. Draw the SkySphere Model.

    In this case we set the view and projection matrices.

    C#
    // Set the View and Projection matrix for the effect
SkySphereEffect.Parameters["ViewMatrix"].SetValue(
    myCamera.ViewMatrix);
SkySphereEffect.Parameters["ProjectionMatrix"].SetValue(
    projectionMatrix);
// Draw the sphere model that the effect projects onto
foreach (ModelMesh mesh in SkySphere.Meshes)
{
    mesh.Draw();
}

  9. Because this shader sets some render states before it runs, reset the affected render states to the values we want to use for further rendering.

    C#
    // Undo the renderstate settings from the shader
//            GraphicsDevice.RenderState.CullMode =
//                CullMode.CullCounterClockwiseFace;
//            GraphicsDevice.RenderState.DepthBufferWriteEnable = true;

base.Draw(gameTime);


Creating a Depth Texture

Demonstrates how to create a texture that contains depth information for a scene using a render target and a custom effect.

To render a depth texture, also called a shadow map, create a RenderTarget2D and render your scene with an effect that saves pixel depth instead of pixel color.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download DepthTexture_Sample.zip.

Creating a Depth Texture

To create a depth texture

  1. Declare a render target variable using a RenderTarget2D.

    C#
    RenderTarget2D shadowRenderTarget;

  2. Create the render target.

    C#
    shadowRenderTarget = new RenderTarget2D(GraphicsDevice,
    graphics.GraphicsDevice.Viewport.Width,
    graphics.GraphicsDevice.Viewport.Height);

  3. Create a depth-stencil object using a DepthStencilState.

    C#
    DepthStencilState depthStencilState = new DepthStencilState();

  4. Set up depth testing to preserve depth data by setting the DepthBufferFunction to CompareFunction.LessEqual.

    C#
    depthStencilState.DepthBufferFunction = CompareFunction.LessEqual;
GraphicsDevice.DepthStencilState = depthStencilState;

  5. Prepare to render the scene to your render target by calling GraphicsDevice.SetRenderTarget.

    C#
    GraphicsDevice.SetRenderTarget(shadowRenderTarget);

  6. In the Draw method, use a SpriteBatch to draw the depth texture.

    C#
    // Render the depth texture
Rectangle rect = new Rectangle(
    graphics.GraphicsDevice.Viewport.X,
    graphics.GraphicsDevice.Viewport.Y,
    graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height);

spriteBatch.Begin();
spriteBatch.Draw(map, rect, Color.White);
spriteBatch.End();

  7. Reset the graphics device to draw to the back buffer by calling GraphicsDevice.SetRenderTarget.

    C#
    GraphicsDevice.SetRenderTarget(null);

Rendering Depth in a Custom Effect

To render depth in a custom effect

  1. Use a custom effect to render depth values in HLSL. Set the following effect states, and create a technique that will call a custom vertex shader and a custom pixel shader.

    Effect File (.fx)
    technique ShadowMapRender
{
    pass P0
    {
        CullMode = NONE;
        ZEnable = TRUE;
        ZWriteEnable = TRUE;
        AlphaBlendEnable = FALSE;

        VertexShader = compile vs_2_0 RenderShadowMapVS();
        PixelShader  = compile ps_2_0 RenderShadowMapPS();
    }
}

  2. The custom vertex shader generates position and depth values.

    The vertex shader returns two values to the pixel shader. The first value is a POSITION that transforms the incoming POSITION into the view and projection space of the light source. The second value is the depth value of the transformed POSITION. The depth is calculated by dividing the z coordinate by the w coordinate to calculate depth between 0 and 1. The depth value is subtracted from 1 to get more precision using a floating point format. The depth is packed into a TEXCOORD semantic (in this case, TEXCOORD0).

    Effect File (.fx)
    struct VS_SHADOW_OUTPUT
{
    float4 Position : POSITION;
    float Depth : TEXCOORD0;
};
    Effect File (.fx)
    VS_SHADOW_OUTPUT RenderShadowMapVS(float4 vPos: POSITION)
{
    VS_SHADOW_OUTPUT Out;
    Out.Position = GetPositionFromLight(vPos);
    // Depth is Z/W.  This is returned by the pixel shader.
    // Subtracting from 1 gives us more precision in floating point.
    Out.Depth.x = 1-(Out.Position.z/Out.Position.w);
    return Out;
}

  3. The custom pixel shader renders depth to the render target.

    The pixel shader returns the depth of each pixel in the TEXCOORD0 semantic. The depth is returned in the red component. For a SurfaceFormat.Single, each pixel stores a 32-bit floating point value. The greater number of bits per pixel that you use, the smoother the shadow will be; this shader will work using almost any SurfaceFormat.

    Effect File (.fx)
    float4 RenderShadowMapPS( VS_SHADOW_OUTPUT In ) : COLOR
{
    // The depth is Z divided by W. We return
    // this value entirely in a 32-bit red channel
    // using SurfaceFormat.Single.  This preserves the
    // floating-point data for finer detail.
    return float4(In.Depth.x,0,0,1);
}


Transformations and Collision Testing

Transformations and Collision Testing

Provides classes and methods for manipulating vectors and matrices. This section discusses math and includes examples of common math-related game tasks.

In This Section

Positioning the Camera
Demonstrates how to position the camera so that all objects in a scene are within the view frustum while maintaining the camera's original orientation.
Transforming a Point
This example demonstrates how to use the Vector3 and Matrix classes to transform a point. A matrix transform can include scaling, rotating, and translating information.
Rotating and Moving the Camera
Demonstrates how to rotate and move a camera in a 3D environment.
Moving the Camera on a Curve
Demonstrates how to use the Curve and CurveKey classes to move a camera along the shape of a curve.
Selecting an Object with a Mouse (Windows)
Demonstrates how to check whether the mouse is positioned over a 3D object by creating a ray starting at the camera's near clipping plane and ending at its far clipping plane.
Bounding Volumes and Collisions
Collision detection determines whether objects in a game world overlap each other.
Testing for Collisions
Demonstrates how to use the BoundingSphere class to check whether two models are colliding.

Expand image See Also

Concepts

Math Content Catalog at XNA Creators Club Online


Positioning the Camera

Positioning the Camera

Demonstrates how to position the camera so that all objects in a scene are within the view frustum while maintaining the camera's original orientation.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample..

Download FitCameraToScene_Sample.zip.

Positioning the Camera to View All Objects in a Scene

To position the camera to view all objects in a scene

  1. Create a BoundingSphere class that contains all of the objects in the scene. To create the sphere, loop through all of the objects in the scene, merging the BoundingSphere classes that contain them with BoundingSphere.CreateMerged.

  2. If you are not already tracking the BoundingSphere classes for collision detection, use CreateFromBoundingBox or CreateFromPoints to create them from BoundingBox classes or points.

    In this example, the BoundingSphere classes are created from BoundingBox classes.

    C#
    BoundingSphere GetSceneSphere()
{
    BoundingSphere sceneSphere =
        new BoundingSphere(new Vector3(.5f, 1, .5f), 1.5f);
    for (int z = 0; z < 5; z++)
    {
        for (int x = 0; x < 5; x++)
        {
            BoundingSphere boundingSphere =
                sphere.Meshes[0].BoundingSphere;
            boundingSphere.Center = new Vector3(x * 3, 0, z * 3);

            sceneSphere = BoundingSphere.CreateMerged(
                sceneSphere, boundingSphere);
        }
    }

    return sceneSphere;
}

  3. Set the position of the camera to the center of the BoundingSphere that contains the scene.

    C#
    cameraPosition = sceneSphere.Center;

  4. Determine the distance from the center of the BoundingSphere that the camera needs to be to view the entire scene.

    This distance is equal to the hypotenuse of the triangle formed by the center of the sphere, the desired camera position, and the point where the sphere touches the view frustum. One angle of the triangle is known to be the field of view of the camera divided by two. One leg of the triangle is known to be the radius of the sphere. Given these two measurements, you can calculate the hypotenuse as the radius of the sphere divided by the sine of half the field of view.

    C#
    float distanceToCenter =
    sceneSphere.Radius / (float)Math.Sin(FOV / 2);

  5. Get the Backward vector of the view Matrix and flip its X component.

    C#
    Vector3 back = view.Backward;
back.X = -back.X; //flip x's sign

  6. To move the camera backward with respect to its orientation, multiply the desired distance by the adjusted back vector from the previous step.

    The camera is now facing the center of the sphere containing the scene and is far enough back that the sphere fits in the camera's view frustum.

    C#
    cameraPosition += (back * distanceToCenter);

Expand image See Also

Rotating and Moving the Camera


Transforming a Point

Transforming a Point

This example demonstrates how to use the Vector3 and Matrix classes to transform a point. A matrix transform can include scaling, rotating, and translating information.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download TransformPoint_Sample.zip.

Transforming a Point with a Matrix

To transform a point

  1. Create a Matrix by using CreateRotationY or one of the other Create methods.
  2. Pass the point and the Matrix to the Vector3.Transform method.
C#
static Vector3 RotatePointOnYAxis(Vector3 point, float angle)
{
    // Create a rotation matrix that represents a rotation of angle radians.
    Matrix rotationMatrix = Matrix.CreateRotationY(angle);

    // Apply the rotation matrix to the point.
    Vector3 rotatedPoint = Vector3.Transform(point, rotationMatrix);

    return rotatedPoint;
}

Expand image See Also

Matrix Creation Methods

CreateRotationX
CreateRotationY
CreateRotationZ
CreateScale
CreateTranslation


Rotating and Moving the Camera

Rotating and Moving the Camera

Demonstrates how to rotate and move a camera in a 3D environment. You can rotate the camera about its y-axis, and move it forward and backward. You control the camera's position and orientation by using the directional keys on your keyboard or by using the D-pad of your Xbox 360 gamepad.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download FirstPersonCamera_Sample.zip.

Overview

This sample is based on several assumptions.

  • The camera will move frequently, so the camera view Matrix is created and set every time Game.Update is called.
  • The projection Matrix may also change frequently for effects such as zooming.
  • You have added a model to the project.

For the sake of simplicity, the sample limits the camera object to rotation about the y axis (vertical spin) and movement along the z axis (forward and backward). The following steps show you how to render the sample scene.

To render the sample scene

  1. Determine the location and orientation of the camera object.

  2. Create a view matrix using the camera position, the camera orientation (also called the look at point), and the up vector using CreateLookAt.

  3. Create a perspective matrix using the near and far clipping planes and the aspect ratio using CreatePerspectiveFieldOfView.

  4. In the Draw method of your game, initialize a BasicEffect object with the world, view, and projection matrices and render all of the 3D objects in the scene.

Rotating and Moving a Camera

To rotate and move the camera

  1. Determine the camera's position in world coordinates.

  2. Determine the reference Vector3 to which the rotation of the camera is relative.

    The direction should not change during the game, and usually it will be (0, 0, 1) or (0, 0, −1).

    C#
    // Set the direction the camera points without rotation.
Vector3 cameraReference = new Vector3(0, 0, 1);

  3. Create a rotation Matrix for the amount of rotation for the camerat.

    Because the camera is limited to one axis of rotation, this matrix represents the rotation of the camera around its own y-axis. Use CreateRotationY to create a rotation Matrix representing the rotation around the y-axis.

    C#
    Matrix rotationMatrix = Matrix.CreateRotationY(avatarYaw);

  4. Use Transform and the rotation Matrix to transform the reference vector.

    This represents the direction the camera is pointing in transformed (or view) space.

    C#
    // Create a vector pointing the direction the camera is facing.
Vector3 transformedReference = Vector3.Transform(cameraReference, rotationMatrix);

  5. Add the camera's current position to the transformed direction vector.

    The result is the position to which the camera is pointing.

    C#
    // Calculate the position the camera is looking at.
Vector3 cameraLookat = cameraPosition + transformedReference;

  6. Create a new view Matrix using CreateLookAt.

  7. Use CreateLookAt to pass the camera's current position and the transformed direction vector.

    The third parameter of CreateLookAt is the up direction of the camera. Typically, it is Vector3.Up (0, 1, 0). This matrix Matrix controls how world coordinates are transformed to camera coordinates.

    C#
    // Set up the view matrix and projection matrix.
view = Matrix.CreateLookAt(cameraPosition, cameraLookat, new Vector3(0.0f, 1.0f, 0.0f));

  8. Use CreatePerspectiveFieldOfView to create a new projection Matrix.

    This Matrix controls how camera coordinate values are transformed to screen coordinates.

    The first parameter is the field of view of the projection Matrix expressed in radians. A typical field of view of 45 degrees would be expressed as p/4 radians. The second parameter is the aspect ratio of the projection Matrix; it corrects for the difference in width and height of a viewspace. The third and fourth parameters specify the near and far distances at which the objects will be visible.

    C#
    // Set distance from the camera of the near and far clipping planes.
static float nearClip = 1.0f;
static float farClip = 2000.0f;

    Viewport viewport = graphics.GraphicsDevice.Viewport;
float aspectRatio = (float)viewport.Width / (float)viewport.Height;

proj = Matrix.CreatePerspectiveFieldOfView(viewAngle, aspectRatio, nearClip, farClip);

  9. Loop through each 3D model to be rendered using the projection matrix and view matrix created above.

    An identity matrix simplifies the code for the world matrix.

    C#
    void DrawModel(Model model, Matrix world, Texture2D texture)
{
    foreach (ModelMesh mesh in model.Meshes)
    {
        foreach (BasicEffect be in mesh.Effects)
        {
            be.Projection = proj;
            be.View = view;
            be.World = world;
            be.Texture = texture;
            be.TextureEnabled = true;
        }
        mesh.Draw();
    }
}


Moving the Camera on a Curve

Moving the Camera on a Curve

Demonstrates how to use the Curve and CurveKey classes to move a camera along the shape of a curve.

Using Curves allows a path to be defined by a small number of control points with the Curves calculating the points on the path between the control points.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download ScriptedCamera_Sample.zip.

Scripting the Camera to Follow a Curve

To script camera movement

  1. Create an instance of the Curve class for each component being scripted.

    In this case, you need two sets of three curves. One is for each of the x, y, and z components of the camera's position, and the other is for the position at which the camera is looking (the "look-at" position).

    C#
    class Curve3D
{

    public Curve curveX = new Curve();
    public Curve curveY = new Curve();
    public Curve curveZ = new Curve();
    ...
}

    Curve3D cameraCurvePosition = new Curve3D();
Curve3D cameraCurveLookat = new Curve3D();

  2. Set the PreLoop and PostLoop type of each Curve.

    The PreLoop and PostLoop types determine how the curve will interpret positions before the first key or after the last key. In this case, the values will be set to CurveLoopType.Oscillate. Values past the ends of the curve will change direction and head toward the opposite side of the curve.

    C#
    curveX.PostLoop = CurveLoopType.Oscillate;
curveY.PostLoop = CurveLoopType.Oscillate;
curveZ.PostLoop = CurveLoopType.Oscillate;

curveX.PreLoop = CurveLoopType.Oscillate;
curveY.PreLoop = CurveLoopType.Oscillate;
curveZ.PreLoop = CurveLoopType.Oscillate;

  3. Add CurveKeys to the Curves.

  4. Specify the time each CurveKey should be reached and the camera position when the CurveKey is reached.

    In this case, each point in time will have three CurveKeys associated with it – one for each of the x, y, and z coordinates of the point on the Curve.

    C#
    public void AddPoint(Vector3 point, float time)
{
    curveX.Keys.Add(new CurveKey(time, point.X));
    curveY.Keys.Add(new CurveKey(time, point.Y));
    curveZ.Keys.Add(new CurveKey(time, point.Z));
}

    void InitCurve()
{
    float time = 0;
    cameraCurvePosition.AddPoint(new Vector3(7.5f, 0, -45), time);
    cameraCurveLookat.AddPoint(new Vector3(9, 0, 9), time);
    time += 2000;
    cameraCurvePosition.AddPoint(new Vector3(3f, 0, -36), time);
    time += 2000;
    cameraCurvePosition.AddPoint(new Vector3(12f, 0, -30), time);
    time += 2000;
    cameraCurvePosition.AddPoint(new Vector3(3f, 0, -24), time);
    time += 2000;
    cameraCurvePosition.AddPoint(new Vector3(12f, 0, -18), time);
    time += 2000;
    ...
    cameraCurvePosition.SetTangents();
    cameraCurveLookat.SetTangents();
}

  5. Loop through each Curve setting the TangentIn and TangentOut of each CurveKey.

    The tangents of the CurveKeys control the shape of the Curve. Setting the tangents of the CurveKeys to the slope between the previous and next CurveKey will give a curve that moves smoothly through each point on the curve.

    C#
    public void SetTangents()
{
    CurveKey prev;
    CurveKey current;
    CurveKey next;
    int prevIndex;
    int nextIndex;
    for (int i = 0; i < curveX.Keys.Count; i++)
    {
        prevIndex = i - 1;
        if (prevIndex < 0) prevIndex = i;

        nextIndex = i + 1;
        if (nextIndex == curveX.Keys.Count) nextIndex = i;

        prev = curveX.Keys[prevIndex];
        next = curveX.Keys[nextIndex];
        current = curveX.Keys[i];
        SetCurveKeyTangent(ref prev, ref current, ref next);
        curveX.Keys[i] = current;
        prev = curveY.Keys[prevIndex];
        next = curveY.Keys[nextIndex];
        current = curveY.Keys[i];
        SetCurveKeyTangent(ref prev, ref current, ref next);
        curveY.Keys[i] = current;

        prev = curveZ.Keys[prevIndex];
        next = curveZ.Keys[nextIndex];
        current = curveZ.Keys[i];
        SetCurveKeyTangent(ref prev, ref current, ref next);
        curveZ.Keys[i] = current;
    }
}

    static void SetCurveKeyTangent(ref CurveKey prev, ref CurveKey cur,
    ref CurveKey next)
{
    float dt = next.Position - prev.Position;
    float dv = next.Value - prev.Value;
    if (Math.Abs(dv) < float.Epsilon)
    {
        cur.TangentIn = 0;
        cur.TangentOut = 0;
    }
    else
    {
        // The in and out tangents should be equal to the
        // slope between the adjacent keys.
        cur.TangentIn = dv * (cur.Position - prev.Position) / dt;
        cur.TangentOut = dv * (next.Position - cur.Position) / dt;
    }
}

  6. Add code to evaluate the x, y, and z coordinates of the Curves at any given time by passing the elapsed time to the Evaluate method of each of the Curves.

    C#
    public Vector3 GetPointOnCurve(float time)
{
    Vector3 point = new Vector3();
    point.X = curveX.Evaluate(time);
    point.Y = curveY.Evaluate(time);
    point.Z = curveZ.Evaluate(time);
    return point;
}

  7. Create a variable to track the amount of time that has passed since the camera started moving.

    C#
    double time;

  8. In Game.Update, set the camera's position and look-at position based on the elapsed time since the camera started moving, and then set the camera's view and projection matrices as in Rotating and Moving the Camera.

    C#
    // Calculate the camera's current position.
Vector3 cameraPosition =
    cameraCurvePosition.GetPointOnCurve((float)time);
Vector3 cameraLookat =
    cameraCurveLookat.GetPointOnCurve((float)time);

  9. In Game.Update, use gameTime.ElapsedGameTime.TotalMilliseconds to increment the time since the camera started moving.

    C#
    time += gameTime.ElapsedGameTime.TotalMilliseconds;

Expand image See Also

Rotating and Moving the Camera


Selecting an Object with a Mouse (Windows)

Selecting an Object with a Mouse (Windows)
See Also
CollapseAll image

Demonstrates how to check whether the mouse is positioned over a 3D object by creating a ray starting at the camera's near clipping plane and ending at its far clipping plane.
Note
This example applies only to Windows development. The Mouse and MouseState objects are not supported on Xbox 360.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample.

Detecting Whether a User Clicked a 3D Object

To check whether the mouse is positioned over a 3D object

  1. Get the current state of the mouse by using GetState.

    C#
    MouseState mouseState = Mouse.GetState();

  2. Get the current screen coordinates of the mouse from X and Y.

    C#
    int mouseX = mouseState.X;
int mouseY = mouseState.Y;

  3. Using Viewport.Unproject, determine points in world space on the near and far clipping planes. For the point on the near plane, pass a source vector with x and y set to the mouse position, and z set to 0.

  4. For the point on the far plane, pass a source vector with x and y set to the mouse position, and z set to 1.

  5. Create a translation matrix for a point that is the origin, (0,0,0).

  6. For both points, pass Unproject the current projection matrix, the view matrix.

    C#
    Vector3 nearsource = new Vector3((float)mouseX, (float)mouseY, 0f);
Vector3 farsource = new Vector3((float)mouseX, (float)mouseY, 1f);

Matrix world = Matrix.CreateTranslation(0, 0, 0);

Vector3 nearPoint = GraphicsDevice.Viewport.Unproject(nearsource,
    proj, view, world);

Vector3 farPoint = GraphicsDevice.Viewport.Unproject(farsource,
    proj, view, world);

  7. Create a Ray whose origin is at the near point and whose direction points to the far point.

    C#
    // Create a ray from the near clip plane to the far clip plane.
Vector3 direction = farPoint - nearPoint;
direction.Normalize();
Ray pickRay = new Ray(nearPoint, direction);

  8. Loop throught each object in the scene using the Intersects method to check whether the Ray intersects each object.

  9. If the Ray intersects an object, check whether it is the closest object intersected so far. If it is, store the object and the distance at which it was intersected, replacing any previously stored object.

  10. When you completely loop through the objects, the last object stored will be the closest object underneath the area the user clicked.

Expand image See Also

Rotating and Moving the Camera


Bounding Volumes and Collisions

Bounding Volumes and Collisions

Collision detection determines whether objects in a game world overlap each other.

The XNA Framework provides several classes and methods to speed implementation of collision detection systems in games.

  • Bounding Volume Classes
  • Non-Bounding Volume Classes
  • Contains and Intersects Methods
  • Adding New Collision Data Structures

Bounding Volume Classes

The XNA Framework has three classes that represent three-dimensional volumes. Use a bounding volume class to approximate the volume occupied by a complex object using a volume that is less complex and faster for performing collision checking. All of the bounding volume classes support intersection and containment tests with each other and the plane and ray classes.

Bounding Sphere

The BoundingSphere Structure represents the space occupied by a sphere.

There are several benefits of using a bounding sphere for collision detection.

  • Sphere to sphere checks are very fast. To check for collision between two spheres, the distance between the centers of the spheres is compared to the sum of the radii of both spheres. If the distance is less than the combined radii of both spheres, the spheres intersect.
  • The BoundingSphere Structure class is compact. It stores only a vector representing its center and its radius.
  • Unlike a bounding box, a bounding sphere doesn’t need to be recreated if the model rotates. If the model being bounded rotates, the bounding sphere will still be large enough to contain it.
  • Moving a bounding sphere is inexpensive. Just add a value to the center.

There is one major drawback to using the bounding sphere class for collision detection.

  • Unless the object being approximated is sphere shaped, the bounding sphere will have some empty space, which could result in false positive results. Long narrow objects will have the most empty space in their bounding spheres.

Bounding Box

The BoundingBox Structure represents the space occupied by a box. The bounding box class is axis aligned. Each face of the bounding box is perpendicular to the x-axis, the y-axis, or the z-axis.

There are several benefits of using the bounding box for collision detection.

  • The bounding box class fits rectangular shapes aligned with the axis very well. Compared to the bounding sphere class, the bounding box class provides a much tighter fit for non-rotated rectangular objects.
  • Because the bounding box class is axis aligned, you can make certain assumptions that result in collision checks between bounding boxes being quicker than a bounding box that can be rotated.

There are a few drawbacks of using the bounding box for collision detection.

  • Rotating a bounding box causes it to no longer be axis aligned. Because of this, if you rotate a model being bounded, you will need to recreate the bounding box. Doing so can be slow, since all the points in an object are iterated through to get the bounding box. If the model has not changed orientation, you can translate the bounding box instead of recreating it.
  • If the model being bounded is not aligned to the axis, the bounding box will have some empty space. The amount of empty space will be greatest when the object is rotated 45 degrees from an axis.
  • Empty space in the bounding box can result in false positives when checking for collision.

Bounding Frustum

Use a BoundingFrustum Class to create a bounding volume that corresponds to the space visible to the camera. You create a bounding frustum from the combined view and projection matrix that the camera is using currently. If the camera moves or rotates, you need to recreate the bounding frustum. The bounding frustum isn’t used to determine when two objects collide, but rather when an object intersects with the volume of space viewable by the camera. Objects that do not intersect and are not contained by the bounding frustum are not visible to the camera and don’t need to be drawn. For complex models, this can reduce the number of pixels that need to be rendered.

Non-Bounding Volume Classes

Plane

The Plane Structure describes a 2D plane. The plane is defined by a normal vector (perpendicular to the plane) and a point on the plane. The plane class supports intersection tests with the bounding volume classes. The plane class’s intersection test returns the tested object's position relative to the plane. The return value indicates whether the object intersects the plane. If the object does not intersect the plane, the return value indicates whether the object is on the plane’s front side or back side.

Ray

The Ray Structure describes a ray starting at a point in space. The ray structure supports intersection tests with the bounding volume classes. The return value of the ray intersection tests is the distance the intersection occurred at, or null if no intersection occurred.

Model

In addition to the information needed to draw a model, the Model Class contains bounding volumes for its parts. When a model is imported, the content pipeline calculates the bounding sphere for each of the model's parts. To check for collision between two models, you can compare the bounding spheres for one model to all of the bounding spheres of the other model.

Contains and Intersects Methods

Bounding volume classes have methods to support two types of collision tests: intersection tests and containment tests. The intersects methods check whether the two objects being tested overlap in any way. As soon as the test finds that the objects do intersect, it returns without trying to determine the degree of the intersection. The contains methods determine whether the objects simply intersect or whether one of the objects is completely contained by the other. Since the intersects methods need only determine whether an intersection occurred, they tend to be faster than the contains methods.

Adding New Collision Data Structures

When implementing other bounding volume classes and intersection tests, you will probably need to add a custom content pipeline processor. For example, your game might need to use convex hulls for collision detection. You could use a custom processor to determine the convex hull and then place it in the model's tag field. Then, when the model is loaded at run time, the convex hull information would be available in the model. For more information, see Extending a Standard Content Processor.

Expand image See Also

Tasks

FuelCell: "Ships" Passing in the Night

XNA Creators Club Online

Collision Content Catalog at XNA Creators Club Online


Testing for Collisions

Testing for Collisions

Demonstrates how to use the BoundingSphere class to check whether two models are colliding.
Tip
This technique is implemented in the FuelCell game, a game developed by following a series of focused articles that discuss basic 3D game development. For more information, see FuelCell: "Ships" Passing in the Night.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download CollisionBetweenSpheres_Sample.zip.

Detecting Whether Two Models Collide

To check whether two objects are colliding

  1. Track the position of a model as it moves about the game world.

    C#
    struct WorldObject
{
    public Vector3 position;
    public Vector3 velocity;
    public Model model;
    public Texture2D texture2D;
    public Vector3 lastPosition;
    public void MoveForward()
    {
        lastPosition = position;
        position += velocity;
    }
    public void Backup()
    {
        position -= velocity;
    }
    public void ReverseVelocity()
    {
        velocity.X = -velocity.X;
    }
}
  2. Make a nested loop with the first model's meshes as the outer loop and the second model's meshes as the inner loop.

  3. Inside the loop, follow these steps.

    1. Get the bounding sphere for the current mesh of the first model and the current mesh of the second model.

    2. Offset the bounding spheres by the current positions of the models.

    3. Call the BoundingSphere.Intersects method to check the pairs of bounding spheres for collision.

      If the method returns true, the objects are colliding.

    4. If the models are colliding, break out of the loop.

      C#
      static void CheckForCollisions(ref WorldObject c1, ref WorldObject c2)
{
    for (int i = 0; i < c1.model.Meshes.Count; i++)
    {
        // Check whether the bounding boxes of the two cubes intersect.
        BoundingSphere c1BoundingSphere = c1.model.Meshes[i].BoundingSphere;
        c1BoundingSphere.Center += c1.position;

        for (int j = 0; j < c2.model.Meshes.Count; j++)
        {
            BoundingSphere c2BoundingSphere = c2.model.Meshes[j].BoundingSphere;
            c2BoundingSphere.Center += c2.position;

            if (c1BoundingSphere.Intersects(c2BoundingSphere))
            {
                c2.ReverseVelocity();
                c1.Backup();
                c1.ReverseVelocity();
                return;
            }
        }
    }
}
Note
For an example of determining a particle's path after it hits a surface, see Vector3.Reflect.

Expand image See Also

Tasks

Rotating and Moving the Camera

Concepts

Bounding Volumes and Collisions
Collision Content Catalog at XNA Creators Club Online


"What Is" Articles for Sprites and Effects

"What Is" Articles for Sprites and Effects

These articles provide a brief introduction into graphics pipeline functionality.

In This Section

What Is Antialiasing?
Antialiasing is a technique for softening or blurring sharp edges so they appear less jagged when rendered.
What Is a Back Buffer?
A back buffer is a render target whose contents will be sent to the device when GraphicsDevice.Present is called.
What Is Blend State?
Blend state controls how color and alpha values are blended when combining rendered data with existing render target data.
What Is Color Blending?
Color blending mixes two colors together to produce a third color.
What Is a Depth Buffer?
A depth buffer contains per-pixel floating-point data for the z depth of each pixel rendered. A depth buffer may also contain stencil data which can be used to do more complex rendering such as simple shadows or outlines.
What Is Depth Stencil State?
Depth stencil state controls how the depth buffer and the stencil buffer are used.
What Is a Depth Texture?
A depth texture, also known as a shadow map, is a texture that contains the data from the depth buffer for a particular scene.
What Is an Effect?
An effect initializes the graphics pipeline for performing transforms, lighting, applying textures, and adding per-pixel visual effects such as a glow or a lens flare. Under the covers, an effect implements at least one shader for processing vertices and at least one shader for processing pixels.
What Is a Model Bone?
A model bone is a matrix that represents the position of a mesh as it relates to other meshes in a 3D model.
What Is a Profile?
A profile is a feature set that is implemented in hardware. The Reach profile implements high-level shader language (HLSL) Shader Model 2.0 and the HiDef profile implements HLSL Shader Model 3.0.
What Is Rasterizer State?
Rasterizer state determines how to render 3D data such as position, color, and texture onto a 2D surface.
What Is a Render Target?
A render target is a memory buffer for rendering pixels. One common use for a render target is offscreen rendering.
What Is Sampler State?
Sampler state determines how texture data is sampled using texture addressing modes, filtering, and level of detail.
What Is a Stencil Buffer?
A stencil buffer contains per-pixel integer data which is used to add more control over which pixels are rendered. A stencil buffer can also be used in combination with a depth buffer to do more complex rendering such as simple shadows or outlines.
What are Vectors, Matrices, and Quaternions?
Presents an overview of the math-related functionality provided by the XNA Framework.
What Is a View Frustum?
A view frustum is a 3D volume that defines how models are projected from camera space to projection space. Objects must be positioned within the 3D volume to be visible.
What Is a Viewport?
A viewport is a 2D rectangle that defines the size of the rendering surface onto which a 3D scene is projected.


What Is Antialiasing?

What Is Antialiasing?
See Also
CollapseAll image

Antialiasing is a technique for softening or blurring sharp edges so they appear less jagged when rendered.

Antialiasing is accomplished by multisampling each pixel at multiple pixel locations and combining the samples to generate a final pixel color. Increasing the number of samples per pixel increases the amount of antialiasing which generates a smoother edge. 4x multisampling requires four samples per pixel and 2x multisampling requires two sampler per pixel. Use the MultiSampleCount property of the PresentationParameters class to set the number of samples for the back buffer.

In XNA Game Studio 3.1, use GraphicsAdapter.CheckDeviceMultiSampleType to query the hardware for multisample support. In XNA Game Studio 4.0, set the PreferMultiSampling property on the GraphicsDeviceManager class to true to enable multisampling for the back buffer. This will be ignored if the hardware does not support multisampling.

Expand image See Also

Enabling Antialiasing (Multisampling)


What Is a Back Buffer?

What Is a Back Buffer?
See Also
CollapseAll image

A back buffer is a render target whose contents will be sent to the device when GraphicsDevice.Present is called.

The graphics pipeline renders to a render target. The particular render target that the device presents to the display is called the back buffer. Use the BackBufferWidth and BackBufferHeight properties to get the back buffer dimensions. Render directly to the back buffer or to a render target by configuring the device using GraphicsDevice.SetRenderTarget and GraphicsDevice.SetRenderTargets.

For Windows, the back buffer is created to match the dimensions of the ClientBounds by default. For Xbox 360, the back buffer is created with the dimensions that have been specified by the user. When going into full-screen mode on Windows, it is often desirable to set the back buffer dimensions to match the DisplayMode dimensions so that the game ("display") resolution does not change when it goes into the full-screen mode.

The back buffer created for Xbox 360 is not necessarily the same size as the final resolution on a television connected for display. The Xbox 360 automatically scales output to the television resolution selected by the user in the System Blade. If the aspect ratio of the back buffer is different from the aspect ratio of the television display mode, the Xbox 360 will automatically add black bars (also called letterboxing) if the user's display is not widescreen.

In addition, if you request a back-buffer resolution that is not supported by the output device, the XNA framework automatically selects the highest resolution supported by the output device. For example, if you create a back-buffer with a resolution of 1920x1080 (for example, 1080p or 1080i) and display it on a device with 480i resolution, the back-buffer is resized to 480i automatically.

Expand image See Also

Viewport


What Is Blend State?

What Is Blend State?
CollapseAll image

Blend state controls how color and alpha values are blended when combining rendered data with existing render target data.

The blend state class, BlendState, contains state that controls how colors are blended. Each time you render, the pixel data you generate (call it source data) is stored in a render target. The render target might be empty or it might already contain data (call it destination data). Blending occurs each time you combine source and destination data.

You have a lot of control over how you blend the source and the destination data. For example, you can choose to overwrite the destination with the source data by setting BlendState.Opaque or combine the data by adding them together using BlendState.Additive. You can blend only the color data or the alpha data, or both, by setting up the blending functions ColorBlendFunction and AlphaBlendFunction. You can even limit your blending operation to one or more colors (or channels) using ColorWriteChannels.

For an example that creates and uses a state object, see Creating a State Object.


What Is Color Blending?

What Is Color Blending?
See Also
CollapseAll image

Color blending mixes two colors together to produce a third color.

The first color is called the source color which is the new color being added. The second color is called the destination color which is the color that already exists (in a render target, for example). Each color has a separate blend factor that determines how much of each color is combined into the final product. Once the source and destination colors have been multiplied by their blend factors, the results are combined according to the specified blend function. The normal blend function is simple addition.

The blend formula looks like this:

(source * sourceBlendFactor) blendFunction (destination*destinationBlendFactor)

The source blend factor is specified by the ColorSourceBlend property, and the destination blend factor is specified by the ColorDestinationBlend property. The ColorBlendFunction property specifies the blend function to use, normally BlendFunction.Add. In that case the formula reduces to this:

(source * sourceBlendFactor) + (destination * destinationBlendFactor)

When no blending is done, a source pixel overwrites a destination pixel. When blending, you can create a lot of special effects using the blending properties:

Blend type | Blend settings
Alpha Blending | (source × Blend.SourceAlpha) + (destination × Blend.InvSourceAlpha)
Additive Blending | (source × Blend.One) + (destination × Blend.One)
Multiplicative Blending | (source × Blend.Zero) + (destination × Blend.SourceColor)
2X Multiplicative Blending | (source × Blend.DestinationColor) + (destination × Blend.SourceColor)

Figure 1. This picture illustrates four common blend modes. From left to right: Alpha blending, Additive blending, Multiplicative blending, and 2X Multiplicative blending. The top image in each column is the source image and below, it's effect when added to the destination.

Alpha blending uses the alpha channel of the source color to create a transparency effect so that the destination color appears through the source color. For example, if you clear your backbuffer to Color.Gray, it will be colored (0.5,0.5,0.5,1). If you then take a white color with a partial alpha value (1,1,1,0.4), the result will be 60 percent of the destination color and 40 percent of the source: (0.5 x 0.6) + (1 x 0.4). The resulting color will be (0.7,0.7,0.7, 1). The alpha values are multiplied as well - (.6 x 1) + .4 gives us an alpha value of 1.

When drawing a sprite using the SpriteBatch class, choose BlendState.AlphaBlend to configure alpha blending.

By default, the alpha channel is blended along with the red, green, and blue channels using the ColorSourceBlend and ColorDestinationBlend properties. You can choose to customize the blending for just the alpha channel by using the AlphaSourceBlend and AlphaDestinationBlend properties.

Expand image See Also

Concepts

What Is a Sprite?
3D Pipeline Basics


What Is a Depth Buffer?

What Is a Depth Buffer?
CollapseAll image

A depth buffer contains per-pixel floating-point data for the z depth of each pixel rendered. A depth buffer may also contain stencil data which can be used to do more complex rendering such as simple shadows or outlines.

When a pixel is rendered, color data as well as depth data can be stored. If a pixel is rendered a second time - such as when two objects overlap - depth testing determines which pixel is closer to the camera. The depth function determines what to do with the test result. For example, if CompareFunction.LessEqual is the current depth function, if the current pixel depth is less than or equal to the previous pixel depth, the current pixel depth is written to the depth buffer. Values that fail the depth test are discarded.

The depth of a pixel, which ranges between 0.0 and 1.0, is determined based on the view and projection matrices. A pixel that touches the near plane has depth 0, a pixel that touches the far plane has depth 1. As each object in the scene is rendered, normally the pixels that are closest to the camera are kept, as those objects block the view of the objects behind them.

A depth buffer may also contain stencil bits - for this reason it's often called a depth-stencil buffer. The depth format describes the data format of the depth buffer. The depth buffer is always 32 bits, but those bits can be arranged in different ways, similar to how texture formats can vary. A common depth format is DepthFormat.Depth24Stencil8, where 24 bits are used for the depth data and 8 bits are used for the stencil data. DepthFormat.Depth24Stencil8Single is a more unusual format where the 24 bits for the depth buffer are arranged as a floating point value. Use DepthFormat.None if you don't want to create a depth buffer.

Use DepthStencilState.DepthBufferEnable to enable or disable depth buffering. Use the DepthStencilState.DepthBufferFunction to change the comparison function used for the depth test. Clear the depth buffer by passing ClearOptions.DepthBuffer to GraphicsDevice.Clear.

In previous versions of XNA Game Studio, DepthStencilBuffer is a class; you create one and set it on the device when you want depth buffering. You cannot read data from it or render to it. A default depth buffer is created when the back buffer is created. A common problem occurs when drawing into a render target without creating a matching depth buffer (matching means size and data format must be the same). This was true even if you disable depth buffering. And you needed to set the depth buffer to null if it does not match the render target.

In XNA Game Studio 4.0, there is no DepthStencilBuffer type. The runtime automatically creates a depth buffer when a render target is created, and you specify the format for the depth buffer in a render target's constructor along with the surface format. This prevents a render target from being created without a matching depth buffer.


What Is Depth Stencil State?

What Is Depth Stencil State?
CollapseAll image

Depth stencil state controls how the depth buffer and the stencil buffer are used.

The depth buffer stores floating-point depth or z data for each pixel while the stencil buffer stores integer data for each pixel. The depth-stencil state class, DepthStencilState, contains state that controls how depth and stencil data impacts rendering.

During rendering, the z position (or depth) of each pixel is stored in the depth buffer. When rendering pixels more than once -- such as when objects overlap -- depth data is compared between the current pixel and the previous pixel to determine which pixel is closer to the camera. When a pixel passes the depth test, the pixel color is written to a render target and the pixel depth is written to the depth buffer. For more information about a depth buffer, see What Is a Depth Buffer?.

A depth buffer may also contain stencil data, which is why a depth buffer is often called a depth-stencil buffer. Use a stencil function to compare a reference stencil value -- a global value you set -- to the per-pixel value in the stencil buffer to mask which pixels get saved and which are discarded. For more information about a stencil buffer, see What Is a Stencil Buffer?


What Is a Depth Texture?

What Is a Depth Texture?
See Also
CollapseAll image

A depth texture, also known as a shadow map, is a texture that contains the data from the depth buffer for a particular scene.

Each pixel value contains the depth of the geometry in that pixel. Use a depth texture to render accurate shadows using a technique called shadow mapping. There are two common ways to encode the depth information into a texture. The first is to use a standard RGBA surface format for your texture, and copy all four color (32-bits of data) into the buffer (a depth format is usually assigned to 24 or 32 bits). The second is to use a floating-point texture format and a floating-point depth buffer (depth buffers are normally fixed-point). When using the floating-point approach, it is more accurate to subtract the depth from 1.0 before storing it because of the way floating-point numbers are encoded.

Although depth textures are useful for efficient shadow mapping, they are not universally supported by hardware. These techniques require a custom vertex and pixel shader that is not available on Windows Phone. For an example, see Creating a Depth Texture.

Expand image See Also

Concepts

What Is a Depth Buffer?


What Is an Effect?

What Is an Effect?
CollapseAll image

An effect initializes the graphics pipeline for performing transforms, lighting, applying textures, and adding per-pixel visual effects such as a glow or a lens flare. Under the covers, an effect implements at least one shader for processing vertices and at least one shader for processing pixels.

During rendering, the graphics pipeline transforms 3D geometry to a 2D surface, giving you the option of adding lighting, texturing and many other per-vertex or per-pixel visual effects. An effect initializes the pipeline to render 3D geometry using vertex and pixel shaders, although you can also render a 2D sprite with an effect.

There are two types of effects. The first type runs on all platforms including Windows Phone, Windows, and Xbox 360; this effect is easy to get up and running quickly. The second type runs on the Windows and Xbox 360 platforms only; this effect is designed for developers who are interested in developing custom shaders for high performance.

In This Section

What Is a Configurable Effect?
A configurable effect is an optimized rendering effect designed for Windows, Xbox 360, and Windows Phone. A configurable effect is created using a built-in object with options for user configuration.
What Is a Programmable Effect?
A programmable effect is a general purpose rendering effect designed for Windows and Xbox 360 (not Windows Phone). A programmable effect is created from vertex and pixel shaders written in the High Level Shading Language (HLSL) and is completely customizable.


What Is a Configurable Effect?

What Is a Configurable Effect?
See Also
CollapseAll image

A configurable effect is an optimized rendering effect designed for Windows, Xbox 360, and Windows Phone. A configurable effect is created using a built-in object with options for user configuration.

A configurable effect is an easy way to get started rendering effects. There are several built-in configurable effects which have been designed to run efficiently on mobile GPU hardware. These effects are also available on Windows and Xbox 360, where they can be a useful starting point for developers who do not want to write their own custom shaders. Use a configurable effect in a game designed for the Reach or HiDef profile.

Use one of the following configurable effects to implement these rendering effects:

  • Basic Lighting and Fog
  • Character Animation
  • More Sophisticated Lighting with a Light Map
  • Billboards and Imposters
  • Lighting Highlights Using an Environment Map

Basic Lighting and Fog

Use the BasicEffect configurable effect to implement general purpose functionality, including the following: transformations; lighting with three directional lights; material colors using ambient, diffuse, and specular properties; a single texture; and fog. To improve speed, fog calculations are based on depth instead of distance from the camera. When you choose a basic effect, you can improve the performance of your game if you don't use any fog or if you only use one of the three available directional lights. For an example, see Creating a Basic Effect.

Character Animation

Use the SkinnedEffect configurable effect to animate a character. This effect uses bones and weights to transform a mesh (an object is made up of several meshes). Simply set up a set of bones for a model when you create content, and then transform the bones during the render loop. You can also use this class for hardware instancing by setting WeightsPerVertex to one, and replicating the geometry data with an additional bone index channel. This is similar to the way the shader instancing technique works in the instancing sample.

More Sophisticated Lighting with a Light Map

Use the DualTextureEffect configurable effect with a prebaked radiosity lightmap to add more sophisticated lighting to a scene. This effect uses two textures, the base texture with the texture detail and an overlay texture with the prebaked lighting.

The two textures are combined using a fixed modulate2X blend formula as shown here:

result.rgb = x.rgb * y.rgb * 2;
result.a = x.a * y.a;

Billboards and Imposters

Use the AlphaTestEffect configurable effect to use alpha data to test whether to draw a pixel. The effect uses a CompareFunction to compare the alpha value for a pixel against the ReferenceAlpha value to determine whether to draw the pixel. This functionality is used for drawing a billboard (a 2D sprite that faces the camera) and an imposter (a 2D sprite that is integrated into a larger scene).

Lighting Highlights Using an Environment Map

Use the EnvironmentMapEffect configurable effect to generate fast, specular highlights that add shininess to an object. The effect uses two textures, a base texture with the texture detail and a cubemap whose six sides reflect the environment onto the object. Use EnvironmentMapAmount to control the amount of the environment map to add to the object. Also, use FresnelFactor to control how much the edge of an object reflects specular lighting.

Pseudo code for the lighting calculations looks similar to this:

viewAngle = dot(eyeToVertexVector, vertexNormal)
fresnel   = saturate(pow(1 – abs(viewAngle), FresnelFactor)
amount    = fresnel * EnvironmentMapAmount

result.rgb  = lerp(diffuseTexture.rgb, cubeTexture.rgb, amount)
result.rgb += cubeTexture.a * EnvironmentMapSpecular

Expand image See Also

What Is a Programmable Effect?


What Is a Programmable Effect?

What Is a Programmable Effect?
See Also
CollapseAll image

A programmable effect is a general purpose rendering effect designed for Windows and Xbox 360 (not Windows Phone). A programmable effect is created from vertex and pixel shaders written in the High Level Shading Language (HLSL) and is completely customizable.

A vertex shader initializes the per-vertex processing of the graphics pipeline and a pixel shader initializes the per-pixel processing of the pipeline. Combining a vertex shader and a pixel shader in a programmable effect gives you tremendous flexibility over the way the pipeline processes your data. Use a programmable effect in a game designed for the Reach or HiDef profile.

Here is an idea of the steps involved with getting a programmable effect up and running.

  • Design the shaders using HLSL. An effect usually contains one vertex and one pixel shader.
  • Create a technique that invokes the shaders; a technique determines which shaders are used. The technique and the shaders are usually stored in an effect (.fx) file.
  • Create an effect object in your game using the Effect class. This usually means loading the effect file with the Content Pipeline which is illustrated in Creating a Custom Effect.
  • Initialize the effect parameters. This usually includes parameters for matrix transformations and one or more textures but could include any other custom parameters you have added to the effect. For an example, see Creating a Custom Effect with Texturing.
  • Render the effect by applying the effect to the device and rendering the scene. This is also illustrated in Creating a Custom Effect.

There are many examples using custom effects in the education catalog on the XNA Creators Club Online Web Site.

Expand image See Also

What Is a Configurable Effect?


What Is a Model Bone?

What Is a Model Bone?
CollapseAll image

A model bone is a matrix that represents the position of a mesh as it relates to other meshes in a 3D model.

A complex computer-generated object, often called a model, is made up of many vertices and materials organized into a set of meshes. In the XNA Framework, a model is represented by the Model class. A model contains one or more meshes, each of which is represented by a ModelMesh class. Each mesh is associated with one bone represented by the ModelBone class.

The bone structure is set up to be hierarchical to make controlling each mesh (and therefore the entire model) easier. At the top of the hierarchy, the model has a Root bone to specify the overall position and orientation of the model. Each ModelMesh object contains a ParentBone and one or more ModelBone. You can transform the entire model using the parent bone as well as transform each individual mesh with its bone. To animate one or more bones, update the bone transforms during the render loop by calling Model.CopyAbsoluteBoneTransformsTo Method, which iterates the individual bone transforms to make them relative to the parent bone. To draw an entire model, loop through a mesh drawing each sub mesh.


What Is a Profile?

What Is a Profile?
See Also
CollapseAll image

A profile is a feature set that is implemented in hardware. The Reach profile implements high-level shader language (HLSL) Shader Model 2.0 and the HiDef profile implements HLSL Shader Model 3.0.

Prior to XNA Game Studio 4.0, the XNA Framework exposed feature sets and behaviors that varied for each platform (Windows and Xbox 360). These feature sets and behaviors were implemented at runtime as a common core of functionality on all platforms, as well as platform-specific functionality. This required platform-dependent code to be developed and tested for each platform.

To simplify multiplatform development, XNA Game Studio 4.0 creates a profile. A profile is platform independent so you do not need to query for capability bits. The APIs for accessing the features implemented in hardware are consistent across platforms so that game code written for one platform will compile and run on another platform with little or no changes. A game will not run if a hardware device does not meet the profile requirements.

You can set the profile at design time by using the XNA Game Studio property page in Microsoft Visual Studio 2010 Express for Windows Phone or you can set a profile at runtime by using the GraphicsProfile property. For more information, see Selecting Reach vs. HiDef.

There are two profiles, Reach and HiDef: one for fully featured, high-powered hardware, and one for less featured, available-everywhere hardware. Reach is designed to broadly cover all platforms and has a limited set of graphic features and capabilities implemented in hardware. This profile is designed to support the widest variety of devices, more specifically Windows-based computers, an Xbox 360, and Windows Phone. Reach dramatically speeds up writing multiplatform games because you can design and debug game code on one platform knowing that it will run on other platforms. Performance is dependent on the hardware available for each platform.

The HiDef profile is designed for the highest performance and largest available set of graphic features. Use the HiDef profile to target hardware with more enhanced graphic capabilities such as an Xbox 360 and a Windows-based computer with at least a DirectX 10 GPU. More specifically, the HiDef profile requires a GPU with Xbox 360-level capabilities such as multiple render targets (MRT), floating-point surface formats, and per-vertex texture fetching. These are optional capabilities in DirectX 9 hardware, but all are required to support HiDef. Since DirectX 9 graphic cards are not required to support these features, it is easier to say that the HiDef profile requires at least a DirectX 10-capable GPU. A HiDef game will run on a DirectX 9 card if it implements the named DirectX 10 features.

If you try to run a HiDef game on a device such as a Windows Phone device) that does not support HiDef, an exception is thrown at runtime. Additionally, if you try to access HiDef features from a game built for a Reach profile, the runtime throws an exception. To find out which profile your target hardware supports, call GraphicsAdapter.IsProfileSupported Method.

Reach vs. HiDef Comparison

Differences between the Reach and HiDef profiles are presented next. For more detail, see the sections following the table.

Profiles | Reach | HiDef
Platforms | Windows Phone 7, Xbox 360, and any computer running Windows with a DirectX 9 GPU that supports at least Shader Model 2.0. | Xbox 360, and any Windows-based PC with at least a DirectX 10 (or equivalent) GPU. See the paragraph above for more detail.
Shader Model | 2.0 (Windows Phone, however, does not support custom shaders.) | 3.0 (Xbox 360 supports custom shader extensions such as vfetch that are unavailable on Windows.)
Maximum texture size | 2,048 | 4,096
Maximum cube map size | 512 | 4,096
Maximum volume texture size | Volume textures are not supported. | 256
Nonpower of two textures | Yes with limitations: no wrap addressing mode, no mipmaps, no DXT compression on nonpower of two textures. | Yes
Nonpower of two cube maps | No | Yes
Nonpower of two volume textures | Volume textures are not supported. | Yes
Maximum number of primitives per draw call | 65,535 | 1,048,575
Maximum number of vertex streams | 16 | 16
Maximum vertex stream stride | 25 | 255
Index buffer formats | 16 bit | 16 and 32 bit
Vertex element formats | Color, Byte4, Single, Vector2, Vector3, Vector4, Short2, Short4, NormalizedShort2, NormalizedShort4 | All of the Reach vertex element formats, as well as HalfVector2 and HalfVector4.
Texture formats | Color, Bgr565, Bgra5551, Bgra4444, NormalizedByte2, NormalizedByte4, Dxt1, Dxt3, Dxt5 | All of the Reach texture formats, as well as Alpha8, Rg32, Rgba64, Rgba1010102, Single, Vector2, Vector4, HalfSingle, HalfVector2, HalfVector4. Floating point texture formats do not support filtering.
Vertex texture formats | Vertex texturing is not supported. | Single, Vector2, Vector4, HalfSingle, HalfVector2, HalfVector4
Render target formats | Call QueryRenderTargetFormat to find out what is supported. | Call QueryRenderTargetFormat to find out what is supported.
Multiple render targets | No | Up to four. All must have the same bit depth. Alpha blending and independent write masks per render target are supported.
Occlusion queries | No | Yes
Separate alpha blend | No | Yes

Shader Model

The Reach profile supports HLSL Shader Model 2.0 and the configurable effects for all platforms. Windows Phone does not support custom shaders.

The HiDef profile supports HLSL Shader Model 3.0. Xbox 360 also supports custom shader extensions such as vertex fetching (vfetch).

Textures

Texture size limitations are listed in the table comparing the two profiles. These numbers are the maximum width or height of a texture that can be consumed by the profile. HiDef supports larger textures and volume textures.

HiDef supports the following features without limitations; Reach supports the following features only for power-of-two textures:

  • The wrap texture addressing mode
  • Mipmaps
  • DXT compression

Formats

Many older formats from previous versions of XNA Game Studio were removed from XNA Game Studio 4.0.

  • These vertex element formats no longer are supported:

    • Rg32
    • Rgba32
    • Rgba64
    • UInt101010
    • Normalized101010

  • These texture formats no longer are supported:

    • Dxt2
    • Dxt4
    • Bgr555
    • Bgr444
    • Bgra2338
    • Bgr233
    • Bgr24
    • Bgr32
    • Bgra1010102
    • Rgba32
    • Rgb32
    • NormalizedShort2
    • NormalizedShort4
    • Luminance8
    • Luminance16
    • LuminanceAlpha8
    • LuminanceAlpha16
    • Palette8
    • PaletteAlpha16
    • NormalizedLuminance16
    • NormalizedLuminance32
    • NormalizedAlpha1010102
    • NormalizedByte2Computed
    • VideoYuYv
    • Video UyVy
    • VideoGrGb
    • VideoRgBg
    • Multi2Bgra32

There are a wide variety of render target formats. Call GraphicsAdapter.QueryRenderTargetFormat Method to find out what is supported for your hardware. The runtime also has a built-in fallback mechanism if the format you request is unavailable. The format parameters used when creating render targets and back buffers are now named "preferredFormat" instead of "format." The runtime will try to create a resource with the exact format passed in, and will fallback to the closest possible match (based on similar bit depth, number of channels, and so on) if that format is unavailable. For example, if you run a Reach game on a Windows Phone device using a 16-bit render target format and then run the game on an Xbox 360 that does not support 16-bit render targets, the runtime will switch the render-target format to a Color format.

XNA Game Studio 4.0 changes the Color structure from BGRA to RGBA byte ordering. Most games will never notice the change because both the Color structure and the texture and vertex declaration creation code were changed. If you have code that creates Color format textures directly, setting their contents from a byte array rather than a strongly typed Color[], you will need to swap the order of your red and blue channels.

Conclusion

XNA Game Studio has introduced the Reach profile for Xbox 360, Windows, and Windows Phone devices, and the HiDef profile for Xbox 360 and Windows devices. The HiDef profile includes a strict superset of the functionality in the Reach profile, which means that HiDef implements all Reach functionality and more. If you run a Reach game on a HiDef platform, the framework will enforce Reach rules. Use this to your advantage when you develop a multiplatform game. You can design and debug on the most powerful hardware with the knowledge that the game will compile and run on the other less powerful platforms when you are ready to test your game. The runtime will throw an exception if you try to set the profile to HiDef on hardware that does not support HiDef, or if you are running a Reach profile game that tries to access HiDef features.

Cited Works

"Selecting Reach vs. HiDef." Shawn Hargreaves Blog. July 2010. http://blogs.msdn.com/b/shawnhar/archive/2010/07/19/selecting-reach-vs-hidef.aspx (Last accessed August 2, 2010)

Expand image See Also

Reference

XNA Game Studio Properties Page


What Is Rasterizer State?

What Is Rasterizer State?
CollapseAll image

Rasterizer state determines how to render 3D data such as position, color, and texture onto a 2D surface.

Rasterization takes a 3D scene containing polygons (which are represented by triangles and vertices) and renders the scene onto a 2D surface. This requires mapping or transforming the 3D vertices into 2D vertices using the world, view, and projection transforms to calculate the final vertex positions in the viewing frustum. To reduce the amount of geometry that needs to be rasterized, the rasterizer clips geometry so that only the parts of a polygon that are visible get processed. The resulting list of transformed vertices is then scan-converted to determine how to fill pixel positions between vertices. Scissor testing takes a list of user-supplied rectangles to further limit the areas you may want rasterized.

Create a rasterizer state object using the RasterizerState class. Set the rasterizer state to the graphics device using the RasterizerState property.

This is the default state for rasterization:

  • Render triangles with clockwise winding order.

  • Fill primitives so they are solid.

  • Turn off scissor testing.

  • Enable multisampling.

  • Avoid using either depth bias or sloped scaled depth bias.

These are the corresponding API states:

  • Set CullMode to CullMode.CullCounterClockwiseFace.

  • Set FillMode to FillMode.Solid.

  • Set ScissorTestEnable to false.

  • Set MultiSampleAntiAlias to true.

  • Set DepthBias and SlopeScaleDepthBias to 0.

Built-in state objects make it easy to create objects with the most common rasterizer state settings. CullNone, CullClockwise, and CullCounterClockwise are the most common settings. For an example of creating a state object, see Creating a State Object.


What Is a Render Target?

What Is a Render Target?
CollapseAll image

A render target is a memory buffer for rendering pixels. One common use for a render target is offscreen rendering.

The graphics pipeline has a default render target called the back buffer, which is a portion of video memory that contains the next frame to be drawn. If your program does not create a render target, and you render to the screen, you are using the back buffer by default. Use the RenderTarget2D class to create additional render targets. A common scenario is to render to one or more offscreen render targets and assemble them in the back buffer to produce the final frame.

The RenderTarget2D class derives from the Texture2D class because a render target contains a 2D texture. This is a change from previous versions of XNA Game Studio. To draw a render target like you would draw a texture, use the render target object directly. That is, pass a RenderTarget2D object to any method that takes a Texture2D object. To read render target data back to the CPU, call the Texture2D.GetData Method. For more information about using a render target, see Creating a Render Target.

To use a render target, create a RenderTarget2D object with the width, height, and other options you prefer. Call GraphicsDevice.SetRenderTarget to make your render target the current render target. Any subsequent Draw calls you make will draw into your render target rather than the back buffer. When you are finished rendering, call GraphicsDevice.SetRenderTarget and pass it null to set the device to render to the back buffer again.

There are other considerations for choosing width and height when you create a render target. For example, you should choose the width and height of the back buffer to match the size of your game window (although Windows Phone and the Xbox360 scale the final result to match the user's screen). This prevents any resizing when the back buffer is copied to the screen. However, an offscreen render target does not need to have the same width and height as the back buffer. The final image can be rendered in several small render targets and then reassembled in a larger render target.

A render target has a surface format, which describes how many bits are allocated to each pixel, and how they are divided between red, green, blue, and alpha. For example, SurfaceFormat.Bgr565 allocates 16 bits per pixel; 5 bits for blue and red and 6 bits for green.

A render target works in cooperation with a depth-stencil buffer. When creating a render target, the depth format for the depth-stencil buffer is specified as one of the parameters to the render target constructor. Anytime you set a new render target to the device, the matching depth buffer is also set to the device.


What Is Sampler State?

What Is Sampler State?
CollapseAll image

Sampler state determines how texture data is sampled using texture addressing modes, filtering, and level of detail.

Sampling is done each time a texture pixel, or texel, is read from a texture. A texture contains an array of texels, or texture pixels. The position of each texel is denoted by (u,v), where u is the width and v is the height, and is mapped between 0 and 1 based on the texture width and height. The resulting texture coordinates are used to address a texel when sampling a texture.

When texture coordinates are below 0 or above 1, the texture address mode defines how the texture coordinate addresses a texel location. For example, when using TextureAddressMode.Clamp, any coordinate outside the 0-1 range is clamped to a maximum value of 1, and minimum value of 0 before sampling.

If the texture is too large or too small for the polygon, the texture is filtered to fit the space. A magnification filter enlarges a texture, a minification filter reduces the texture to fit into a smaller area. Texture magnification repeats the sample texel for one or more addresses which yields a blurrier image. Texture minification is more complicated because it requires combining more than one texel value into a single value. This can cause aliasing or jagged edges depending on the texture data. The most popular approach for minification is to use a mipmap. A mipmap is a multi-level texture. The size of each level is a power-of-two smaller than the previous level down to a 1x1 texture. When minification is used, a game chooses the mipmap level closest to the size that is needed at render time.

Use the SamplerState class to create a sampler state object. Set the sampler state to the graphics device using the GraphicsDevice.SamplerStates Property property.

This is the default state for sampling:

  • Use linear filtering.

  • Wrap texture addresses on boundaries.

  • Set the maximum anisotropy value to 4.

  • Do not use mip maps or LOD bias.

These are the corresponding API states:

  • Set Filter to TextureFilter.Linear.

  • Set AddressU, AddressV, and AddressW to TextureAddressMode.Wrap.

  • Set MaxAnisotropy to 4.

  • Set MaxMipLevel and MipMapLevelOfDetailBias to 0.

Built-in state objects make it easy to create objects with the most common sampler state settings. The most common settings are LinearClamp, LinearWrap, PointClamp, PointWrap, AnisotropicClamp, and AnisotropicWrap. For an example of creating a state object, see Creating a State Object.


What Is a Stencil Buffer?

What Is a Stencil Buffer?
CollapseAll image

A stencil buffer contains per-pixel integer data which is used to add more control over which pixels are rendered. A stencil buffer can also be used in combination with a depth buffer to do more complex rendering such as simple shadows or outlines.

A stencil buffer operates similarly to a depth buffer. So similarly, that stencil data is stored in a depth buffer. While depth data determines which pixel is closest to the camera, stencil data can be used as a more general purpose per-pixel mask for saving or discarding pixels. To create the mask, use a stencil function to compare a reference stencil value -- a global value -- to the value in the stencil buffer each time a pixel is rendered.

For example, to remove an object from a scene, fill a stencil buffer with a cut out pattern (using zeros) for each pixel where the object is visible. This is done by setting the reference stencil value to 0, clearing the stencil buffer, and rendering the object. Then set the reference stencil value to 1, set the compare function to CompareFunction.LessEqual, and render again. The stencil data masks those pixels whose value is non zero but less than 1, resulting in drawing over (or removing) the object.

A stencil buffer can be used in more sophisticated ways such as specifying StencilOperations that go beyond replace or discard and increment or decrement the stencil buffer during a stencil test. Then combine this with a StencilMask to mask the portion of the stencil buffer that is updated.

To use a stencil buffer, the DepthFormat of the depth buffer must reserve some bits for the stencil data; the DepthFormat.Depth24Stencil8 format uses 8 bits for a stencil buffer as an example. Combining stencil data with an 8 bit DepthStencilState.StencilMask Property provide up to eight different stencil buffers.


What are Vectors, Matrices, and Quaternions?

What are Vectors, Matrices, and Quaternions?
See Also
CollapseAll image

The XNA Framework Math Libraries are in the Microsoft.Xna.Framework namespace alongside a number of additional types that deal with the XNA Framework Application model.

  • Coordinate system
  • Mathematical Constants and Scalar Manipulation
  • Basic Geometric Types
  • Precision and Performance

Coordinate system

The XNA Framework uses a right-handed coordinate system, with the positive z-axis pointing toward the observer when the positive x-axis is pointing to the right, and the positive y-axis is pointing up.

Mathematical Constants and Scalar Manipulation

The XNA Framework provides the MathHelper Members class for manipulating scalar values and retrieving some common mathematical constants. This includes methods such as the ToDegrees and ToRadians utility methods for converting between degrees and radians.

Basic Geometric Types

The XNA Framework Math library has multiple basic geometric types for manipulating objects in 2D or 3D space. Each geometric type has a number of mathematical operations that are supported for the type.

Vectors

The XNA Framework provides the Vector2, Vector3, and Vector4 classes for representing and manipulating vectors. A vector typically is used to represent a direction and magnitude. In the XNA Framework, however, it also could be used to store a coordinate or other data type with the same storage requirements.

Each vector class has methods for performing standard vector operations such as:

  • Dot product
  • Cross product
  • Normalization
  • Transformation
  • Linear, Cubic, Catmull-Rom, or Hermite spline interpolation.

Matrices

The XNA Framework provides the Matrix class for transformation of geometry. The Matrix class uses row major order to address matrices, which means that the row is specified before the column when describing an element of a two-dimensional matrix. The Matrix class provides methods for performing standard matrix operations such as calculating the determinate or inverse of a matrix. There also are helper methods for creating scale, rotation, and translation matrices.

Quaternions

The XNA Framework provides the Quaternion structure to calculate the efficient rotation of a vector by a specified angle.

Curves

The Curve class represents a hermite curve for interpolating varying positions at different times without having to explicitly define each position. The curve is defined by a collection of CurveKey points representing each varying position at different times. This class can be used not only for spatial motion, but also to represent any response that changes over time.

Bounding Volumes

The XNA Framework provides the BoundingBox, BoundingFrustum, BoundingSphere, Plane, and Ray classes for representing simplified versions of geometry for the purpose of efficient collision and hit testing. These classes have methods for checking for intersection and containment with each other.

Precision and Performance

The XNA Framework Math libraries are single-precision. This means that the primitives and operations contained in this library use 32-bit floating-point numbers to achieve a balance between precision and efficiency when performing large numbers of calculations.

A 32-bit floating-point number ranges from –3.402823e38> to +3.402823e38. The 32 bits store the sign, mantissa, and exponent of the number that yields seven digits of floating-point precision. Some numbers—for example p, 1/3, or the square root of two—can be approximated only with seven digits of precision, so be aware of rounding errors when using a binary representation of a floating-point number. For more information about single-precision numbers, see the documentation for the Single data type.

Expand image See Also

Concepts

Math Content Catalog at XNA Creators Club Online


What Is a View Frustum?

What Is a View Frustum?
See Also
CollapseAll image

A view frustum is a 3D volume that defines how models are projected from camera space to projection space. Objects must be positioned within the 3D volume to be visible.

The XNA Framework uses a projection matrix to calculate a vertex position in the view frustum. The matrix reverses the y-coordinate (so it is top down) to reflect a screen origin at the top-left corner. After the matrix is applied, the homogenous vertices (that is, the vertices contain (x,y,z,w) coordinates) are converted to non-homogeneous coordinates so they can be rasterized.

The most common type of projection is called a perspective projection, which makes objects near the camera appear bigger than objects in the distance. For a perspective projection, the view frustum can be visualized as a clipped pyramid whose top and bottom are defined by the near and far clipping planes as shown in the figure.

A view frustum is defined by a field of view (fov), and by the distances of the front and back clipping planes, which are specified in z-coordinates. Set up a perspective fov using the CreatePerspectiveFieldOfView method.

Expand image See Also

What Is a Viewport?


What Is a Viewport?

What Is a Viewport?
See Also
CollapseAll image

A viewport is a 2D rectangle that defines the size of the rendering surface onto which a 3D scene is projected.

A viewport is represented by the Viewport class. The Width and Height properties of the rectangle are used by methods for a variety of calculations such as creating a projection matrix using CreatePerspectiveFieldOfView. Viewport dimensions default to the dimensions of the back buffer, but they can be a different size. For example, to create a split screen game, you might render multiple viewports to a single render target. The viewport dimensions do not correspond to the display dimensions, which are determined by the DisplayMode property, or to the game window, which is determined by the ClientBounds property.

Use the Clear method to reset a render-target surface. Overloaded versions accept various parameters such as a set of rectangles that define more specific areas rather than the entire surface. Specify in the ClearOptions enumeration which buffer or render target to reset.

Use the Clear method to clear stencil bits within a depth buffer. Set the options parameter to determine which render-target components are cleared. The color argument sets the color value of the render target after it has been cleared. The depth parameter clears the depth buffer to the specified depth: 0.0 is the closest distance, and 1.0 is the farthest. Finally, the stencil parameter resets the stencil bits to the specified value. Use integers ranging from 0 to 2n−1, where n is the stencil buffer bit depth.

Desktop Area Versus Display Area

The size of the desktop area in Windows is shown by the DisplayMode Width and Height properties. The display area is different from the game window, which can be obtained from the ClientBounds dimensions. On Windows, set the display mode width and height to match the back buffer width and height. This prevents the need to resize the back buffer when switching between windowed and full screen mode. On Xbox 360, you need to display the text and menu items within the inner 80 percent of the display area. This prevents text or menus from getting cut off at the edge of a television screen. This inner area is called the title safe area.

The game window size is shown by the ClientBounds Width and Height properties. The game window size matches the display size when a game is running in full-screen mode. The game window size may be smaller for a game running in windowed mode. Use ClientBounds.X and ClientBounds.Y for the upper-left coordinates of the game window relative to the display area. On Xbox 360, the ClientBounds Width and Height properties are always equal to the DisplayMode Width and Height, and ClientBounds.X and ClientBounds.Y are always (0, 0).

Figure 1. DisplayMode and ClientBounds areas on Windows and Xbox 360.

Expand image See Also

What Is a Back Buffer?


Responding to User Input

Responding to User Input

This section describes how to use XNA Game Studio to retrieve information about user input.

In This Section

Overview of User Input and Input Devices
Describes the various types of input devices that can be used with XNA Game Studio.
Working with Multitouch and Accelerometer Input
Topics that provide guidance on writing code to support multitouch and accelerometer input for XNA Game Studio.
Working with Text and Keyboard Input
Topics that provide guidance on writing code to support text and keyboard input for XNA Game Studio.
Working with Mouse Input
Topics that provide guidance on writing code to support mouse input for XNA Game Studio.
Working with Xbox 360 Controllers
Topics that provide guidance on writing code to support Xbox 360 controller input for XNA Game Studio.

Expand image See Also

Concepts

Input Content Catalog at XNA Creators Club Online


Overview of User Input and Input Devices

Overview of User Input and Input Devices

Input is a general term referring to the process of receiving actions from the user. In XNA Game Studio, the Microsoft.Xna.Framework.Input namespace provides support for most input devices.

Note
Methods related to input devices unavailable on the platform your game is running on are always available to your code. For example, you can access all GamePad methods on Windows Phone, but they will not return valid information. Although using these methods will not cause exceptions or build errors in your code, they will silently fail when run.

Input Device and Platform Compatibility

Although the complete Input API is available to your code on any platform, input devices will often apply to just one or a couple of platforms. It's useful to familiarize yourself with what devices are available for each platform supported by XNA Game Studio.

The following table lists the input devices available for each platform.

Input device | Windows Phone | Xbox 360 | Windows
GamePad | * | Yes | Yes
Keyboard | Yes | Yes | Yes
Mouse | Yes |  | Yes
TouchPanel | Yes |  |
Accelerometer | Yes |  |
Microphone | Yes | Yes | Yes

* Only the Back button can be detected on Windows Phone.

Windows Phone Platform Notes

Physical keyboards may or may not be present on Windows Phone devices; you should not rely on the presence of a physical keyboard. For text input, you should use a software input panel (SIP), which will work on all devices, including those with physical keyboards. For more information, see Displaying a Software Input Panel (Windows Phone, Xbox 360).

If the Windows Phone device does have a physical keyboard, the same methods used for keyboards on Windows or Xbox 360 can be used, given a few caveats. For more information, see Working with Hardware Keyboards (Windows Phone).

Mouse methods may be used to track the position of the primary touchpoint on a Windows Phone device's touchpanel, which can simplify your code if you're interested in only one touchpoint on a multitouch device. For more information, see Getting the Mouse Position (Windows, Windows Phone).

For Windows Phone's multitouch device, you can use the raw touch data provided by the TouchPanel class, but you can also use 's support for predefined gestures if your input fits one of the supported gesture types. For information about working with raw multitouch input, see Working with Touch Input (Windows Phone). For information about gesture support, see Detecting Gestures on a Multitouch Screen (Windows Phone).

An Accelerometer API is not provided by XNA Game Studio. For more information about how to use Silverlight's Accelerometer class with XNA Game Studio, see Retrieving Accelerometer Input (Windows Phone).

The microphone on Windows Phone can be used to capture audio that can be used in your game. For more information, see Recording Sounds with Microphones.

Xbox 360 Platform Notes

For information about working with the Xbox 360 gamepad, see Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows), Detecting an Xbox 360 Controller Button Press in the Current Frame (Xbox 360, Windows), and Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows).

For information about working with alternative input devices such as dance pads, guitar controllers, flight sticks, and racing wheels on Xbox 360, see Using Alternative Input Devices (Xbox 360). Kinect is not currently supported by XNA Game Studio.

For information about support for microphones and headsets on Xbox 360, see Recording Sounds with Microphones.

Windows Platform Notes

For information about handling mouse input on Windows, see Getting the Mouse Position (Windows, Windows Phone).

For information about handling keyboard input on Windows, see Detecting a Key Press (Windows, Windows Phone, Xbox 360).

For information about support for microphones and headsets on Windows, see Recording Sounds with Microphones

Expand image See Also

Concepts

Input Content Catalog at XNA Creators Club Online


Working with Multitouch and Accelerometer Input

Working with Multitouch and Accelerometer Input

This section provides topics that demonstrate how to write code that supports multitouch and accelerometer input in XNA Game Studio.

In This Section

Working with Touch Input (Windows Phone)
Demonstrates how to detect and use multitouch input in an XNA game.
Detecting Gestures on a Multitouch Screen (Windows Phone)
Demonstrates how to detect and use multitouch gestures in an XNA game.
Retrieving Accelerometer Input (Windows Phone)
Demonstrates how to detect and use accelerometer input in an XNA Game Studio game on Windows Phone.

See Also

Overview of User Input and Input Devices Responding to User Input


Working with Touch Input (Windows Phone)

Working with Touch Input (Windows Phone)
See Also
CollapseAll image

Complete Sample

The code in this topic shows you the technique for detecting and using multitouch input. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample

XNA Game Studio 4.0 supports multitouch input on Windows Phone 7. The primary class that provides this support is TouchPanel, which can:

  • Determine the touch capabilities of the current device.
  • Get the current state of the touch panel.
  • Detect touch gestures such as flicks, pinches, and drags. (For more information, see Detecting Gestures on a Multitouch Screen (Windows Phone).)
Note
If you are interested in responding to only the first (primary) touch on the screen, use the mouse technique described in Getting the Mouse Position (Windows, Windows Phone). This technique, in addition to being simpler, allows you to use the same code for Windows Phone and Windows.

Determining the Capabilities of the Touch Input Device

By using TouchPanel.GetCapabilities you can determine if the touch panel is available. You also can determine the maximum touch count (the number of touches that can be detected simultaneously).

To determine the capabilities of the touch device

  1. Call TouchPanel.GetCapabilities, which returns a TouchPanelCapabilities structure.

  2. Ensure TouchPanelCapabilities.IsConnected is true, indicating that the touch panel is available for reading.

  3. You then can use the TouchPanelCapabilities.MaximumTouchCount property to determine how many touch points are supported by the touch panel.

Note

All touch panels for Windows Phone return a MaximumTouchCount value of 4 on XNA Game Studio 4.0.

The following code demonstrates how to determine if the touch panel is connected, and then reads the maximum touch count.

C#
TouchPanelCapabilities tc = TouchPanel.GetCapabilities();
if(tc.IsConnected)
{
    return tc.MaximumTouchCount;
}

Getting Multitouch Data from the Touch Input Device

You can use TouchPanel.GetState to get the current state of the touch input device. It returns a TouchCollection structure that contains a set of TouchLocation structures, each containing information about position and state for a single touchpoint on the screen.

To read multitouch data from the touch input device

  1. Call TouchPanel.GetState to get a TouchCollection representing the current state of the device.

  2. For each TouchLocation in the TouchCollection, read the location and state data provided for each touchpoint.

The following code demonstrates how to get the current state of the touch input device and read touch data from each TouchLocation. It checks to see if a touch location has been pressed or has moved since the last frame, and if so, draws a sprite at the touch location.

C#
// Process touch events
TouchCollection touchCollection = TouchPanel.GetState();
foreach (TouchLocation tl in touchCollection)
{
    if ((tl.State == TouchLocationState.Pressed)
            || (tl.State == TouchLocationState.Moved))
    {

        // add sparkles based on the touch location
        sparkles.Add(new Sparkle(tl.Position.X,
                 tl.Position.Y, ttms));

    }
}

Expand image See Also

Reference

Microsoft.Xna.Framework.Input.Touch
TouchPanel
TouchPanelCapabilities
TouchLocation
TouchLocationState


Detecting Gestures on a Multitouch Screen (Windows Phone)

Detecting Gestures on a Multitouch Screen (Windows Phone)
See Also
CollapseAll image

This topic demonstrates how to detect and use multitouch gestures in an XNA game.

Complete Sample

The code in this topic shows you the technique for detecting and using multitouch gestures. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample

XNA Game Studio 4.0 supports multitouch gesture-based input on Windows Phone 7. The primary class that provides this support is TouchPanel, which provides the ability to:

  • Designate which gestures should be detected.
  • Query to see if any gestures are available for processing.
Note
Gesture support is provided as a conventient subset of the features possible on a multitouch input device. For more information about general multitouch programming, see Working with Touch Input (Windows Phone).

Detecting Gestures on a Multitouch Screen

To enable gesture support and detect gestures in a Windows Phone game

  1. Set the gestures to enable with TouchPanel.EnabledGestures. This can be one value, or a combination of values, in the GestureType enumeration. Performance can be decreased by enabling all gestures, so it is a good practice to enable only the gestures you'll be using in your game.

  2. During your game loop, check to see if any gestures are available with TouchPanel.IsGestureAvailable. When IsGestureAvailable is false, there are no more gestures in the queue.

  3. If gestures are available, call TouchPanel.ReadGesture to get a GestureSample that contains the data for the gesture.

Note
Some gestures will be preceded by another gesture that begins the gesture. For instance, a DoubleTap gesture is always preceded by a Tap gesture. For more information about the various gesture types supported, see GestureType.

Example

The following code illustrates the procedure for detecting gestures on a multitouch screen.

  • Enabling gestures in the game's constructor:

    C#
    // set up touch gesture support: make vertical drag and flick the
// gestures that we're interested in.
TouchPanel.EnabledGestures =
    GestureType.VerticalDrag | GestureType.Flick;

  • Detecting gestures in the game's Update method:

    C#
    // get any gestures that are ready.
while (TouchPanel.IsGestureAvailable)
{
    GestureSample gs = TouchPanel.ReadGesture();
    switch (gs.GestureType)
    {
        case GestureType.VerticalDrag:
            // move the poem screen vertically by the drag delta
            // amount.
            poem.offset.Y -= gs.Delta.Y;
            break;

        case GestureType.Flick:
            // add velocity to the poem screen (only interested in
            // changes to Y velocity).
            poem.velocity.Y += gs.Delta.Y;
            break;
    }
}

Expand image See Also

Reference

Microsoft.Xna.Framework.Input.Touch
TouchPanel
GestureType
GestureSample


Retrieving Accelerometer Input (Windows Phone)

Retrieving Accelerometer Input (Windows Phone)
See Also
CollapseAll image

This topic demonstrates how to detect and use accelerometer input in an XNA Game Studio game on Windows Phone.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample

Accelerometer input on Windows Phone 7 is not directly supported by XNA Game Studio 4.0, but it is easy to add to an existing project.

Note
Accelerometer input is only supported on Windows Phone. Other platforms have no access to this feature.

Adding Microsoft.Devices.Sensors to Your Application

Accelerometer input on Windows Phone 7 is handled by the Microsoft.Devices.Sensors assembly, which must be referenced by your assembly before any of its types, events, or methods can be used in your application.

To add Microsoft.Devices.Sensors to your game

  1. In Solution Explorer, right-click your game project's References node, and then select Add Reference.
  2. Select Microsoft.Devices.Sensors from the list, and then click OK.
  3. Add using Microsoft.Devices.Sensors; to the top of any source file that will use the accelerometer classes and methods.

Adding Accelerometer Support to Your Game

Once you have a reference to Microsoft.Devices.Sensors in your project and an associated using statement in your source files, you can begin adding code to support accelerometer input.

To add accelerometer support

  1. Add a data member to your game to hold accelerometer data.

    Accelerometer data is returned in an AccelerometerReadingEventArgs class. You can declare an instance of this structure in your class, declare an instance of a similar structure (such as Vector3), or create separate data members to read AccelerometerReadingEventArgs's X, Y, and Z members.

    C#
    Accelerometer accelSensor;
Vector3 accelReading = new Vector3();

  2. Add an event handler for the ReadingChanged event.

    Add a method to your class that returns void, and has two parameters: an object representing the sender, and an AccelerometerReadingEventArgs to get the accelerometer reading.

    C#
    public void AccelerometerReadingChanged(object sender, AccelerometerReadingEventArgs e)
{
    accelReading.X =  (float)e.X;
    accelReading.Y = (float)e.Y;
    accelReading.Z = (float)e.Z;
}

  3. Associate your event handler with the ReadingChanged event.

    C#
    accelSensor = new Accelerometer();

// Add the accelerometer event handler to the accelerometer sensor.
accelSensor.ReadingChanged +=
    new EventHandler<AccelerometerReadingEventArgs>(AccelerometerReadingChanged);

  4. Start the accelerometer sensor.

    The accelerometer must be started before it begins calling your event handler. This may raise an exception, so your code should handle the case where the accelerometer cannot be started.

    C#
    // Start the accelerometer
try
{
    accelSensor.Start();
    accelActive = true;
}
catch (AccelerometerFailedException e)
{
    // the accelerometer couldn't be started.  No fun!
    accelActive = false;
}
catch (UnauthorizedAccessException e)
{
    // This exception is thrown in the emulator-which doesn't support an accelerometer.
    accelActive = false;
}

  5. Get accelerometer readings.

    After it is started, the accelerometer calls your event handler when the ReadingChanged event is raised. Update your stored AccelerometerReadingEventArgs class (previously shown in the event handler code), and then use its data in your game's Update method.

    C#
    if (accelActive)
{
    // accelerate the sparkle depending on accelerometer
    // action.
    s.speed.X += accelReading.X * ACCELFACTOR;
    s.speed.Y += -accelReading.Y * ACCELFACTOR;
}

  6. Stop the accelerometer sensor.

    To avoid having your event handler called repeatedly when your game is not actually using the accelerometer data, you can stop the accelerometer when the game is paused, when menus are being shown, or at any other time by calling the Stop method. Like Start, this method can throw an exception, so allow your code to handle the AccelerometerFailedException.

    C#
    // Stop the accelerometer if it's active.
if (accelActive)
{
    try
    {
        accelSensor.Stop();
    }
    catch (AccelerometerFailedException e)
    {
        // the accelerometer couldn't be stopped now.
    }
}

Expand image See Also

Working with Touch Input (Windows Phone)
Input Overviews


Working with Text and Keyboard Input

Working with Text and Keyboard Input

This section provides topics that demonstrate how to write code that supports text and keyboard input in XNA Game Studio.

In This Section

Detecting a Key Press (Windows, Windows Phone, Xbox 360)
Demonstrates how to detect if a user pressed or released a key on the keyboard.
Working with Hardware Keyboards (Windows Phone)
Discusses how to use hardware keyboards on Windows Phone.
Displaying a Software Input Panel (Windows Phone, Xbox 360)
Describes how to show a sofware input panel (SIP).
Displaying a Message Box (Windows Phone, Windows, Xbox 360)
Describes how to show a message box.

See Also

Overview of User Input and Input Devices Responding to User Input


Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Detecting a Key Press (Windows, Windows Phone, Xbox 360)
CollapseAll image

Demonstrates how to detect if a user pressed or released a key on the keyboard.

Complete Sample

The code in this topic shows you the technique for detecting a key press or release on the keyboard. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample

By using GetState a game can determine which keys are being held down. A game often needs to detect when a user has pressed or released a key. For example, there is the case of an action title that requires users to press and release keys in rapid succession. The example uses a cached KeyboardState object to determine if keys were pressed or released in a given frame.

On Windows Phone, there are a number of issues that must be considered when designing a game to take keyboard input. For example, many Windows Phone devices do not have a hardware keyboard. See Working with Hardware Keyboards (Windows Phone) for more information.

Depending on game design, there may be times when checking for a key press needs to occur more frequently, and other times it does not. It is possible in the case of very fast key presses that more than one key press could occur within one frame. In such a case, the last key press is returned. Writing code that checks as often as possible for key presses is the best way to handle this case.

Tip
This technique is implemented in the FuelCell game—a game developed by following a series of focused articles that discuss basic 3D game development. For more information, see FuelCell: What's My Motivation.

Detecting a Key Press or Release

To detect if a key is pressed or released

  1. Declare a KeyboardState object to hold the last known keyboard state (in this example, the oldState object).

  2. Assign this object a value in your constructor.

  3. Call GetState to retrieve the current keyboard state (in this example, the newState object).

  4. Compare the values in your newState object to the values in the oldState object.

    Keys pressed in the newState object that were not pressed in the oldState object were pressed during this frame. Conversely, keys pressed in the oldState object that are not pressed in the newState object were released during this frame.

  5. Update oldState object to the newState object before leaving Update.

C#
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Keypress
{
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        KeyboardState oldState;
        Color backColor = Color.CornflowerBlue;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
        }

        protected override void Initialize()
        {
            base.Initialize();
            oldState = Keyboard.GetState();
        }

        protected override void LoadContent()
        {
        }

        protected override void UnloadContent()
        {
        }

        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back ==
                ButtonState.Pressed)
                this.Exit();

            UpdateInput();

            base.Update(gameTime);
        }

        private void UpdateInput()
        {
            KeyboardState newState = Keyboard.GetState();

            // Is the SPACE key down?
            if (newState.IsKeyDown(Keys.Space))
            {
                // If not down last update, key has just been pressed.
                if (!oldState.IsKeyDown(Keys.Space))
                {
                    backColor =
                        new Color(backColor.R, backColor.G, (byte)~backColor.B);
                }
            }
            else if (oldState.IsKeyDown(Keys.Space))
            {
                // Key was down last update, but not down now, so
                // it has just been released.
            }

            // Update saved state.
            oldState = newState;
        }

        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(backColor);
            base.Draw(gameTime);
        }
    }
}


Working with Hardware Keyboards (Windows Phone)

Working with Hardware Keyboards (Windows Phone)
See Also
CollapseAll image

Some, but not all, Windows Phone devices feature hardware keyboards. These keyboards can be accessed using XNA Game Studio in the same manner as hardware keyboards for Xbox 360 or Windows are accessed. There is one major caveat, however, shared by Xbox 360: XNA Game Studio provides no way to determine whether the device has a hardware keyboard, or whether it is currently enabled (open in the case of a slide-style keyboard).

For Windows Phone, the Keys enumeration maps the following members to special keys:

Windows Phone key | Keys enumeration member
Accent key | Keys.F1
Emoticon key | Keys.F2
Symbol key | Keys.F3
Vib key | Keys.F4
Fn key | Keys.LeftShift

All other keys are assigned as described in Keys.

For information about detecting hardware key presses, and for code examples see Detecting a Key Press (Windows, Windows Phone, Xbox 360).

Note
If you are interested in retrieving characters typed—such as when you want text input from the user— instead of the key state, you should use Guide.BeginShowKeyboardInput as described in Displaying a Software Input Panel (Windows Phone, Xbox 360). This process displays a software keyboard that can be used on devices with or without a hardware keyboard, and returns the characters typed.

Expand image See Also

Input Overviews


Displaying a Software Input Panel (Windows Phone, Xbox 360)

Displaying a Software Input Panel (Windows Phone, Xbox 360)
CollapseAll image

Describes how to show a sofware input panel (SIP).

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample.

On systems and devices that lack a hardware keyboard, you can use Guide.BeginShowKeyboardInput to display a software input panel (SIP). This is an asynchronous process for which you can use both polling and callback-style techniques to retrieve user input.

Note
For more information about programming asynchronous methods, see Working with Asynchronous Methods in XNA Game Studio.

To show a software keyboard

  1. Call Guide.BeginShowKeyboardInput to begin display of the keyboard.

    On Windows Phone and Windows, the player index must always be PlayerIndex.One.

    For example:

    C#
    kbResult = Guide.BeginShowKeyboardInput(PlayerIndex.One,
        "Here's your Keyboard", "Type something...",
        ((typedText == null) ? "" : typedText),
        GetTypedChars, null);
    Note
    If you require a secure input panel that does not display typed characters, use the Guide.BeginShowKeyboardInput (PlayerIndex, String, String, String, AsyncCallback, Object, Boolean) overload that takes a Boolean parameter specifying whether to hide user input.

  2. When IASyncResult.IsCompleted is true, call Guide.EndShowKeyboardInput to retrieve the characters typed in the input panel.

    3. For example:

    C#
    protected void GetTypedChars(IAsyncResult r)
{
    typedText = Guide.EndShowKeyboardInput(r);
}
Note
Because this process displays a Windows Phone-generated input panel that resizes the display, you should not do any lengthy processing within a few frames of calling BeginShowKeyboardInput or Guide.EndShowKeyboardInput. If you do so, your game may experience odd graphical artifacts as the phone returns the screen back to the resolution and orientation used by your game.


Displaying a Message Box (Windows Phone, Windows, Xbox 360)

Displaying a Message Box (Windows Phone, Windows, Xbox 360)
See Also
CollapseAll image

Describes how to show a message box.

The Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample.

You can use Guide.BeginShowMessageBox to show a system-supplied message box that displays alerts, warnings, and other information to the gamer. This is an asynchronous process for which you can use both polling and callback-style techniques to retrieve user input.

Note
For more information about programming asynchronous methods, see Working with Asynchronous Methods in XNA Game Studio.

To show a message box

  1. Call Guide.BeginShowMessageBox to begin display of the message box.

    For example:

    C#
    List<string> MBOPTIONS = new List<string>();

    MBOPTIONS.Add("OK");

    string msg = "Text that was typed on the keyboard will be displayed here.\nClick OK to continue...";
Guide.BeginShowMessageBox(
        mbTitle, msg, MBOPTIONS, 0,
        MessageBoxIcon.Alert, null, null);
    Note

    Guide.BeginShowMessageBox has two overloads, one of which takes a player index. It doesn't matter which one you choose, though you should be aware that on Windows Phone and Windows, the player index must always be PlayerIndex.One.

    The maximum number of buttons you can define for a message box varies by platform. It is currently two on Windows Phone, and three on Xbox 360 and Windows.

  2. When IASyncResult.IsCompleted is true, call Guide.EndShowMessageBox to retrieve the zero-based index of the message box button chosen by the user.

    3. For example:

    C#
    protected void GetMBResult(IAsyncResult r)
{
    int? b = Guide.EndShowMessageBox(r);
    gameState = 0;
}

Expand image See Also

MessageBoxIcon Enumeration
PlayerIndex Enumeration
IAsyncResult


Working with Mouse Input

Working with Mouse Input

This section provides topics that demonstrate how to write code that supports mouse input in XNA Game Studio.

In This Section

Getting the Mouse Position (Windows, Windows Phone)
Demonstrates how to get the current horizontal and vertical position of the mouse cursor relative to the upper-left corner of a game window.

See Also

Overview of User Input and Input Devices Responding to User Input


Getting the Mouse Position (Windows, Windows Phone)

Getting the Mouse Position (Windows, Windows Phone)
See Also
CollapseAll image

Note
This topic applies only to Windows and Windows Phone development. The Mouse and MouseState objects are not supported on Xbox 360.

On Windows, you can use Mouse.GetState at any time to get the mouse position and the state of the mouse buttons.

On Windows Phone, you can also get the primary touch location by using GetState, but only when MouseState.LeftButton is in the Pressed state. The locations in MouseState.X and MouseState.Y will then correspond to the primary touch location on the screen. When LeftButton is in the Released state, X and Y are invalid.

Note
This technique only retrieves the location of the primary touchpoint on a multitouch screen. If you want to retrieve the locations of more than one touchpoint, you should use the technique described in Working with Touch Input (Windows Phone).

To retrieve the current mouse position on Windows

  1. Call Mouse.GetState to get the MouseState object.

  2. Read MouseState.X and MouseState.Y to get the mouse position, in pixels, relative to the upper-left corner of the game window.

To retrieve the primary touch location on Windows Phone

  1. Call Mouse.GetState to get the MouseState object.

  2. If LeftButton is in the Pressed state, read MouseState.X and MouseState.Y to get the screen coordinates of the primary touch location.

Example

The following code demonstrates this procedure:

C#
            MouseState ms = Mouse.GetState();

            // on Windows, the current state of the mouse cursor can be obtained at any time.
#if WINDOWS
            curMousePos.X = ms.X;
            curMousePos.Y = ms.Y;
#endif

            // if the mouse button is held down (or the touchscreen is pressed for phone), drop
            // a piece of food at the location given.
            if (canDrop && ms.LeftButton == ButtonState.Pressed)
            {
                foodLocations.Add(new Vector2(ms.X, ms.Y));
                canDrop = false;
            }
            else if (ms.LeftButton == ButtonState.Released)
            {
                // wait until the button is released before allowing the player to drop another
                // piece of food.
                canDrop = true;
            }

Expand image See Also

ButtonState


Working with Xbox 360 Controllers

Working with Xbox 360 Controllers

This section provides topics that demonstrate how to write code that supports Xbox 360 controller input in XNA Game Studio.

In This Section

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Demonstrates how to detect whether a user has pressed a digital button on a connected Xbox 360 Controller.
Detecting an Xbox 360 Controller Button Press in the Current Frame (Xbox 360, Windows)
Demonstrates how to detect if a user just pressed a digital button on a connected Xbox 360 Controller.
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)
Demonstrates how to detect if an Xbox 360 Controller is disconnected.
Using Alternative Input Devices (Xbox 360)
Discusses various controller subtypes and mappings for each of these controllers to the standard Xbox 360 gamepad.

See Also

Overview of User Input and Input Devices Responding to User Input


Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
See Also
CollapseAll image

The topic shows you how to check if a digital button currently is held in the down position. For every update loop in which the A button remains pressed, the controller will increase vibration. To detect only the first time a button is pressed and ignore when the button is continuously held down, such as when you want to test how fast a player can rapidly press a button, see Detecting an Xbox 360 Controller Button Press in the Current Frame (Xbox 360, Windows).

Complete Sample

The code in this topic shows you the technique for detecting if a user pressed a digital button on the controller. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample

Tip
This technique is mentioned in the FuelCell game—a game developed by following a series of focused articles that discuss basic 3D game development. For more information, see FuelCell: What's My Motivation.

Detecting the Current Position of the Controller Button

To detect if a controller button currently is pressed

  1. Get the state of the Xbox 360 Controller by using GetState.

  2. Verify that the controller currently is connected by retrieving the IsConnected property.

  3. Retrieve the values of the Buttons you want to check.

    If the current state is Pressed, the button currently is being pressed.

C#
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace InputDetectSimple
{
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
        }

        protected override void Initialize()
        {
            base.Initialize();
        }

        protected override void LoadContent()
        {
        }

        protected override void UnloadContent()
        {
        }

        protected override void Update(GameTime gameTime)
        {
            // Allow the game to exit.
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back ==
                ButtonState.Pressed)
                this.Exit();

            UpdateInput();

            base.Update(gameTime);
        }

        float vibrationAmount = 0.0f;

        void UpdateInput()
        {
            // Get the current gamepad state.
            GamePadState currentState = GamePad.GetState(PlayerIndex.One);

            // Process input only if connected and button A is pressed.
            if (currentState.IsConnected && currentState.Buttons.A ==
                ButtonState.Pressed)
            {
                // Button A is currently being pressed; add vibration.
                vibrationAmount =
                    MathHelper.Clamp(vibrationAmount + 0.03f, 0.0f, 1.0f);
                GamePad.SetVibration(PlayerIndex.One,
                    vibrationAmount, vibrationAmount);
            }
            else
            {
                // Button A is not being pressed; subtract some vibration.
                vibrationAmount =
                    MathHelper.Clamp(vibrationAmount - 0.05f, 0.0f, 1.0f);
                GamePad.SetVibration(PlayerIndex.One,
                    vibrationAmount, vibrationAmount);
            }
        }

        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
            base.Draw(gameTime);
        }
    }
}

Expand image See Also

Detecting an Xbox 360 Controller Button Press in the Current Frame (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)


Detecting an Xbox 360 Controller Button Press in the Current Frame (Xbox 360, Windows)

Detecting an Xbox 360 Controller Button Press in the Current Frame (Xbox 360, Windows)
See Also
CollapseAll image

Demonstrates how to detect if a user just pressed a digital button on a connected Xbox 360 Controller. This topic ignores held buttons. It only activates when a button is pressed in the current frame.

Complete Sample

The code in this topic shows you the technique for detecting if a digital button on a controller is pressed. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample

The example uses a stored GamePadState object, and compares the value of the A button to determine if the state of the button changed from Released to Pressed. If it did change, it indicates the user pressed the button.

Unlike the more basic example shown in Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows), this topic only reports a digital button press and not when the button is simply held down. This can be useful in games where you want to test the user's ability to rapidly press a button. In a manner similar to that described in Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows), the result of this sample is vibration. The only way to increase the amount of vibration, however, is to rapidly press the A button. Holding the button will not increase the vibration.

Tip
This technique is implemented in the FuelCell game—a game developed by following a series of focused articles that discuss basic 3D game development. For more information, see FuelCell: What's My Motivation.

Detecting If a Controller Button Is Pressed

To detect if a controller button is pressed in this frame

  1. Get the state of the Xbox 360 Controller by using GetState.

  2. Verify that the controller currently is connected by retrieving the IsConnected property.

  3. Compare the values of the Buttons you want to check between the current state and previous state.

    If the current state is Pressed and the previous state is Released, the button has been pressed.

  4. Update the previous state to the new state.

C#
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace InputDetect
{
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
        }

        protected override void Initialize()
        {
            base.Initialize();
            previousGamePadState = GamePad.GetState(PlayerIndex.One);
        }

        protected override void LoadContent()
        {
        }

        protected override void UnloadContent()
        {
        }

        protected override void Update(GameTime gameTime)
        {
            // Allow the game to exit.
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back ==
                ButtonState.Pressed)
                this.Exit();

            UpdateInput();

            base.Update(gameTime);
        }

        GamePadState previousGamePadState;
        float vibrationAmount = 0.0f;

        void UpdateInput()
        {
            // Get the current gamepad state.
            GamePadState currentState = GamePad.GetState(PlayerIndex.One);
            // Process input only if connected.
            if (currentState.IsConnected)
            {
                // Increase vibration if the player is tapping the A button.
                // Subtract vibration otherwise, even if the player holds down A
                if (currentState.Buttons.A == ButtonState.Pressed &&
                    previousGamePadState.Buttons.A == ButtonState.Released)
                {
                    // Button A has just been pressed; add vibration.
                    vibrationAmount =
                        MathHelper.Clamp(vibrationAmount + 0.3f, 0.0f, 1.0f);
                    GamePad.SetVibration(PlayerIndex.One,
                        vibrationAmount, vibrationAmount);
                }
                else
                {
                    // Subtract some vibration.
                    vibrationAmount =
                        MathHelper.Clamp(vibrationAmount - 0.04f, 0.0f, 1.0f);
                    GamePad.SetVibration(PlayerIndex.One,
                        vibrationAmount, vibrationAmount);
                }

                // Update previous gamepad state.
                previousGamePadState = currentState;
            }
        }

        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
            base.Draw(gameTime);
        }
    }
}

Expand image See Also

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)


Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)
See Also
CollapseAll image

Demonstrates how to detect if an Xbox 360 Controller is disconnected.

Complete Sample

The code in this topic shows you the technique for how to detect if a controller is disconnected. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample

This topic shows you how to check the IsConnected property of a retrieved GamePadState object. If the value is true, the controller is still connected, and the game continues. If the value is false, the controller is disconnected, and the game will pause until the user reconnects the controller.

Detecting if a Controller Is Disconnected

To detect if a controller is disconnected

  1. At program start, present an interface for users to choose which controllers are connected, and then store this information.

  2. Go to the game loop.

  3. In the game loop, get the state of each Xbox 360 Controller by using GetState.

  4. Retrieve the IsConnected property to verify that each controller from the earlier list of connected controllers is still connected.

    If the current value of IsConnected is false for a previously connected controller, that controller now is disconnected.

  5. Enter a pause loop, and wait for the user to reconnect the controller.

C#
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace InputDisconnect
{
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;

        // Game states.
        enum GameState
        {
            InputSetup = 0,
            Game,
            Disconnected
        }

        // Current state of the game.
        GameState gameState = GameState.InputSetup;

        // Controllers that are in use.
        bool[] activeControllers = new bool[4];

        // Disconnected controller detected.
        bool disconnectDetected = false;

        // Background color.  Use this to indicate a disconnect.
        Color backColor = Color.CornflowerBlue;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
        }

        protected override void Initialize()
        {
            base.Initialize();
        }

        protected override void LoadContent()
        {
        }

        protected override void UnloadContent()
        {
        }

        protected override void Update(GameTime gameTime)
        {
            // Allow the game to exit.
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back ==
                ButtonState.Pressed)
                this.Exit();

            UpdateInput();

            switch (gameState)
            {
                case GameState.InputSetup:
                    // Allow players to join the game,
                    // and determine active controllers.
                    // In this example, there is only one player.
                    activeControllers[0] = true;

                    // When ready, proceed to the game.
                    gameState = GameState.Game;
                    break;

                case GameState.Game:
                    // If disconnected, go to the disconnect loop.
                    if (disconnectDetected)
                    {
                        backColor = Color.Black;
                        gameState = GameState.Disconnected;
                    }
                    break;

                case GameState.Disconnected:
                    // If reconnected, continue to the game.
                    if (!disconnectDetected)
                    {
                        backColor = Color.CornflowerBlue;
                        gameState = GameState.Game;
                    }
                    // Otherwise, pause the game and display a message.
                    break;
            }

            base.Update(gameTime);
        }

        void UpdateInput()
        {
            disconnectDetected = false;
            PlayerIndex index = PlayerIndex.One;
            for (int i = 0; i < 4; i++, index++)
            {
                if (activeControllers[i] &&
                    !GamePad.GetState(index).IsConnected)
                {
                    disconnectDetected = true;
                }
            }
        }

        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(backColor);
            base.Draw(gameTime);
        }
    }
}

Expand image See Also

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)


Using Alternative Input Devices (Xbox 360)

Using Alternative Input Devices (Xbox 360)
See Also
CollapseAll image

Discusses various controller subtypes and mappings for each of these controllers to the standard Xbox 360 gamepad.
  • Required and Optional Features
  • Alternate Guitar
  • Arcade Stick
  • Big Button Pad
  • Dance Pad
  • Drum Kit
  • Flight Stick
  • Gamepad
  • Guitar
  • Wheel

Required and Optional Features

Support for the following features is required from all controller subtypes:

  • The action buttons: A, B, X, and Y.
  • The Back, Start, and Xbox Guide buttons.
  • The directional pad (Up, Down, Left, and Right), the Ring of Light, and voice support.

Support for the following features is optional:

  • The serial port, which is part of the Expansion Port.
  • The Left/Right stick buttons (that is, thumbsticks).
  • The Left/Right triggers.
  • The Left/Right shoulder buttons (that is, bumpers).

Alternate Guitar

This controller consists of a guitar with a vertical orientation sensor and whammy bar.

Note
In addition to the standard control set, the standard and alternate guitar controllers implement additional vendor-specific effects.
Game Function | Gamepad | Guitar (alternate)
Game Dependent | Right Trigger | Accelerometer
Game Dependent | Left Trigger | Accelerometer
Game Dependent/Menu Navigation | Directional Pad (Up/Down/Left/Right) | Strum Up, Strum Down, DPad Left, DPad Right
Game Dependent | A, B, X, Y button | Green (1st Neck button), Red (2nd Neck button), Blue (4th Neck button), Yellow (3rd Neck button)
Game Dependent | Left Bumper | Orange (5th Neck button)
Not used | Right Bumper | Optional Guitar Effect 3
Pause/Wakes controller from standby and then signals console to wake up. | Start button | Start button
Back | Back button | Back button
Opens Xbox 360 Console’s on screen menu. It wakes controller from standby and then signals console to wake up. | Xbox Guide button | Xbox Guide button
Not used | Left Stick X-axis | Not used
Not used | Left Stick Y-axis | Not used
Game Dependent | Right Stick X-axis | Whammy Bar. When the whammy bar is held out from the base of the controller, it is in an Out (or neutral) position and returns a full negative value (-32,768). When the whammy bar is held against the base of the controller, it is in an In position and registers a full positive value (32,767).
Game Dependent | Right Stick Y-axis | Vertical Accelerometer When the controller is held at an angle of +55º or more, the Y-axis of the right stick registers a full positive max value. Values less than 55º register a positive value between 0 and 32,767. When the controller is held at an angle of -55º or more, the X-axis of the right stick registers a full negative max value. Values less than -55º register a negative value between 0 and -32,768.
Not used | Left and Right Stick buttons | Not used

Arcade Stick

This controller consists of a digital joystick and buttons, which are commonly used for arcade and fighting games.

Game Function | Gamepad | Arcade Stick
Game Dependent | Right Trigger | RT button (optional)
Game Dependent | Left Trigger | LT button (optional)
Game Dependent/Menu Navigation | Directional Pad (Up/Down/Left/Right) | Arcade Stick (Up/Down/Left/Right)
Game Dependent | A, B, X, Y button | Green/Red/Blue/Yellow button
Game Dependent | Left Bumper | Optional
Game Dependent | Right Bumper | Optional
Pause/Wakes controller from standby and then signals console to wake up. | Start button | Start button
Back | Back button | Back button
Opens the on-screen Xbox 360 menu. It wakes controller from standby and then signals console to wake up. | Xbox Guide button | Xbox Guide button
Not used | Left and Right Stick X-axis | Not used
Not used | Left and Right Stick Y-axis | Not used

Big Button Pad

This controller consists of one big button and several other buttons.

Game Function | Gamepad | Big Button Pad
Game Dependent/Menu Navigation | Directional Pad (Up/Down/Left/Right) | Directional Pad (Up/Down/Left/Right)
Game Dependent | A, B, X, Y button | A, B, X, Y button
Pause/Wakes controller from standby and then signals console to wake up. | Start button | Start button
Back | Back button | Back button
Opens the on-screen Xbox 360 menu. It wakes controller from standby and then signals console to wake up. | Xbox Guide button | Xbox Guide button
Game Dependent | Not applicable | Big Button

Dance Pad

This controller consists of a floor mat, which is used exclusively with dance games. An optional headset extension cable might be bundled with the dance pad.

Game Function | Gamepad | Dance Pad
Not used | Right Trigger | Not used
Not used | Left Trigger | Not used
Game dependent | Directional Pad (Up/Down/Left/Right) | Top/North, Bottom/South, West/Left, East/Right pads
Game dependent | A, B, X, Y button | A Pad (North East), B Pad (North West), X Pad (South East), Y Pad (South West)
Not used | Left Bumper | Not used
Not used | Right Bumper | Not used
Pause/Wakes controller from standby and then signals console to wake up. | Start button | Start Button/Pad
Back | Back button | Back Button/Pad
Opens the on-screen Xbox 360 menu. Wakes controller from standby and then signals console to wake up. | Xbox Guide button | Xbox Guide Button/Pad
Not used | Left Stick X and Y-axis | Not used
Not used | Right Stick X and Y-axis | Not used
Not used | Left and Right Stick buttons | Not used

Drum Kit

This controller consists of a drum kit, which is used for music games. Bass drum control is implemented as a foot pedal with various drums represented by four (core kit) or seven (extended drum kit) pads.

Game Function | Gamepad | Drum Kit
Not used | Right Trigger | Not used
Not used | Left Trigger | Not used
Game Dependent/Menu Navigation | Directional Pad (Up/Down/Left/Right) | Directional Pad
Game Dependent | A, B, X, Y button | Green, Red, Blue, and Yellow pads.
Game Dependent | Left Bumper | Orange pedal
Game Dependent | Right Bumper | Extra Pad 3 (optional)
Pause/Wakes controller from standby and then signals console to wake up. | Start button | Start button
Back | Back button | Back button
Opens the on-screen Xbox 360 menu. Wakes controller from standby and then signals console to wake up. | Xbox Guide button | Xbox Guide button
Game Dependent | Left Stick button | Extra Pad 2 (optional)
Game Dependent | Right Stick button | Extra Pad 1 (optional)

Flight Stick

This controller consists of an aircraft joystick, which is used for flight simulation, air combat, and space combat games. The joystick’s position is mapped to the Left Stick’s X and Y-axes as on a Cartesian plane.

Game Function | Gamepad | Flight Stick
Throttle (Up/Down) | Right Trigger | Throttle Control (Forward/Backward)
Rudder (Left/Right) | Left Trigger | Twisting handle or rocker switch
Menu Navigation | Directional Pad (Up/Down/Left/Right) | Hat switch
Primary weapon, Secondary weapon, Action, Action | A, B, X, Y button | Joystick trigger, B, X, Y buttons
Optional | Left Bumper | Optional
Optional | Right Bumper | Optional
Pause/Wakes controller from standby and then signals console to wake up. | Start button | Start button
Back | Back button | Back button
Opens the on-screen Xbox 360 menu. Wakes controller from standby and then signals console to wake up. | Xbox Guide button | Xbox Guide button
Roll (Left/Right) | Left Stick X-axis | Joystick X-axis
Pitch (Up/Down) | Left Stick Y-axis | Joystick Y-axis
Point Of View | Right Stick X and Y-axis | Right Stick X and Y-axis
Optional | Left and Right Stick buttons | Optional

Gamepad

This is the standard Xbox 360 controller. It is suitable for emulating all other controller subtypes.

Game Function | Gamepad
Game Dependent | Right Trigger
Game Dependent | Left Trigger
Game Dependent/Menu Navigation | Directional Pad (Up/Down/Left/Right)
Game Dependent | A, B, X, Y button
Game Dependent | Left Bumper
Game Dependent | Right Bumper
Pause/Wakes controller from standby and then signals console to wake up. | Start button
Back | Back button
Opens the on-screen Xbox 360 menu. Wakes controller from standby and then signals console to wake up. | Xbox Guide button
Not used | Left and Right Stick X-axis
Not used | Left and Right Stick Y-axis

Guitar

This controller consists of a guitar with a vertical orientation sensor and whammy bar. In addition, some controllers implement vendor-specific optional effects.

Game Function | Gamepad | Guitar
Game Dependent | Right Trigger | Optional Guitar Effect 2 (Right Effect Pedal)
Game Dependent | Left Trigger | Optional Guitar Effect 1 (Right Effect Pedal)
Game Dependent/Menu Navigation | Directional Pad (Up/Down/Left/Right) | Strum Up, Strum Down, DPad Left, DPad Right
Game Dependent | A, B, X, Y button | Green (1st Neck button), Red (2nd Neck button), Blue (4th Neck button), Yellow (3rd Neck button)
Game Dependent | Left Stick button + A | Left Stick button + A
Game Dependent | Left Stick button + B | Left Stick button + B
Game Dependent | Left Stick button + X | Left Stick button + X
Game Dependent | Left Stick button + Y | Left Stick button + Y
Game Dependent | Left Bumper | Orange (5th Neck button)
Game Dependent | Lower Left Bumper | Left Stick button + Left BUmper
Not used | Right Bumper | Optional Guitar Effect 3
Pause/Wakes controller from standby and then signals console to wake up. | Start button | Start button
Back | Back button | Back button
Opens Xbox 360 Console’s on screen menu. Wakes controller from standby and then signals console to wake up. | Xbox Guide button | Xbox Guide button
Not used | Left Stick X-axis | Not used
Not used | Left Stick Y-axis | Not used
Game Dependent | Right Stick X-axis | Whammy Bar. When the whammy bar is held out from the base of the controller, it is in an Out (or neutral) position and returns a full negative value (-32,768). When the whammy bar is held against the base of the controller, it is in an In position and registers a full positive value (32,767).
Game Dependent | Right Stick Y-axis | Tilt Sensor When the controller is held at an angle of +55º or more, the Y-axis of the right stick registers a full positive max value. Values less than 55º register a positive value between 0 and 32,767. When the controller is held at an angle of -55º or more, the X-axis of the right stick registers a full negative max value. Values less than -55º register a negative value between 0 and -32,768.
Not used | Left and Right Stick buttons | Not used

Wheel

Several wheels (with associated pedals) are available for the Xbox 360 platform.

Game Function | Gamepad | Wheel
Accelerate | Right Trigger | Accelerator Pedal
Brake | Left Trigger | Brake Pedal
Game Dependent/Menu Navigation | Directional Pad (Up/Down/Left/Right) | Directional Pad (Up/Down/Left/Right)
Game Dependent | A, B, Y, X button | A, B, Y, X button
Gear Down | Left Bumper | Left Paddle/Shift Lever
Gear Up | Right Bumper | Right Paddle/Shift Lever
Pause/Wakes controller from standby and then signals console to wake up | Start button | Start button
Back | Back button | Back button
Opens Xbox 360 Console’s on-screen menu; wakes controller from standby and then signals console to wake up | Xbox Guide button | Xbox Guide button
Steering | Left Stick X-axis | Wheel Rotation
Not used | Left Stick Y-axis | Not used
Optional | Right Stick X-axis | Optional
Optional | Right Stick Y-axis | Optional

Expand image See Also

Conceptual

Responding to User Input


Creating and Playing Sounds

Creating and Playing Sounds

Audio gives you the opportunity to pump up your game with sounds where and when you define. This section provides overviews about audio technology, and it presents predefined scenarios to demonstrate how to use audio.

In This Section

Sounds Overview
Provides a high-level overview about the capabilities of the Audio API in XNA Game Studio in addition to general audio terminology.
Audio API Developers Guide
Provides developers with information about the audio buffer format used by the XNA Game Studio Audio API.
Playing a Sound
Demonstrates how to play a simple sound by using SoundEffect.
Looping a Sound
Demonstrates how to loop a sound.
Adjusting Pitch and Volume
Demonstrates how to change pitch and volume of a playing sound.
Playing a Song
Demonstrates how to play a song from a user's media library.
Playing a Song from a URI
Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).
Applying a 3D Positional Effect to a Sound
Demonstrates how to apply 3D positioning effects to a SoundEffect.
Streaming Data from a WAV File
Demonstrates how to stream audio from a wave (.wav) file.
Recording Sounds with Microphones
Topics that provide guidance on writing code to support microphones for XNA Game Studio.
Using Microsoft Cross-Platform Audio Creation Tool (XACT)
Demonstrates how to play sounds created using XACT in XNA Game Studio 4.0.

Online Resources

Audio Content Catalog at XNA Creators Club Online


Sounds Overview

Sounds Overview

The XNA Framework provides audio playback through several core audio classes. It also provides audio classes to developers that use Microsoft Cross-Platform Audio Creation Tool (XACT) to manage multiple sounds.

Introduction

If your game is to use a few sound files, then the SoundEffect, SoundEffectInstance, and DynamicSoundEffectInstance classes will provide everything you need to play and stream audio during gameplay. For developers that plan on working with multiple sets of sound files during the gameplay, XNA Game Studio provides XACT, an advanced audio content creation and management tool. XACT provides audio designers with the ability to load sound files into groups, to organize those files into discrete cues that can be activated by in-game events, and to create sound transitions. Those using XACT have additional classes that specifically use XACT project data to load and play sounds. For more information about XACT, see Getting Started with XACT.

Note
XACT is not supported on Windows Phone.

Simple Audio Playback

The simplest way to play sounds for background music or sound effects is to use SoundEffect and SoundEffectInstance. Source audio files are added like any other game asset to the project. For example code, see Playing a Sound, Looping a Sound, and Adjusting Pitch and Volume. For background music, see Playing a Song.

SoundEffect and SoundEffectInstance are available on Windows, Xbox 360, and Windows Phone.

Accessing the Audio Buffer

Developers can use DynamicSoundEffectInstance for direct access to an audio buffer. By accessing the audio buffer, developers can manipulate sound, break up large sound files into smaller data chunks, and stream sound. For example code, see Streaming Data from a WAV File.

3D Audio

Both the Cue (XACT) and SoundEffect classes provide the ability to place audio in a 3D space. By creating AudioEmitter and AudioListener objects, both sound playback APIs can position a sound in 3D, and can change the 3D position of a sound during playback. Once you create and initialize AudioEmitter and AudioListener, call Cue.Apply3D or SoundEffectInstance.Apply3D.

Audio Constraints

Each platform has limits on the number of sounds playing simultaneously. An InstancePlayLimitException exception is thrown if this limit is exceeded. The following table shows the maximum number of simultaneous playing sounds based on platform.

Platform | Number of sounds that can play simultaneously
Windows Phone | 64
Xbox 360 | 300
Windows | No limit

Concepts

Getting Started with XACT
Introduces the Microsoft Cross-Platform Audio Creation Tool (XACT).
Playing a Sound
Demonstrates how to play a simple sound by using SoundEffect.
Streaming Data from a WAV File
Demonstrates how to stream audio from a wave (.wav) file.

Reference

SoundEffect Class
Provides a loaded sound resource.
SoundEffectInstance Class
Provides a single playing, paused, or stopped instance of a SoundEffect sound.
DynamicSoundEffectInstance Class
Provides properties, methods, and events for play back of the audio buffer.

Online Resources

Audio Content Catalog at XNA Creators Club Online


Audio API Developers Guide

Audio API Developers Guide

This topic provides developers with information about the audio buffer format used by the XNA Game Studio Audio API.

Audio Buffer Format

The byte[] buffer format used as a parameter for the SoundEffect constructor, Microphone.GetData method, and DynamicSoundEffectInstance.SubmitBuffer method is PCM wave data. Additionally, the PCM format is interleaved and in little-endian.

The audio format has the following constraints:

  • The audio channels can be mono (1) or stereo (2).
  • The PCM wave file must have 16-bits per sample.
  • The sample rate must be between 8,000 Hz and 48,000 Hz.
  • The interleaving for stereo data is left channel to right channel.

Concepts

Sounds Overview
Provides a high-level overview about the capabilities of the Audio API in XNA Game Studio in addition to general audio terminology.
Playing a Sound
Demonstrates how to play a simple sound by using SoundEffect.
Streaming Data from a WAV File
Demonstrates how to stream audio from a wave (.wav) file.

Reference

SoundEffect Class
Provides a loaded sound resource.
SoundEffectInstance Class
Provides a single playing, paused, or stopped instance of a SoundEffect sound.
DynamicSoundEffectInstance Class
Provides properties, methods, and events for play back of the audio buffer.

Online Resources

Audio Content Catalog at XNA Creators Club Online


Playing a Sound

Playing a Sound

This topic demonstrates how to play a simple sound by using SoundEffect. To play a sound using wave banks and sound banks from a Microsoft Cross-Platform Audio Creation Tool (XACT) project, see Playing Sounds from an XACT Project.

Complete Sample

The code in this topic shows you the technique for playing sound. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download PlaySoundWindows.zip

To add a sound file to your project

  1. Load your XNA Game Studio game in Visual Studio.

  2. In Solution Explorer, right-click the solution's Content project.

  3. Click Add, and then click Existing Item.

  4. Navigate to the .wav file you want to add, and then select it.

    Note

    The selected .wav file is inserted into your project. By default, it is processed by the Content Pipeline, and built wave files are accessed automatically when the game is built.

To play a simple sound

  1. Declare a SoundEffect object to hold the sound file.

    C#
    // Audio objects
SoundEffect soundEffect;

  2. Load the sound file using Content.Load.

    C#
    soundEffect = Content.Load<SoundEffect>("kaboom");

  3. Play the sound.

    C#
    // Play the sound
soundEffect.Play();

Concepts

Looping a Sound
Demonstrates how to loop a sound.
Playing Sounds from an XACT Project
Demonstrates how to initialize the audio engine, to load sound banks and wave banks created using XACT, and then to play a sound by using a Cue object.

Reference

SoundEffect Class
Provides a loaded sound resource.
SoundEffectInstance Class
Provides a single playing, paused, or stopped instance of a SoundEffect sound.


Looping a Sound

Looping a Sound

This section demonstrates how to loop a sound.

Complete Sample

The code in this topic shows you the technique for looping a sound. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download LoopSoundWithoutXACT_Sample.zip

Simple Sound Looping

Not much extra code is needed to continiously loop a sound file in your game. Since the SoundEffect class does not provide looping support, you'll need to allocate a SoundEffectInstance object. The following procedure builds on the sample code provided in the Playing a Sound topic.

To loop a sound

  1. Follow the instructions show in Playing a Sound topic.

  2. To be able to loop a sound you will need to declare a SoundEffectInstance object, and set it to the return value of SoundEffect.CreateInstance.

    C#
    SoundEffectInstance instance = soundEffect.CreateInstance();

  3. Set SoundEffectInstance.IsLooped to true and then play the sound.

    C#
    instance.IsLooped = true;

Concepts

Playing a Sound
Demonstrates how to play a simple sound by using SoundEffect.

Reference

SoundEffect Class
Provides a loaded sound resource.
SoundEffectInstance Class
Provides a single playing, paused, or stopped instance of a SoundEffect sound.


Adjusting Pitch and Volume

Adjusting Pitch and Volume

The SoundEffect.Play method allows you to specify the pitch and volume of a sound to play. However, after you call Play, you cannot modify the sound. Using SoundEffectInstance for a given SoundEffect allows you to change the pitch and volume of a sound at any time during playback.

Complete Sample

The code in this topic shows you the technique for changing a sound's pitch or volume. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download ChangePitchAndVolumeWithoutXACT_Sample.zip

Change Pitch and Volume of Sound

To adjust the pitch and volume of a sound

  1. Declare SoundEffect and Stream by using the method shown in Playing a Sound. In addition to the method described in Playing a Sound, declare SoundEffectInstance.

    C#
    SoundEffectInstance soundInstance;

  2. In the Game.LoadContent method, set the SoundEffectInstance object to the return value of SoundEffect.CreateInstance.

    C#
    soundfile = TitleContainer.OpenStream(@"Content\tx0_fire1.wav");
soundEffect = SoundEffect.FromStream(soundfile);
soundInstance = soundEffect.CreateInstance();

  3. Adjust the sound to the desired level using the SoundEffectInstance.Pitch and SoundEffectInstance.Volume properties.

    C#
    // Play Sound
soundInstance.Play();

  4. Play the sound using SoundEffectInstance.Play.

    C#
    // Pitch takes values from -1 to 1
soundInstance.Pitch = pitch;

// Volume only takes values from 0 to 1
soundInstance.Volume = volume;

Concepts

Playing a Sound
Demonstrates how to play a simple sound by using SoundEffect.
Looping a Sound
Demonstrates how to loop a sound.
Creating and Playing Sounds
Provides overviews about audio technology, and presents predefined scenarios to demonstrate how to use audio.

Reference

SoundEffect Class
Provides a loaded sound resource.
SoundEffectInstance Class
Provides a single playing, paused, or stopped instance of a SoundEffect sound.


Playing a Song

Playing a Song

Demonstrates how to play a song from a user's media library.

Complete Sample

The code in this tutorial illustrates the technique for playing a song from a library. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

Download PlaySong_Sample.zip

The Albums property provides access to the media library, and the Play method plays a song. Consider any current audio playback when using the Play method. If the user currently is playing a different song, the Stop method can be used to stop the current song.

To play a song from a random album in a user's media library

The following demonstrates how to play a song from a randomly picked album (shuffle).

  1. Declare MediaLibrary and Random.

    C#
    MediaLibrary sampleMediaLibrary;
Random rand;

  2. Initialize MediaLibrary and the random number generator in the game's constructor.

    C#
    sampleMediaLibrary = new MediaLibrary();
rand = new Random();

  3. Stop the current audio playback by calling MediaPlayer.Stop, and then generate a random number that will serve as a valid album index. Next, play the first track in the random album.

    C#
    MediaPlayer.Stop(); // stop current audio playback

// generate a random valid index into Albums
int i = rand.Next(0, sampleMediaLibrary.Albums.Count - 1);

// play the first track from the album
MediaPlayer.Play(sampleMediaLibrary.Albums[i].Songs[0]);

Concepts

Playing a Song from a URI
Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).
Media Overview
Provides a high-level overview about the capabilities—such as playing music and video and accessing pictures—of the Media API in XNA Game Studio.

Reference

MediaPlayer Class
Provides methods and properties to play, pause, resume, and stop songs. MediaPlayer also exposes shuffle, repeat, volume, play position, and visualization capabilities.
MediaLibrary Class
Provides access to songs, playlists, and pictures in the device's media library.
MediaPlayer.Play Method
Plays a song or collection of songs.
MediaLibrary.Albums Property
Gets the AlbumCollection that contains all albums in the media library.


Playing a Song from a URI

Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).

Playing a Song from a URI

To play a song from a URI

The following steps show you how to play an .mp3 song located on the Internet.

  1. Set MediaPlayer play state to stopped.

    C#
    MediaPlayer.Stop;

  2. Declare a new instance of Uri using the full URI path to the song.

    C#
    Uri uriStreaming = new Uri("http://www.archive.org/download/gd1977-05-08.shure57.stevenson.29303.flac16/gd1977-05-08d02t06_vbr.mp3");

  3. Use the FromUri method to supply an arbitrary string name for the URI, and then pass the Uri object you created in the previous step.

    C#
    Song song = Song.FromUri("StreamingUri", uriStreaming);

  4. Play the song.

    C#
    MediaPlayer.Play(song);

Concepts

Playing a Song
Demonstrates how to play a song from a user's media library.
Media Overview
Provides a high-level overview about the capabilities—such as playing music and video and accessing pictures—of the Media API in XNA Game Studio.

Reference

MediaPlayer Class
Provides methods and properties to play, pause, resume, and stop songs. MediaPlayer also exposes shuffle, repeat, volume, play position, and visualization capabilities.
Song Class
Provides access to a song in the song library.


Applying a 3D Positional Effect to a Sound

Applying a 3D Positional Effect to a Sound

This topic demonstrates how to apply 3D positioning effects to a SoundEffect. The XNA Framework audio system contains support for 3D audio positioning effects. It uses the AudioEmitter and AudioListener classes, and the SoundEffectInstance.Apply3D method. The effects simulate 3D positioning for sound by adjusting speaker mix for cues that use the 3D values. Speaker mix is the only effect that is applied automatically using this method.

Complete Sample

The following example uses a circular rotation around a stationary AudioListener to emphasize the 3D effect.

The code in this topic shows you the technique for applying 3D positional effects. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Basic3DAudio_Sample.zip

Applying Basic 3D Positional Effects to a SoundEffect

To retrieve and play a SoundEffect in 3D

  1. Add a wave (.wmv) file to a new XNA Game Studio project as described in Playing a Sound.

    Note

    The project should contain at least one SoundEffect.

  2. Declare SoundEffect and Stream by using the method shown in Playing a Sound. In addition to the above method, declare SoundEffectInstance.

    C#
    SoundEffectInstance soundEffectInstance;

  3. Create an AudioEmitter, an AudioListener, and a Vector3 to store the 3D position of the sound entity.

    C#
    AudioEmitter emitter = new AudioEmitter();
AudioListener listener = new AudioListener();
Vector3 objectPos;

  4. In the the LoadContent method, set the SoundEffectInstance object to the return value of SoundEffect.CreateInstance.

    C#
    soundfile = TitleContainer.OpenStream(@"Content\buzz.wav");
soundEffect = SoundEffect.FromStream(soundfile);
soundEffectInstance = soundEffect.CreateInstance();

  5. Call Apply3D on the SoundEffectInstance, passing the emitter and listener.

    C#
    soundEffectInstance.Apply3D(listener, emitter);

    Set the IsLooped property to true before calling Play if you want the sound to repeat.

  6. Call SoundEffectInstance.Play to play the sound.

    C#
    soundEffectInstance.Play();

To process audio data

  1. Set the Vector3 structure to the position from which you want the sound to come.

    C#
    // Move the object around in a circle.
objectPos = new Vector3(
    (float)Math.Cos(gameTime.TotalGameTime.TotalSeconds) / 2,
    0,
    (float)Math.Sin(gameTime.TotalGameTime.TotalSeconds));

  2. Set the AudioEmitter.Position property to this vector.

    C#
    emitter.Position = objectPos;

    As an option, set the Vector3 structure to the position where you want the listener of the 3D sound to be, and then set the AudioListener.Position property to this vector.

  3. Call SoundEffectInstance.Apply3D on the cue object you retrieved previously, passing in the AudioEmitter, which is an AudioListener.

    C#
    soundEffectInstance.Apply3D(listener, emitter);
Note
Calling the SoundEffectInstance.Apply3D method automatically sets the speaker mix for any sound played by this sound effect to a value calculated by the difference in Position values between listener and emitter. In preparation for the mix, the sound is converted to monoaural. Any stereo information in the sound is discarded.

Concepts

Applying a 3D Positional Effect to a Cue (XACT)
Demonstrates how to apply a 3D positioning effect to a cue.
Playing a Sound
Demonstrates how to play a simple sound by using SoundEffect.
Looping a Sound
Demonstrates how to loop a sound.
Creating and Playing Sounds
Provides overviews about audio technology, and presents predefined scenarios to demonstrate how to use audio.

Reference

SoundEffect Class
Provides a loaded sound resource.
SoundEffectInstance Class
Provides a single playing, paused, or stopped instance of a SoundEffect sound.
AudioListener Class
Represents a 3D audio listener.
AudioEmitter Class
Represents a 3D audio emitter.


Streaming Data from a WAV File

Streaming Data from a WAV File

This section demonstrates how to stream audio from a wave (.wav) file utilizing dynamic sound.

Loading Audio Content

The code in this topic describes how to stream an audio file using DynamicSoundEffectInstance. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample Code

To open a wave file for streaming

  1. Create global variables to hold the DynamicSoundEffectInstance, position, count, and data.

    C#
    DynamicSoundEffectInstance dynamicSound;
int position;
int count;
byte[] byteArray;

  2. In the Game.LoadContent method of your game, open the audio data using TitleContainer.OpenStream.

    C#
    System.IO.Stream waveFileStream = TitleContainer.OpenStream(@"Content\48K16BSLoop.wav");

  3. Create a new binary reader to read from the audio stream.

    C#
    BinaryReader reader = new BinaryReader(waveFileStream);

  4. Read the wave file header from the buffer.

    C#
    int chunkID = reader.ReadInt32();
int fileSize = reader.ReadInt32();
int riffType = reader.ReadInt32();
int fmtID = reader.ReadInt32();
int fmtSize = reader.ReadInt32();
int fmtCode = reader.ReadInt16();
int channels = reader.ReadInt16();
int sampleRate = reader.ReadInt32();
int fmtAvgBPS = reader.ReadInt32();
int fmtBlockAlign = reader.ReadInt16();
int bitDepth = reader.ReadInt16();

if (fmtSize == 18)
{
    // Read any extra values
    int fmtExtraSize = reader.ReadInt16();
    reader.ReadBytes(fmtExtraSize);
}

int dataID = reader.ReadInt32();
int dataSize = reader.ReadInt32();

  5. Store the audio data of the wave file to a byte array.

    C#
    byteArray = reader.ReadBytes(dataSize);

  6. Create the new dynamic sound effect instance using the sample rate and channel information extracted from the sound file.

    C#
    dynamicSound = new DynamicSoundEffectInstance(sampleRate, (AudioChannels)channels);

  7. Store the size of the audio buffer that is needed in the count variable. Submit data in 100 ms chunks.

    C#
    count = dynamicSound.GetSampleSizeInBytes(TimeSpan.FromMilliseconds(100));

  8. Set up the dynamic sound effect's buffer needed event handler so audio data can be read when it needs more data.

    C#
    dynamicSound.BufferNeeded += new EventHandler<EventArgs>(DynamicSound_BufferNeeded);

  9. Implement the buffer needed event handler.

    C#
    void DynamicSound_BufferNeeded(object sender, EventArgs e)
{
    dynamicSound.SubmitBuffer(byteArray, position, count / 2);
    dynamicSound.SubmitBuffer(byteArray, position + count / 2, count / 2);

    position += count;
    if (position + count > byteArray.Length)
    {
        position = 0;
    }
}

  10. Use the controller buttons to play and stop the sound stream.

    C#
    protected override void Update(GameTime gameTime)
{
    GamePadState gamePadState = GamePad.GetState(PlayerIndex.One);
    if (lastGamePadState != gamePadState)
    {
        if (gamePadState.Buttons.A == ButtonState.Pressed)
        {
            dynamicSound.Play();
        }
        if (gamePadState.Buttons.B == ButtonState.Pressed)
        {
            dynamicSound.Stop();
        }
        lastGamePadState = gamePadState;
    }

    base.Update(gameTime);
}

Concepts

Playing a Sound
Demonstrates how to play a simple sound by using SoundEffect.

Reference

DynamicSoundEffectInstance
Provides properties, methods, and events for play back of the audio buffer.
BufferNeeded
Event that occurs when the number of audio capture buffers awaiting playback is less than or equal to two.
OpenStream
Returns a stream to an existing file in the default title storage location.


Recording Sounds with Microphones

Recording Sounds with Microphones

This section provides topics that demonstrate how to write code that supports microphones in XNA Game Studio.

In This Section

Working with Microphones
Provides an overview and basic concepts of microphone usage for XNA Game Studio 4.0-enabled games.
Recording Sound with a Microphone
Demonstrates the basics of recording audio using a microphone attached to a device.

Related Topics

Sounds Overview
Provides a high-level overview about the capabilities of the Audio API in XNA Game Studio in addition to general audio terminology.
Voice Support
Introduces the voice support options available in the XNA Framework.
Responding to User Input
Demonstrates techniques for accessing various input devices and responding to user input.


Working with Microphones

Working with Microphones

This section provides basic concepts of microphone usage for XNA Game Studio 4.0-enabled games.

Supported Microphone Devices

The following microphone types are supported on Windows:

  • Xbox 360 headset
  • Devices recognized by the operating system as microphones (including USB microphones and devices connected through the microphone jack)

The following microphone types are supported on Xbox 360:

  • Xbox 360 wired and wireless headset
  • Lips microphone
  • Rock Band/Guitar Hero microphone

The following microphone types are supported on Windows Phone:

  • Bluetooth-enabled headset
  • Mobile phone's built-in microphone
  • Microphones connected through the headset jack

Introducing the XNA Game Studio 4.0 Microphone API

The XNA Game Studio 4.0 Microphone API has the following functionality:

  • Captures the audio stream from a microphone or a headset.
  • Provides microphone enumeration.
  • Submits and controls a stream of audio buffers for playback using the DynamicSoundEffectInstance object.
  • Plays back audio through a headset.
  • Provides a cross-platform API for Windows and Windows Phone.

Microphone API Process Workflow

The Microphone API behaves like a simple audio recorder with a configurable capture buffer. It has been designed with the following development process workflow:

  1. Select the microphone connected to the device.
  2. Configure the microphone's capture buffer size.
  3. Control the recording using standard transport controls (Start and Stop).
  4. Retrieve the captured audio using the GetData method.

Also, you can use the BufferReady event handler if you want to be notified when the audio capture buffer is ready to be processed.

Concepts

Creating and Playing Sounds
Provides overviews about audio technology, and presents predefined scenarios to demonstrate how to use audio.
Voice Support
Introduces the voice support options available in the XNA Framework.

Reference

DynamicSoundEffectInstance
Provides properties, methods, and events for play back of the audio buffer.
Microphone
Provides properties, methods, and fields and events for capturing audio data with microphones.


Recording Sound with a Microphone

Recording Sound with a Microphone

This topic demonstrates the basics of recording audio using a microphone.

Recording Audio from a Microphone

The procedure shows the bare basics of using the microphone to record audio. In practice, you will want to use UI elements (such as buttons) to start and stop audio recording.

To record audio from the microphone

  1. Get the device's default microphone by using Microphone.Default.

    C#
    Microphone  mic = Microphone.Default;
if (mic == null)
{
   return false; // No microphone is attached to the device
}

  2. Declare a buffer array to hold the audio data, and declare a variable to track the amount of audio that will be recorded.

    C#
    // Declare a buffer array to hold the audio data based on the duration of the recording
byte[] buffer = new byte[Microphone.Default.GetSampleSizeInBytes(TimeSpan.FromSeconds(3.0))];

// Tracks the amount of data recorded
int bytesRead = 0;

  3. Begin recording audio, calling method Microphone.Start.

    C#
    if (!isMicrophoneRecording)
{
    // we are starting to record
    timeSpentRecording = 0;
    Microphone.Default.Start();
}

isMicrophoneRecording = !isMicrophoneRecording;

  4. While the microphone is recording, call Microphone.GetData (Byte[], Int32, Int32) in your game's Game.Update method to save the latest recorded audio to the buffer.

    C#
    bytesRead += Microphone.Default.GetData(buffer, bytesRead, (buffer.Length - bytesRead));

  5. When you are finished recording, set the microphone state to stopped by calling method Stop.

    C#
    if (!isMicrophoneRecording)
{
}

else
{

    Microphone.Default.Stop();

    // mark the flag that we have some data available.
    hasData = true;
}

Concepts

Working with Microphones
Provides an overview and basic concepts of microphone usage for XNA Game Studio 4.0-enabled games.

Reference

Microphone
Provides properties, methods, and fields and events for capturing audio data with microphones.
DynamicSoundEffectInstance
Provides properties, methods, and events for play back of the audio buffer.


Using Microsoft Cross-Platform Audio Creation Tool (XACT)

Using Microsoft Cross-Platform Audio Creation Tool (XACT)
See Also
CollapseAll image

This section provides overview material that demonstrates how to play sounds using XACT in XNA Game Studio 4.0. XACT is supported for Windows and Xbox 360 platforms and not Windows Phone.

In This Section

Getting Started with XACT
Introduces the Microsoft Cross-Platform Audio Creation Tool (XACT).
Adding a Sound File (XACT)
Demonstrates how to add wave (.wav) files to an XACT project that can be built and interpreted by an XNA Game Studio game to play audio.
Playing Sounds from an XACT Project
Demonstrates how to initialize the audio engine, to load sound banks and wave banks created using XACT, and then to play a sound by using a Cue object.
Playing Background Music (XACT)
Demonstrates how to specify sound (.wav) files as background music.
Pausing a Sound (XACT)
Demonstrates how to initialize the audio engine; how to load a sound bank and wave bank; and how to play, pause, resume, and stop a sound (called a cue).
Adjusting Volume (XACT)
Demonstrates how to initialize the audio engine, and how to use categories to change the playback volume of a group of sounds.
Streaming a Sound (XACT)
Demonstrates how to create and use a streaming wave bank.
Applying a 3D Positional Effect to a Cue (XACT)
Demonstrates how to apply a 3D positioning effect to a cue.
Audio Attenuation and Doppler Pitch Shifting Overview (XACT)
Provides an overview of attenuation and Doppler pitch shifting.
Applying 3D Audio Effects (XACT)
Demonstrates how to apply attenuation and Doppler 3D audio effects in code.

Expand image See Also

Audio Content Catalog at XNA Creators Club Online


Getting Started with XACT

The XNA Framework provides audio playback through the Microsoft Cross-Platform Audio Creation Tool (XACT), and a simple SoundEffect class for audio playback that does not require XACT. XACT is supported for Windows and Xbox 360 platforms and not Windows Phone.

Introducing XACT

XACT, the heart of the XNA Framework Audio API, combines two things. It combines a powerful graphical tool for authoring audio content with an API that is responsible for interpreting the authored XACT files and for playing audio in response to game events. It is expected that core audio elements (waves) are fully developed before XACT is used.

Getting Started with XACT

Not all features of XACT are necessary for a game title that uses simple audio playback.

  • To learn how to create a simple XACT project that contains only a few wave files, see Adding a Sound File (XACT).
  • To learn how to load and play cues from the XACT project you built, see Playing Sounds from an XACT Project.
  • To create simple sound effects without using XACT at all, see Playing a Sound.

XACT Audio Terminology

XACT uses the following terminology for the organization of sound files:

Wave

A wave is an audio data file used independently or as a building block for creating game sound effects.

Wave bank

A wave bank contains multiple wave files that are logically-grouped into a single file.

Sound bank

A sound bank is a logically-grouped collection of wave banks and cues.

Cue

A cue allows a game programmer to play sounds. It is composed of one or more sounds, and is referenced through a sound bank.

What XACT Does

As a audio content creation system driven by a graphical user interface, XACT enables audio designers to load wave files into groups, to organize the files into discrete cues that can be activated by in-game events, and to create transitions between cues. XACT also enables designers to define variables that can be changed in-game to modify audio settings. With these advanced tools, an audio designer might, for example, design a set of car engine sounds for a racing game, and through the use of a variable, cause the car engine sounds to increase or decrease in pitch and volume as the variable is controlled in-game by the XACT engine.

To get started using XACT

  1. Click Start, and then click All Programs.

  2. Click the XNA Game Studio folder, select Tools, and then click Microsoft Cross-Platform Audio Creation Tool (XACT).

For detailed information about how to author audio in the XACT tool, including information about categories, variables, and other advanced features, see XACT Audio Authoring.

Programming for XACT

Once you create an XACT project and save it as an .xap file, add the .xap file and any wave files the XACT project uses as input to your XNA Game Studio game. The Content Pipeline builds the needed files for you to access your content at run time.

An XACT project builds a set of files: a global settings (.xgs), one or more wave banks (.xwb), and one or more sound banks (.xsb). These files may be provided to AudioEngine, WaveBank, and SoundBank constructors, respectively.

To initialize the XACT engine

  1. Create a new AudioEngine, and provide the path to the global settings file.

  2. Create new WaveBank objects to load any wave banks you need.

  3. Create SoundBank objects to add any needed sound banks.

Note

Once you load the necessary files, you can access cues created by the audio designer by calling GetCue on the SoundBank that contains the Cue that you want to retrieve. Each Cue instance that you retrieve is unique, even when you retrieve multiple cues with the same name. This allows multiple instances of the same Cue to exist and play simultaneously.

You can play, pause, resume, and stop Cue objects by using the Play, Pause, Resume, and Stop methods, respectively. See Playing Sounds from an XACT Project for information about how to play a cue. For more information about how to pause, resume, and stop cues, see Pausing a Sound (XACT).

Periodically, you must call Update to allow the audio engine to process audio data.

For more advanced projects, you can also access AudioCategory objects to control playback of sound categories by calling AudioEngine.GetCategory. Also, to access variables that the audio designer has tied to playback changes in volume, pitch, or DSP effects, you can call AudioEngine.GetGlobalVariable. For more information about how to use categories to change sound volume levels, see Adjusting Volume (XACT).

Expand image See Also

Concepts

Sounds Overview
Audio Content Catalog at XNA Creators Club Online


Adding a Sound File (XACT)

Adding a Sound File (XACT)
See Also
CollapseAll image

Demonstrates how to add .wav files to a Microsoft Cross-Platform Audio Creation Tool (XACT) project that can be built and interpreted by an XNA Game Studio game to play audio.

For detailed information about how to author audio using the XACT tool, including information about categories, variables, and other advanced features, see XACT Audio Authoring.

Adding a Sound File

To create a wave bank

  1. Click Start, point to All Programs, click Tools, and then click Microsoft Cross-Platform Audio Creation Tool (XACT).

    Next you'll create a project.

  2. On the File menu, click New Project.

    You are asked for a location and a name for your project.

  3. Enter a name and a location that is easy for you to remember, and then click OK.

    The project is created, and a screen similar to the following appears.

    In the empty project, create a wave bank.

  4. Click Wave Banks, and then click New Wave Bank.

    A new wave bank appears in the tree view under Wave Banks with the default name "Wave Bank."

  5. Press ENTER to accept the default name.

To create a sound bank

  1. Click Sound Banks, and then click New Sound Bank.

    A new sound bank appears in the tree view under Sound Banks with the default name "Sound Bank."

  2. Press ENTER to accept the default name.

    At this point, two new windows appear: one for the wave bank and one for the sound bank. These windows can be arranged for easier viewing

  3. Click Window, and then click Tile Horizontally.

    The windows should look similar to the following:

To add wave files to the wave bank window

Now you need to add your wave file to the wave bank window.

  1. Click Wave Banks, and then click Insert Wave File(s) to ensure the wave bank window is active.

  2. Insert one or more wave files into the wave bank.

    Successfully added files appear in the wave bank window.

    Now you need to perform the following step for each wave listed in the wave bank window.

  3. Drag the wave from the wave bank window to the sound bank window, and then drop the wave on top of the Cue Name panel.

    XACT automatically creates a new cue that is linked to a new sound that plays this wave file, as illustrated in this screen.

  4. If the lower-left corner of the sound bank window does not have any entries, add entries to it by dragging each sound from the upper-left panel to the lower-left panel of the sound bank.

    This action creates cues that correspond to the sounds.

  5. Click File, and then click Save Project.

You are now ready to load and play sounds from this project in your game; see Playing Sounds from an XACT Project for more information.

Expand image See Also

Playing a Sound


Playing Sounds from an XACT Project

Playing Sounds from an XACT Project

This section demonstrates how to initialize the audio engine, to load sound banks and wave banks created using XACT, and then to play a sound by using a Cue object.

Complete Sample

The code in this topic shows you the techniques for initializing, loading, and playing sounds. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download PlaySound_Sample.zip

Playing a Sound Using XACT

After you have an XACT project that has sound files, you then can load and play those sounds in your game. To add sound files to an XACT project, see Adding a Sound File (XACT).

To play a sound using sound files created by XACT

When following these steps and using the code provided, ensure your file names match those given in the example.

  1. Allocate audio objects AudioEngine (XACT Engine), SoundBank, and WaveBank.

    C#
    // Audio objects
AudioEngine engine;
SoundBank soundBank;
WaveBank waveBank;

  2. Initialize the audio objects by loading the XACT sound files, and then use a Cue object to play the sound.

    C#
    // Initialize audio objects.
engine = new AudioEngine("Content\\PlaySound.xgs");
soundBank = new SoundBank(engine, "Content\\Sound Bank.xsb");
waveBank = new WaveBank(engine, "Content\\Wave Bank.xwb");

// Play the sound.
Cue cue = soundBank.GetCue("kaboom");
cue.Play();

Each Cue instance that you play is unique, even when you play multiple cues with the same name. This enables you to play multiple instances of the same Cue simultaneously.

Concepts

Adding a Sound File (XACT)
Demonstrates how to add wave (.wav) files to an XACT project that can be built and interpreted by an XNA Game Studio game to play audio.
Pausing a Sound (XACT)
Demonstrates how to initialize the audio engine; how to load a sound bank and wave bank; and how to play, pause, resume, and stop a sound (called a cue).
Playing a Sound
Demonstrates how to play a simple sound by using SoundEffect.

Reference

AudioEngine Class
Represents the audio engine. Applications use the methods of the audio engine to instantiate and manipulate core audio objects.
Cue Class
Defines methods for managing the playback of sounds.
SoundBank Class
Represents a sound bank, which is a collection of cues.
WaveBank Class
Represents a wave bank, which is a collection of wave files.


Playing Background Music (XACT)

Playing Background Music (XACT)
See Also
CollapseAll image

Demonstrates how to specify sound (.wav) files as background music. Specifying background music enables the XNA Framework to override the background music with the user's music choice, without interrupting other game sounds such as sound effects. This is accomplished by setting the sound bank category to music in the Microsoft Cross-Platform Audio Creation Tool (XACT).

Note
Streaming allows for a .wav file to be read gradually from the disk rather than loaded into memory all at once. Because background music files may be larger than other files containing game sounds, they typically are streamed. In XACT, you need to create and use a streaming WaveBank to stream background music. To learn about streaming, see Streaming a Sound (XACT).

Specifying Background Music in Your Game

This procedure assumes you have already created an XACT project.

To specify background music in your game

  1. On the File menu, click Open Project.

  2. Browse to your project location, and click Open to load it.

  3. Double-click the sound bank that contains the background music.

    This highlights the sound bank in the left navigation tree, and displays the sound bank properties pane.

  4. Click the sound you wish to designate as background music.

    This displays the properties pane, and then shows the category options for the sound.

  5. In the Category box, select music, and then save the project.

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Adding a Sound File (XACT)
Streaming a Sound (XACT)


Pausing a Sound (XACT)

Pausing a Sound (XACT)
CollapseAll image

Demonstrates how to initialize the audio engine; how to load a sound bank and wave bank; and how to play, pause, resume, and stop a sound (called a cue). This example builds off a simpler example, Playing Sounds from an XACT Project, and assumes you already built a sound bank and wave bank using the Microsoft Cross-Platform Audio Creation Tool (XACT). If not, see Adding a Sound File (XACT) to learn how to do this.

Complete Sample

The code in this topic shows you the techniques stopping and pausing sounds. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample. The complete sample includes the standard solution files .

Download StopOrPauseSound_Sample.zip

C#
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;

namespace StopOrPauseSoundXACT
{
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;

        // Audio objects
        AudioEngine engine;
        SoundBank soundBank;
        WaveBank waveBank;
        Cue cue;

        GamePadState oldState;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
        }

        protected override void Initialize()
        {
            base.Initialize();

            // Initialize audio objects.
            engine = new AudioEngine("Content\\StopOrPauseSound.xgs");
            soundBank = new SoundBank(engine, "Content\\Sound Bank.xsb");
            waveBank = new WaveBank(engine, "Content\\Wave Bank.xwb");

            // Get the cue and play it.
            cue = soundBank.GetCue("music");
            cue.Play();
        }

        protected override void LoadContent()
        {
        }

        protected override void UnloadContent()
        {
        }

        protected void UpdateInput()
        {
            // Get the current gamepad state.
            GamePadState currentState = GamePad.GetState(PlayerIndex.One);

            if (currentState.DPad == oldState.DPad)
            {
                return;
            }

            // DPad right is 'play/pause'.
            if (currentState.DPad.Right == ButtonState.Pressed)
            {
                if (cue.IsPaused)
                {
                    cue.Resume();
                }
                else if (cue.IsPlaying)
                {
                    cue.Pause();
                }
                else
                {
                    // If stopped, create a new cue.
                    cue = soundBank.GetCue(cue.Name);
                    cue.Play();
                }
            }

            // DPad left is 'stop'.
            if (currentState.DPad.Left == ButtonState.Pressed)
            {
                cue.Stop(AudioStopOptions.AsAuthored);
            }

            oldState = currentState;
        }

        protected override void Update(GameTime gameTime)
        {
            // Allow the game to exit.
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back ==
                ButtonState.Pressed)
                this.Exit();

            // Check input.
            UpdateInput();

            // Update the audio engine.
            engine.Update();

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
            base.Draw(gameTime);
        }
    }
}

Playing, Pausing, or Stopping a Sound

To play, pause, or stop a sound

  1. Create an AudioEngine, WaveBank, and SoundBank at game start.

  2. Call the Update method of the AudioEngine during game update to enable the audio engine to process audio data.

  3. Call SoundBank.GetCue to retrieve a cue you want to play, and then store the returned cue value.

To play a cue

  • Call Cue.Play.

To pause a cue

  • Call Cue.Pause.

To stop a cue

  • Call Cue.Stop.


Adjusting Volume (XACT)

Adjusting Volume (XACT)
CollapseAll image

This section demonstrates how to initialize the audio engine, and how to use categories to change the playback volume of a group of sounds.Categories control the sound volume levels for groups of sounds in the Microsoft Cross-Platform Audio Creation Tool (XACT). These categories are collections that can hold one or more references to cues. Global variables linked to runtime parameter controls (RPC) within the XACT project control individual cue volumes. This topic explains how to use categories to control the volume of groups of sounds.

  • For more information about using global variables and RPCs, see XACT Variables and XACT Runtime Parameter Controls.
  • For more information about creating categories within your XACT project, see Making XACT Categories.
  • For more information about how XACT automatically adjusts the volume based on distance, see Applying 3D Audio Effects (XACT).

Complete Sample

The code in this topic shows you the technique for changing sound volume levels. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download ChangeSoundVolume_Sample.zip

Changing Sound Volume Levels

The example assumes you already built an XACT sound bank and wave bank. If not, see Adding a Sound File (XACT) to learn how to do this.

To change sound volume levels

  1. Create an AudioEngine, WaveBank, and SoundBank at game start.

    C#
    // Audio objects
AudioEngine engine;
SoundBank soundBank;
WaveBank waveBank;
AudioCategory musicCategory;

  2. Call the AudioEngine.Update method of the AudioEngine during game update to allow the audio engine to process audio data.

    C#
    // Update the audio engine.
engine.Update();

  3. Call AudioEngine.GetCategory to retrieve a category of sounds whose volume you want to change, and then pass in the name of the category you created in the XACT project.

    C#
    // Get the category.
musicCategory = engine.GetCategory("Music");

  4. Call AudioCategory.SetVolume to specify the desired volume.

    C#
    // Set the category volume.
musicCategory.SetVolume(musicVolume);

    Normal volume value should be between 0.0 (silence) and 1.0 (full volume, as authored). Values greater than 1.0 will make the volume louder than designed. A volume of 2.0, for example, adds +6 decibels to the authored level.

Related Overview Topics

Getting Started with XACT
Introduces the Microsoft Cross-Platform Audio Creation Tool (XACT).
Adding a Sound File (XACT)
Demonstrates how to add wave (.wav) files to an XACT project that can be built and interpreted by an XNA Game Studio game to play audio.
Playing Sounds from an XACT Project
Demonstrates how to initialize the audio engine, to load sound banks and wave banks created using XACT, and then to play a sound by using a Cue object.
Playing Background Music (XACT)
Demonstrates how to specify sound (.wav) files as background music.
Creating and Playing Sounds
Provides overviews about audio technology, and presents predefined scenarios to demonstrate how to use audio.


Streaming a Sound (XACT)

Streaming a Sound (XACT)
See Also
CollapseAll image

Demonstrates how to create and use a streaming wave bank. This topic builds on concepts in Sounds Overview and Adding a Sound File (XACT).

Note
This example assumes you already built a Microsoft Cross-Platform Audio Creation Tool (XACT) sound bank and wave bank. If not, see Adding a Sound File (XACT) to learn how to do this.

Complete Sample

The code in this tutorial illustrates the technique for creating and streaming a wave (.wav) file. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

Download StreamSound_Sample.zip

Latency

In this context, latency is the length of time it takes a device to retrieve waves from memory, and, subsequently, to play the sound. If latency is substantial, it can cause delays in audio playback, or possibly interrupt game sounds altogether.

Why Stream?

A wave bank may be designated as in-memory, which means all waves are loaded from the storage medium into game memory. Otherwise, a wave bank may be designated as streaming, which means that waves remain stored on disk. When a wave bank is designated as streaming, sound information is delivered to the game through in-memory buffers. This is useful for sounds that are too large or too long to completely load into working memory. Streaming allows a game developer to effectively use large amounts of audio data without using too much memory.

When to Stream

Usually, it is better to store wave banks in-memory. When waves are in-memory, the playback of the sound always occurs without latency. However, in cases when sounds are too large to load into memory, a streaming wave bank may be a better choice. For example, this could be the case with background music that is much longer than other game sounds, such as short sound effects.

Creating a Streaming Wave Bank

With XACT

The process for creating a streaming wave bank in XACT, with the exception of one step, is the same as the process described in Adding a Sound File (XACT).

To create a streaming wave bank

  1. Under General, select Wave Bank in the Name box.

  2. Under Type, click Streaming.

In Code

You can create a streaming wave bank by using the WaveBank (AudioEngine, String, Int32, Int16) constructor that requires two streaming-related parameters: offset and packet size. An offset of zero starts the stream at the beginning of the wave file. Packet size determines how much memory a streaming wave bank uses for buffering. A smaller packet size results in smaller amounts of data streaming through the buffer at any given time. A larger packet size indicates a larger amount of data moving through the buffer. Ideally, a game developer specifies a packet size that uses the least amount of memory, and at the same time allows for uninterrupted sounds during gameplay. The minimum value for packet size is 2, which results in a packet size of 4,096 bytes. The optimal packet size is a multiple of 16 (1 DVD block = 16 DVD sectors).

To create a streaming wave bank

  1. Allocate an AudioEngine, a SoundBank, and a WaveBank.

    C#
    // Audio objects
AudioEngine engine;
SoundBank soundBank;
WaveBank waveBank;

  2. In the Game.Initialize method, load the AudioEngine and SoundBank.

    C#
    engine = new AudioEngine("Content\\PlaySound.xgs");
soundBank = new SoundBank(engine, "Content\\Sound Bank.xsb");

  3. Create the streaming wave bank.

    C#
    waveBank =
    new WaveBank(engine, "Content\\Wave Bank.xwb", 0, 4);

  4. Call the AudioEngine.Update method of the AudioEngine during initialization to allow the audio engine to process audio data.

    C#
    engine.Update();

  5. Call SoundBank.PlayCue to begin playback.

    C#
    // Play the sound.
soundBank.PlayCue("kaboom");
Note
Before you execute code to play any sound, you must call the Update method of the AudioEngine that was used to create the streaming wave bank. Calling the AudioEngine method prepares the streaming wave bank for use. If you try to use the wave bank before you call the Update method, an InvalidOperation exception is thrown.

Expand image See Also

Concepts

Adding a Sound File (XACT)
Playing Sounds from an XACT Project
Applying a 3D Positional Effect to a Cue (XACT)
Applying 3D Audio Effects (XACT)
Audio Attenuation and Doppler Pitch Shifting Overview (XACT)
Getting Started with XACT


Applying a 3D Positional Effect to a Cue (XACT)

Applying a 3D Positional Effect to a Cue (XACT)
CollapseAll image

The XNA Framework audio system contains support for 3D audio positioning effects. It uses the AudioEmitter and AudioListener classes, and the Cue.Apply3D method. The effects simulate 3D positioning for sound by adjusting speaker mix for cues that use the 3D values.

The speaker mix is the only effect that is automatically applied using this method. Attenuation and Doppler shift pitch modification effects must be applied via creation of runtime parameter controls (RPC) in the Microsoft Cross-Platform Audio Creation Tool (XACT). See Applying 3D Audio Effects (XACT) and Apply3D for more information.

Complete Sample

The following example uses a circular rotation around a stationary AudioListener to emphasize the 3D effect.

The code in this topic shows you the technique for applying basic 3D positional effects. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Basic3DAudio_Sample.zip

Applying Basic 3D Positional Effects to a Cue

To retrieve and play a cue in 3D

  1. Create an XACT project and add it to a new XNA Game Studio project as described in Adding a Sound File (XACT).

    The project should contain at least one cue.

  2. In code, create an AudioEngine, a WaveBank, and a SoundBank at game start.

    C#
    // Audio objects
AudioEngine engine;
SoundBank soundBank;
WaveBank waveBank;

  3. Create an AudioEmitter, an AudioListener, and a Cue to store the 3D position of the sound entity.

    C#
    // 3D audio objects
AudioEmitter emitter = new AudioEmitter();
AudioListener listener = new AudioListener();
Cue cue;

  4. In the Game.Initialize method, load the AudioEngine, SoundBank, and WaveBank.

    C#
    engine = new AudioEngine("Content\\3DAudio.xgs");
soundBank = new SoundBank(engine, "Content\\Sound Bank.xsb");
waveBank = new WaveBank(engine, "Content\\Wave Bank.xwb");

  5. Call SoundBank.GetCue to retrieve the Cue you want to play in 3D.

    C#
    cue = soundBank.GetCue("buzz");

  6. Call Cue.Apply3D on the cue you retrieved in the prior step.

    C#
    cue.Apply3D(listener, emitter);

  7. Call Cue.Play to begin play back of the cue.

    C#
    cue.Play();
    Note
    You must have called Apply3D on the cue first. Otherwise, the next call to Apply3D throws an exception.

To process audio data

  1. Set the Vector3 structure to the position from which you want the sound to come.

    C#
    // Move the object around in a circle.
Vector3 objectPos = new Vector3(
    (float)Math.Cos(gameTime.TotalGameTime.Seconds) / 2,
    0,
    (float)Math.Sin(gameTime.TotalGameTime.Seconds));

  2. Set the AudioEmitter.Position property to this vector.

    C#
    emitter.Position = objectPos;

    As an option, set the Vector3 structure to the position where you want the listener of the 3D sound to be, and then set the AudioListener.Position property to this vector.

  3. Call Cue.Apply3D on the cue object you retrieved previously, passing in the AudioEmitter, which is an AudioListener.

    C#
    cue.Apply3D(listener, emitter);

  4. During game update, call the Update method of the AudioEngine to enable the audio engine to process audio data.

    C#
    // Update the audio engine
engine.Update();
Note
Calling the Cue.Apply3D method automatically sets the speaker mix for any sound played by this cue to a value calculated by the difference in Position values between listener and emitter. In preparation for the mix, the sound is converted to monoaural. Any stereo information in the sound is discarded.

Concepts

Applying a 3D Positional Effect to a Sound
Demonstrates how to apply 3D positioning effects to a SoundEffect.
Adding a Sound File (XACT)
Demonstrates how to add wave (.wav) files to an XACT project that can be built and interpreted by an XNA Game Studio game to play audio.
Applying 3D Audio Effects (XACT)
Demonstrates how to apply attenuation and Doppler 3D audio effects in code.
Audio Attenuation and Doppler Pitch Shifting Overview (XACT)
Provides an overview of attenuation and Doppler pitch shifting.
Getting Started with XACT
Introduces the Microsoft Cross-Platform Audio Creation Tool (XACT).

Reference

AudioListener Class
Represents a 3D audio listener.
AudioEmitter Class
Represents a 3D audio emitter.
Cue Class
Defines methods for managing the playback of sounds.
AudioEngine Class
Represents the audio engine. Applications use the methods of the audio engine to instantiate and manipulate core audio objects.


Audio Attenuation and Doppler Pitch Shifting Overview (XACT)

Audio Attenuation and Doppler Pitch Shifting Overview (XACT)
CollapseAll image

This section provides an overview of attenuation and Doppler pitch shifting. Procedures for using each are provided .

  • Attenuation
  • Defining the Distance Scale
  • Creating a Distance::Volume RPC
  • Applying the RPC to Sounds
  • Removing an RPC from a Sound
  • Doppler Pitch Shifting

Attenuation

In 3D audio, attenuation refers to volume attenuation—the effect of having volume fade with distance between emitter and listener. By default, the Microsoft Cross-Platform Audio Creation Tool (XACT) does not automatically apply volume attenuation as a result of calculating distance, or Doppler effect as a result of relative emitter and listener velocity.

The programmer controls the position and velocity of game objects, and the sound designer determines how that affects sound. XACT is designed to partition and simplify the work of the programmer and sound designer. It determines emitted sound by combining effects specified by the sound designer with positional information supplied by the game.

XACT exposes variables as placeholders for run-time game information such as position and velocity. The sound designer uses XACT runtime parameter controls (RPCs) to define the relationships between those variables and sound effects. The variables are then set at run time, either by the game or by XACT itself, and produce the desired sounds.

The project tree region of the XACT tool shows the available variables.

Figure 1. XACT variables

Global variables are shared by all active sound cues. Only one of each global variable exists and persists the entire time the game is running. In contrast, a separate copy of each cue instance variable exists for every active cue. Cue instance variables persist only for the lifetime of an individual cue instance.

Global variables allow multiple audio elements to be controlled together. Cue instance variables provide individual control or information for each instance of a cue, and for each copy of the same cue.

Figure 2. Cue instance variables

The variables used for 3D audio effects are the cue instance variables Distance, DopplerPitchScalar, and OrientationAngle. XACT automatically updates these variables for the cue when the game calls Apply3D.

Variable | Description
Distance | The distance between the emitter and listener.
DopplerPitchScalar | A value calculated by comparing the relative velocities of the emitter and listener; used for Doppler pitch shifting.
OrientationAngle | The angle difference between the emitter and listener.

XACT updates the cue's Distance variable. By default, the variable does not adjust the volume for that cue. It is not the developer's job to try to determine and set the appropriate volume. Instead, the sound designer defines the attenuation, which is the relationship between distance and volume. To do so, the designer uses the XACT tool to create an RPC. An RPC defines the mapping between an input variable such as Distance and an output parameter such as sound volume.

The programmer might be tempted to query distance with Cue.GetVariable("Distance"), and then, based on distance, try to set the volume of the cue. Normally, volume can be set only for categories of cues defined by the sound designer (see Adjusting Volume (XACT) for more information). The game code would also have to calculate the proper volume change based on distance. To avoid these issues, use an RPC as described in this topic and let XACT, as designed, perform attenuation automatically.

Defining the Distance Scale

To define the Distance scale

  1. Click the Distance variable in the tree.

    The properties pane, below the project tree, displays properties for the Distance variable. Look for the section named General.

    Figure 3. The variable range

  2. Under General, find the Variable Range boxes.

    The left box is the minimum value and the right box is the maximum value.

  3. Enter values into these boxes that are appropriate to the game's world scale (or whatever scale is used when calling Apply3D).

    Distances outside the specified range are clamped to the range. The designer need not worry about extreme values when determining the curve. For example, a game uses a 1 m (one meter) game scale, and sounds trail off completely near 1000 m. The minimum value would be 0, and the maximum value would be 1000.

Creating a Distance::Volume RPC

To create a Distance::Volume RPC

  1. Right-click the RPC Presets node in the project tree, and then select New RPC Preset.

    XACT creates and displays a new RPC, and then opens it for editing.

  2. In the Variable box, select Distance (the default is OrientationAngle).

  3. In the Object box, select Sound.

  4. In the Parameter box, select Volume.

    The RPC now adjusts volume based on distance. However, the curve is created flat, which means that volume remains constant over distance. To change that and to define the attenuation, you must adjust the curve. In the curve plot window, distance is on the x-axis and volume, in decibels (dB), is on the y-axis. To attenuate over distance, Y (volume) should decrease as X (distance) increases.

  5. Double-click anywhere on the plot line to create a new control point.

    The curve is split and a new adjustable control point is added.

  6. Add and adjust as many curve points as needed to define the attenuation.

    Note

    Different sounds may have different attenuation characteristics. These two example curves produce significantly different attenuation. The first creates a simple constant ramp from full volume (+0 decibel (dB)) to silence (−96 dB) over the full distance range. The second has a fast rolloff after a short distance, then a fade out to full distance.

    Figure 4. Attenuation RPC (constant rolloff)

    Figure 5. Attenuation RPC (quick rolloff)

  7. When finished, close the RPC window.

    The new RPC is called "RPC Preset," but it can be renamed (to "Attenuation," for example) to make it easier to find in the RPC list. The name given does not affect the RPC or the game code.

  8. Right-click the RPC to rename it, and then click Rename.

Applying the RPC to Sounds

To apply the RPC to sounds

The RPC is now defined, but no sounds are configured yet to use it. By default, sounds do not use any of the defined RPCs. Some sounds will not need attenuation (for example, narration or tutorial instructions), while others may need several different RPC effects.

  1. Double-click a sound bank listed in Sound Banks in the project tree.

    The sound bank opens, showing the sounds and cues defined in that bank.

  2. From RPC Presets in the project tree, drag the desired RPC onto the sound that will use that RPC.

Do this for as many sounds as will be used for the attenuation effect. You can apply more than one RPC to a sound. RPC curves that modify elements such as pitch and volume are additive, so if multiple parameters influence the sound, their results are combined.

Removing an RPC from a Sound

To remove an RPC from a sound

  1. Right-click the sound, and then click Attach/Detach RPC(s).

    -or-

    Right-click the RPC in the project tree, and then click Attach/Detach Sounds.

  2. Right-click the sound, and then click Attach/Detach RPC(s).

At this point, the attenuation RPC is defined and applied to the appropriate sounds. XACT will now use the curve to adjust emitter volume based on the distance between emitter and listener. Game code sets the AudioEmitter.Position and AudioListener.Position properties to specify the 3D location of the game objects. When the code then calls Apply3D, XACT adjusts the volume appropriately. See Applying a 3D Positional Effect to a Cue (XACT) for a description of the steps needed to use 3D positioning in a game.

Doppler Pitch Shifting

Doppler pitch shifting is the pitch shifting effect when a listener and an emitter are moving toward or away from each other. The relative velocities of the emitter and listener are compared and the result is used raise or lower the pitch of the emitter's sound.

Doppler pitch shifting is applied to sounds in the same way that attenuation is, except that the RPC adjusts pitch based on relative velocity rather than adjusting volume based on distance. The Doppler RPC ties the DopplerPitchScalar input variable to the Sound::Pitch output parameter.

Adding Doppler Pitch Shifting

To add Doppler pitch shifting

  1. Set the scale of the DopplerPitchScalar variable.

    Tip

    The default scale of 0–4 is appropriate, so leave MinimumValue at 0 and MaximumValue at 4.

    The scale of DopplerPitchScalar is not based on the velocity scale used by the game. Instead, this value is the result of an XACT calculation to determine the pitch adjustment that should be applied due to Doppler effect. Zero indicates down one octave, 1 indicates unity pitch, and 4 indicates up two octaves.

  2. Right-click RPC Presets to create a new RPC, and then click New RPC Preset.

  3. In the Variable box, select DopplerPitchScalar.

  4. In the Object box, select Sound.

  5. In the Parameter box, select Pitch.

  6. Define the Doppler curve effect.

    Note

    The y-axis is the pitch, in semitones, and ranges from down one octave (−12 semitones) to up one octave (+12 semitones).

    For normal Doppler effect, the beginning of the curve would look like the following.

    Figure 6. Doppler RPC

    However, this curve limits the effect to +12 semitones. To enable a wider range effect, make the curve half as steep (+12 semitones at 4.0 rather than 2.0) and set the emitter's Doppler scale (AudioEmitter.DopplerScale) to 2.0f.

  7. Close the RPC window and, if desired, rename the RPC.

  8. Open the sound bank to associate the RPC with sounds, and then drag the RPC from the project tree onto the desired sound or sounds.

Code Changes to Support Doppler Pitch Shifting

XACT derives DopplerPitchScalar based on the relative velocities of the emitter and listener. The game informs XACT of these velocities by setting the AudioListener.Velocity and AudioEmitter.Velocity properties before calling Apply3D.

The AudioEmitter.DopplerScale property can be used to exaggerate (values > 1.0) or diminish (values < 1.0) of the Doppler effect.

For sample code that demonstrates the steps needed to enable attenuation and Doppler effects, see Applying 3D Audio Effects (XACT).

Concepts

Sounds Overview
Provides a high-level overview about the capabilities of the Audio API in XNA Game Studio in addition to general audio terminology.
Applying a 3D Positional Effect to a Cue (XACT)
Demonstrates how to apply a 3D positioning effect to a cue.
Applying 3D Audio Effects (XACT)
Demonstrates how to apply attenuation and Doppler 3D audio effects in code.
XACT Runtime Parameter Controls [DirectX]
XACT Audio Authoring [DirectX]

Reference

Cue.Apply3D Method
Calculates the 3D audio values between an AudioEmitter and an AudioListener object, and applies the resulting values to this Cue.
AudioEmitter.Position Property
Gets or sets the position of this emitter.
AudioListener.Position Property
Gets or sets the position of this listener.
AudioEmitter.Velocity Property
Gets or sets the velocity vector of this emitter.
AudioListener.Velocity Property
Gets or sets the velocity vector of this listener.
AudioEmitter.DopplerScale Property
Gets or sets a scalar applied to the level of Doppler effect calculated between this and any AudioListener.


Applying 3D Audio Effects (XACT)

Applying 3D Audio Effects (XACT)
CollapseAll image

This topic builds upon Applying a 3D Positional Effect to a Cue (XACT), which provides procedures to retrieve and play a cue in 3D and to process audio data. It also introduces Microsoft Cross-Platform Audio Creation Tool (XACT) projects, the audio engine, cues, and emitter and listener positions.

Three-dimensional game audio typically implements at least three effects: speaker positioning, volume attenuation over distance, and Doppler pitch shifting. The basic 3D audio how-to discusses speaker positioning. This topic explains how to add attenuation and Doppler effects to 3D audio.

At design time, the sound designer defines the attenuation and Doppler effects and applies them to specific sounds. The designer uses XACT runtime parameter controls (RPC) to specify the relationships between game information—exposed as XACT variables—and resulting sound effects. To determine final attentuation and Doppler effects at run time, the XACT engine combines the designer's effects with calculations based on position and velocity of the audio source and listener.

Sound designers can add attenuation without requiring any additional code changes by the developer (assuming that the game already sets emitter and listener positions). However, Doppler effects require that XACT know the velocity of the emitter and listener, so the game must set the AudioEmitter.Velocity and AudioListener.Velocity properties.

Complete Sample

The code in the topic shows you the technique for applying audio effects. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Advanced3DAudio_Sample.zip

To add a velocity effect to audio

The following steps add some minor code modifications to the Applying a 3D Positional Effect to a Cue (XACT):

  1. Follow all the steps outlined in the Applying a 3D Positional Effect to a Cue (XACT) topic.

  2. In the Game.Initialize method, initialize the AudioEmitter and AudioListener positions.

    C#
    // Set emitter and listener position.
emitter.Position = Vector3.Backward;
listener.Position = Vector3.Zero;

  3. In the Game.Update method, add the following code to move the sound from left to right. This example uses the left and right triggers on the Xbox 360 Controller to move the sound.

    C#
    // Move the sound left and right out to maximum distance.
emitter.Position = new Vector3(
    (float)Math.Cos(gameTime.TotalGameTime.TotalSeconds / 5.0f) *
    maxEmitterDistance, 0.0f, 1.0f);

// Add velocity with left or right triggers.
emitter.Velocity = new Vector3(maxVelocity *
    GamePad.GetState(PlayerIndex.One).Triggers.Left, 0.0f, 0.0f);
listener.Velocity = new Vector3(-maxVelocity *
    GamePad.GetState(PlayerIndex.One).Triggers.Right, 0.0f, 0.0f);

Concepts

Sounds Overview
Provides a high-level overview about the capabilities of the Audio API in XNA Game Studio in addition to general audio terminology.
Applying a 3D Positional Effect to a Cue (XACT)
Demonstrates how to apply a 3D positioning effect to a cue.
Audio Attenuation and Doppler Pitch Shifting Overview (XACT)
Provides an overview of attenuation and Doppler pitch shifting.

Reference

Cue.Apply3D Method
Calculates the 3D audio values between an AudioEmitter and an AudioListener object, and applies the resulting values to this Cue.
AudioEmitter.Position Property
Gets or sets the position of this emitter.
AudioListener.Position Property
Gets or sets the position of this listener.
AudioEmitter.Velocity Property
Gets or sets the velocity vector of this emitter.
AudioListener.Velocity Property
Gets or sets the velocity vector of this listener.
AudioEmitter.DopplerScale Property
Gets or sets a scalar applied to the level of Doppler effect calculated between this and any AudioListener.

Online Resources

XACT Runtime Parameter Controls [DirectX]
XACT Audio Authoring [DirectX]


Displaying Pictures and Playing Video

Displaying Pictures and Playing Video

This section provides overviews about how to use the Media API to retrieve system media, including pictures, songs, and video.

In This Section

Media Overview
Provides a high-level overview about the capabilities—such as playing music and video and accessing pictures—of the Media API in XNA Game Studio.
Accessing Pictures from a Picture Album
Demonstrates how to access pictures in a picture album using the Media API on Windows Phone.
Playing a Video
Demonstrates how to use the VideoPlayer to play a video.
Playing a Video on a Surface
Demonstrates how to use the VideoPlayer to play back videos on the surface of a quad.

Related Overview Topics

Playing a Song
Demonstrates how to play a song from a user's media library.
Playing a Song from a URI
Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).


Media Overview

Media Overview

This topic provides a high-level overview about the capabilities—such as playing music and video and accessing pictures—of the Media API in XNA Game Studio. A game can query a media collection for songs, artists, albums, playlist, genres, pictures, and picture albums by using the Microsoft.Xna.Framework.Media namespace. Items in the media library also can be searched based on metadata such as artist name, album name, and musical genre.

Songs as Background Music

Access to the media library, combined with the ability to use playlists, allows games to create interesting background scores that can change with gameplay. Songs can be played directly from the media library, or can be imported by using the Content Pipeline. For more information, see Playing a Song.

Pictures as Textures

Games can obtain and use textures from pictures within a media library. For more information, see Accessing Pictures from a Picture Album.

Video Playback

Games now can add videos to their projects by using the Content Pipeline, and can display those videos on-screen. Videos can be displayed as cut scenes or loading graphics, or as part of an object in 3D space.

To add a video to a project, use the steps outlined in How to: Add Game Assets to a Content Project, and select a Windows Media Video (.wmv) file to import. The video content processor that comes with XNA Game Studio has some limitations:

  1. Video enabled with Digital Rights Management cannot be used.
  2. Video must be encoded to the Windows Media Video 9 "Main" profile by using the VC-1 standard.
  3. Video must be encoded with a constant bit rate (CBR).
  4. Video must include an audio track.
  5. Audio accompanying the video must be Windows Media Audio (.wma) encoded, with a single-pass CBR format.

  6. XNA Game Studio supports the following maximum bit rates:

    Profile | Level | Maximum bit rate | Representative resolutions by frame rate
    Main | Low | 2 Mbps | 320 × 240 @ 24 Hz (QVGA)
    Medium 10 Mbps

    720 × 480 @ 30 Hz (480p)

    720 × 576 @ 25 Hz (576p)

    High | 20 Mbps | 1280 × 720 @ 30 Hz (720p)

Without an audio track, a video will fail to load, and will display this message: "Video file is invalid. Please make sure that the video is not DRM protected and is a valid single-pass CBR encoded video file."

Once a video is loaded, games can create a new VideoPlayer object to play, pause, and resume the video. Once the video starts, the game can call the GetTexture method to get a Texture2D containing the current frame of video. The texture can be used by SpriteBatch.Draw or rendered by an Effect as part of an object in 3D space.

Silverlight Constraints

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. Media Overview throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Concepts

Accessing Pictures from a Picture Album
Demonstrates how to access pictures in a picture album using the Media API on Windows Phone.
Playing a Video
Demonstrates how to use the VideoPlayer to play a video.
Playing a Video on a Surface
Demonstrates how to use the VideoPlayer to play back videos on the surface of a quad.
Playing a Song
Demonstrates how to play a song from a user's media library.
Playing a Song from a URI
Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).

Reference

Picture Class
Provides access to a picture in the media library.
Song Class
Provides access to a song in the song library.
Video Class
Represents a video.
VideoPlayer Class
Provides methods and properties to play back, pause, resume, and stop video. VideoPlayer also exposes repeat, volume, and play position information.


Accessing Pictures from a Picture Album

Accessing Pictures from a Picture Album

This section demonstrates how to access pictures in a picture album by using the Media API on Windows Phone.

Complete Sample

The code in the topic shows you the technique for using Media API to access pictures. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download ShowPictures.zip

Accessing Pictures

This example retrieves and displays pictures from a device's media library.

Note
Picture collections will always be empty on Xbox 360 and Windows; therefore, the following example work only on Windows Phone.

To retrieve pictures

  1. Declare variables.

    C#
    ICollection<MediaSource> mediaSources;
MediaLibrary mediaLib;
PictureCollection picCollection;
Texture2D pic;

  2. Call MediaSource.GetAvailableMediaSources to retrieve the available media on the device.

    C#
    // Retrieve all available media libraries on the device
mediaSources = MediaSource.GetAvailableMediaSources();

  3. Call MediaLibrary to get the media libraries from the device.

    C#
    mediaLib = new MediaLibrary();

  4. Obtain the picture collection from the media library.

    C#
    picCollection = mediaLib.Pictures;

  5. Get a picture's texture from the collection.

    C#
    pic = Texture2D.FromStream(GraphicsDevice, picCollection[currentPic].GetImage());

  6. Display the picture on-screen.

    C#
    protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);
    Vector2 pos = Vector2.Zero;
    spriteBatch.Begin();
    spriteBatch.Draw(pic, pos, Color.White);
    spriteBatch.End();

    base.Draw(gameTime);
}

Concepts

Playing a Video
Demonstrates how to use the VideoPlayer to play a video.
Playing a Song from a URI
Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).
Displaying Pictures and Playing Video
Provides overviews about how to use the Media API to retrieve system media, including pictures, songs, and video.

Reference

MediaLibrary Class
Provides access to songs, playlists, and pictures in the device's media library.
PictureCollection Class
A collection of pictures in the media library.


Playing a Video

Demonstrates how to use the VideoPlayer to play a video.

Complete Sample

The code in this topic shows you the technique for playing a video. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download VideoPlayback_Sample.zip

Playing a Video

To play a video

Add a video to the game project using the steps outlined in loading resources.

  1. In LoadContent, load the video using the ContentManager.

  2. Create a new instance of the VideoPlayer.

    C#
    Video video;
VideoPlayer player;
Texture2D videoTexture;

protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);
    video = Content.Load<Video>("video");
    player = new VideoPlayer();
}

  3. In the Update method, play the video.

    Tip

    Set IsLooped to true if you want the video to repeat.

    C#
    protected override void Update(GameTime gameTime)
{
    ...
    if (player.State == MediaState.Stopped)
    {
        player.IsLooped = true;
        player.Play(video);
    }
    ...
    base.Update(gameTime);
}
  4. In Draw, if the VideoPlayer is not stopped, call GetTexture to get a copy of the latest frame of video.
  5. Create a Rectangle defining where on-screen the video will appear.

  6. If the texture is not null, draw it on-screen using SpriteBatch.Draw.

    C#
    protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);

    // Only call GetTexture if a video is playing or paused
    if (player.State != MediaState.Stopped)
        videoTexture = player.GetTexture();

    // Drawing to the rectangle will stretch the
    // video to fill the screen
    Rectangle screen = new Rectangle(GraphicsDevice.Viewport.X,
        GraphicsDevice.Viewport.Y,
        GraphicsDevice.Viewport.Width,
        GraphicsDevice.Viewport.Height);

    // Draw the video, if we have a texture to draw.
    if (videoTexture != null)
    {
        spriteBatch.Begin();
        spriteBatch.Draw(videoTexture, screen, Color.White);
        spriteBatch.End();
    }

    base.Draw(gameTime);
}

Expand image See Also

Concepts

Media Overview

Reference

Video Class
VideoPlayer Class


Playing a Video on a Surface

Playing a Video on a Surface

Demonstrates how to use the VideoPlayer to play back videos on the surface of a quad.

Complete Sample

The code in this topic shows you the technique for playing a video on a quad's surface. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download VideoQuad_Sample.zip

Playing Video

To play a video

  1. Create a quad (or other 2D or 3D surface) on which to display the video.

  2. Create a View and Projection matrix for viewing the quad.

    C#
    protected override void Initialize()
{
    // Create a scene, including a quad and a view matrix looking at it
    quad = new Quad(Vector3.Zero, Vector3.Backward, Vector3.Up, 1, 1);
    viewMatrix = Matrix.CreateLookAt(new Vector3(0, 0, 2),
        Vector3.Zero, Vector3.Up);
    projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
        MathHelper.PiOver4, 4.0f / 3.0f, 1, 500);

    base.Initialize();
}
  3. Add a video to the game project using the steps outlined in loading resources.
  4. In LoadContent, use the ContentManager to load the video.

  5. Create a new instance of the VideoPlayer.

    Tip

    Set IsLooped to true if you want the video to repeat.

  6. Set up your Effect for drawing.

    Note

    In this case, we use BasicEffect, enabling default lighting and a texture.

    C#
    protected override void LoadContent()
{
    // Load a video, and initialize a player
    video = Content.Load<Video>("video");
    player = new VideoPlayer();
    player.IsLooped = true;

    // Setup our BasicEffect for drawing the quad
    worldMatrix = Matrix.CreateScale(video.Width / (float)video.Height, 1, 1);
    basicEffect = new BasicEffect(graphics.GraphicsDevice);
    basicEffect.EnableDefaultLighting();
    basicEffect.World = worldMatrix;
    basicEffect.View = viewMatrix;
    basicEffect.Projection = projectionMatrix;
    basicEffect.TextureEnabled = true;

    // Create a vertex declaration
    vertexDeclaration = new VertexDeclaration(
        new VertexElement[] {
            new VertexElement(0, VertexElementFormat.Vector3,VertexElementUsage.Position, 0),
            new VertexElement(12, VertexElementFormat.Vector3,VertexElementUsage.Normal, 0),
            new VertexElement(24, VertexElementFormat.Vector2,VertexElementUsage.TextureCoordinate,0)
        }
        );
}

  7. In the Update method, play the video.

    C#
    protected override void Update(GameTime gameTime)
{
    ...
    // Play the video if it isn't already.
    if (player.State != MediaState.Playing)
        player.Play(video);

    base.Update(gameTime);
}
  8. In Draw, if the VideoPlayer is not stopped, call GetTexture to get a copy of the latest frame of video, and link it to your effect.

  9. Draw the object using your effect.

    C#
    protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);

    // If the video is playing, get the current frame
    // as a texture. (Calling GetTexture on a stopped
    // player results in an exception)
    if (player.State == MediaState.Playing)
        basicEffect.Texture = player.GetTexture();

    // Draw the quad
    foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
    {
        pass.Apply();

        GraphicsDevice.DrawUserIndexedPrimitives
            <VertexPositionNormalTexture>(
                PrimitiveType.TriangleList,
                quad.Vertices, 0, 4,
                quad.Indexes, 0, 2);
    }

    base.Draw(gameTime);
}

Expand image See Also

Concepts

Media Overview

Tasks

Playing a Video on a Surface

Reference

Video Class
VideoPlayer Class


Reading and Writing Data Files

Reading and Writing Data Files

Provides classes that allow reading and writing of files.

In This Section

What Is Storage?
Storage refers to memory locations used for reading and writing data.
Adding Game Data Files to Title Storage
Describes how to add game data files to the title storage location.
Reading Game Data from Title Storage
Describes how to load game data from the title storage location.
Writing Data (Windows Phone)
Describes how to save game data on Windows Phone.
Creating a File
Demonstrates how to use the StorageContainer class to create a save game file in the user storage area on a device specified by the gamer.
Opening a File for Reading/Writing
Demonstrates how to use the StorageContainer class to open a save game file in the user storage area on a device specified by the gamer.
Copying a File
Demonstrates how to use the StorageContainer class to copy a save game file in the user storage area on a device specified by the gamer.
Renaming a File
Demonstrates how to use the StorageContainer class to rename a save game file in the user storage area on a device specified by the gamer.
Enumerating Save Game Files
Demonstrates how to use the StorageContainer class to get a list of save game files in the user storage area on a device specified by the gamer.
Deleting a Save Game File
Demonstrates how to use the StorageContainer class to delete a save game file in the user storage area on a device specified by the gamer.
Saving Data to a Save Game File
Demonstrates how to use the XmlSerializer class to write data in a custom class to a saved game, and how to load the data from the file.
Getting a StorageDevice Asynchronously
Demonstrates how to call BeginShowSelector and StorageDevice.EndShowSelector to get a StorageDevice object asynchronously.


What Is Storage?

What Is Storage?
See Also
CollapseAll image

Storage refers to memory locations used for reading and writing data.
  • Storage Locations
  • Title Storage
  • User Storage

Storage Locations

When programming with the XNA Framework, you read files from two general locations:

  • Title storage is where the game executable and support files (shaders, meshes, textures, and so on) are located.
  • User storage is the space a player provides for game data (such as saves) that is either locked to a particular profile or available to all players.

Title Storage

Title storage refers to the read-only storage in the default game storage location, including the game executable and all other files packaged with the game. Data in title storage may be accessed through one of two ways:

Content Pipeline

Typically, game assets (such as textures, shaders, media, and custom data) are accessed through the Content Pipeline.

The assets managed through these facilities are not accessed directly as files, but instead are loaded and unloaded through ContentManager by reference to the names they were given at build-time.

Your XNA Game Studio game should use the Content Pipeline, as it offers the most flexible and efficient facilities to manage these assets, and assures speedy operation of your game.

File Stream Access

As noted, your game should use the Content Pipeline to manage its game assets. There may be exceptional cases in which you'll want to manage your own game data—for example, if you have a preexisting content manager that you want to use with XNA Game Studio, or if you otherwise want stream level access to arbitrary game data files.

You can add arbitrary data files to title storage at build time, and they'll be available to your game during runtime through TitleContainer, which provides stream level access to any files in this location.

The following sections describe how to add files to, and read files from, title storage through file stream access:

  • Adding Game Data Files to Title Storage
  • Reading Game Data from Title Storage

User Storage

User storage refers to the read-write storage supported by the game platform for saving information from the game at runtime. The data can be associated with a particular player's profile, or available to all players.

Note
On Windows Phone, writable user storage is handled by Silverlight, not by XNA Game Studio. For more information about saving game data on Windows Phone, see Writing Data (Windows Phone).

Access User Storage

Accessing user storage is performed in two steps:

To access user storage

  1. Retrieve a StorageDevice object to access the user storage device.

    The BeginShowSelector method launches a dialog box that prompts the user to choose a storage device (for example, a memory unit or disk). This method works asynchronously, notifying the caller with an IAsyncResult or a callback method when the user has chosen a device.

    When the operation is complete, the StorageDevice object for the user selected device is retrieved through the EndShowSelector method.

    For an example, see Getting a StorageDevice Asynchronously.

  2. Access the user storage device to read or write.

    The StorageContainer instance provided by BeginOpenContainer provides access to the selected device. Use System.IO objects, such as the File object, to open, copy, rename, or delete files.

    Note
    Open the StorageContainer before reading file data. Not doing so will result in an InvalidOperationException exception.

    For an example, see Saving Data to a Save Game File.

Implementation on Xbox 360

Changes to the files within a StorageContainer on Xbox 360 do not take effect until the StorageContainer is disposed. For this reason, only one StorageContainer can be open on the same device for the same profile.

Before opening a StorageContainer on a device, ensure all previous StorageContainer objects opened for that profile have been disposed. To dispose a StorageContainer, call Dispose.

Implementation on Windows

User storage is in the My Documents folder of the user who is currently logged in, in the SavedGames folder. A subfolder is created for each game according to the titleName passed to the BeginOpenContainer method. When no PlayerIndex is specified, content is saved in the AllPlayers folder. When a PlayerIndex is specified, the content is saved in the Player1, Player2, Player3, or Player4 folder, depending on which PlayerIndex was passed to BeginShowSelector.

Expand image See Also

Tasks

Adding Game Data Files to Title Storage
Reading Game Data from Title Storage
Writing Data (Windows Phone)
Creating a File
Opening a File for Reading/Writing
Copying a File
Renaming a File
Enumerating Save Game Files
Deleting a Save Game File
Saving Data to a Save Game File
Getting a StorageDevice Asynchronously

Reference

TitleContainer
StorageDevice
BeginShowSelector
StorageContainer


Adding Game Data Files to Title Storage

Adding Game Data Files to Title Storage

Describes how to add game data files to the title storage location.
Tip

This topic describes how to add files to title storage that the game will access through stream I/O. This is the exceptional case, and is not recommended for most XNA Game Studio games. Instead, consider using the Content Pipeline to manage your game data most efficiently.

Adding files to Title Storage

Any file that your game needs at runtime can be added to the title storage location simply by adding the file to the root-level of your project in Visual Studio.

To add a data file to title storage

  1. Copy the file to your project directory.

  2. In Solution Explorer, right-click the project name, select Add, and then click Existing Item.

    The Add Existing Item dialog box appears.

  3. In the file types drop-down list, ensure the default setting of All Files (*.*) is selected.

  4. Select the name of the file you want to add to the project from the list, and then click Add.

    An entry for the file appears in your project in Solution Explorer.

  5. In Solution Explorer, click the file just added to view its properties. If the Properties window is not open, right-click the file name, and then click Properties.

  6. In the Properties window, change Build Action to None, and change Copy to Output Directory to Copy if newer.

The file now can be accessed by passing its name to TitleContainer.OpenStream as described in Reading Game Data from Title Storage.

Note
You can add data files to a subfolder in your project, but you will need to refer to the subfolder name when accessing the content with OpenStream. For example, if you place a file named data.txt in a GameData folder in your project, you'll pass the string GameData/data.txt to OpenStream.

Expand image See Also

Tasks

What Is Storage?
Reading Game Data from Title Storage

Reference

TitleContainer


Reading Game Data from Title Storage

Reading Game Data from Title Storage

Describes how to load game data from the title storage location.

Tip

This topic describes how to load files from title storage that the game will access through stream I/O. This is the exceptional case, and is not recommended for most XNA Game Studio games. Instead, you should consider using the Content Pipeline to manage your game data most efficiently.

Complete Sample

The code in the topic shows you the technique for loading game data. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download StorageDemo_Sample.zip

Loading a Game Data File from Title Storage

You can use OpenStream to load game data files from title storage to get read-only stream access to the files in this location. The game data files must already exist. See Adding Game Data Files to Title Storage for information about adding game data files to your project to have them accessible at runtime.

To read a game data file with TitleContainer

This procedure describes how to access game data files once they are added to your project.

  1. Pass the name of the file to read to TitleContainer.OpenStream.

    This returns a System.IO.Stream with read-only access to the file.

  2. Construct a new System.IO.StreamReader, passing it the Stream obtained from TitleContainer.OpenStream

C#
/// <summary>
/// This method opens a file using System.IO classes and the
/// TitleLocation property.  It presumes that a file named
/// ship.dds has been deployed alongside the game.
/// </summary>
private static void DoOpenFile()
{
    try
    {
        System.IO.Stream stream = TitleContainer.OpenStream("ship.dds");
        System.IO.StreamReader sreader = new System.IO.StreamReader(stream);
        // use StreamReader.ReadLine or other methods to read the file data

        Console.WriteLine("File Size: " + stream.Length);
        stream.Close();
    }
    catch (System.IO.FileNotFoundException)
    {
        // this will be thrown by OpenStream if gamedata.txt
        // doesn't exist in the title storage location
    }
}

Expand image See Also

Concepts

What Is Storage?

Reference

StorageContainer
TitleContainer


Writing Data (Windows Phone)

Writing Data (Windows Phone)
See Also
CollapseAll image

XNA Game Studio 4.0 does not provide access to writeable storage on Windows Phone. To access such storage, you'll need to use classes from the System.IO.IsolatedStorage namespace.

For Windows Phone projects, Visual Studio automatically adds the assembly containing System.IO.IsolatedStorage to your project. There is no need to add any additional references to your project.

Complete Sample

The code in this topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample Code

To save game data with System.IO.IsolatedStorage

  1. Add a using System.IO.IsolatedStorage statement at the beginning of the source file in which you'll be using the namespace.

    C#
    using System.IO.IsolatedStorage;

  2. Use IsolatedStorageFile.GetUserStoreForApplication to get an IsolatedStorageFile object that can be used to create files and directories, or to read and write existing files.

    Note

    When IsolatedStorageFile.GetUserStoreForApplication is called within an XNA Game Studio game for Windows (but not for Xbox 360 or Windows Phone), an InvalidOperationException will result. To avoid this exception, use the GetUserStoreForDomain method instead.

    A cross-platform game can use the conditional compilation symbols to control which method is called.

    C#
    #if WINDOWS
    IsolatedStorageFile savegameStorage = IsolatedStorageFile.GetUserStoreForDomain();
#else
    IsolatedStorageFile savegameStorage = IsolatedStorageFile.GetUserStoreForApplication();
#endif

  3. Use IsolatedStorageFile.OpenFile to open a file for writing, and use the returned IsolatedStorageFileStream to write data to the file.

    C#
    protected override void OnExiting(object sender, System.EventArgs args)
{
    // Save the game state (in this case, the typed text).
    IsolatedStorageFile savegameStorage = IsolatedStorageFile.GetUserStoreForApplication();

    // open isolated storage, and write the savefile.
    IsolatedStorageFileStream fs = null;
    fs = savegameStorage.OpenFile(SAVEFILENAME, System.IO.FileMode.Create);
    if (fs != null)
    {
        // just overwrite the existing info for this example.
        fs.WriteByte(gameState); // a single byte
        if ((typedText != null) && (typedText.Length > 0))
        {
            fs.Write(System.Text.Encoding.UTF8.GetBytes(typedText), 0, typedText.Length);
        }
        fs.Close();
    }

    base.OnExiting(sender, args);
}

Reading saved data written in this way uses a very similar process. For example:

C#
protected override void Initialize()
{
    gameState = 0;

    IsolatedStorageFile savegameStorage = IsolatedStorageFile.GetUserStoreForApplication();

    // open isolated storage, and write the savefile.
    if(savegameStorage.FileExists(SAVEFILENAME))
    {
        IsolatedStorageFileStream fs = null;
        try
        {
            fs = savegameStorage.OpenFile(SAVEFILENAME, System.IO.FileMode.Open);
        }
        catch (IsolatedStorageException e)
        {
            // The file couldn't be opened, even though it's there.
            // You can use this knowledge to display an error message
            // for the user (beyond the scope of this example).
        }

        if (fs != null)
        {
            // Reload the last state of the game.  This consists of the UI mode
            // and any text that was typed on the keyboard input screen.
            byte[] saveBytes = new byte[256];
            int count = fs.Read(saveBytes, 0, 256);
            if (count > 0)
            {
                // the first byte is the mode, the rest is the string.
                gameState = saveBytes[0];
                if (count > 1)
                {
                    typedText = System.Text.Encoding.UTF8.GetString(saveBytes, 1, count - 1);
                }
                fs.Close();
            }
        }
    }

    base.Initialize();
}
Note
IsolatedStorageFile provides many more methods than are shown here, including support for asynchronous reads and writes. For complete documentation, see Isolated Storage for Windows Phone in the Windows Phone Development documentation, and the IsolatedStorage reference on MSDN.

Expand image See Also

Concepts

What Is Storage?

Reference

StorageContainer


Creating a File

Demonstrates how to use the StorageContainer class to create a save game file in the user storage area on a device specified by the gamer. This example assumes you obtained a StorageDevice, if not, see Getting a StorageDevice Asynchronously.

Note

The simplified example code demonstrates synchronous usage of BeginOpenContainer through the WaitOne method accessible through IAsyncResult.AsyncWaitHandle.

The preferred technique to use this function asynchronously is similar to the technique demonstrated in the Getting a StorageDevice Asynchronously topic.

Complete Sample

The code in the topic shows you the technique for creating a save game file. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download StorageDemo_Sample.zip

Creating a File

To create a save game file in user storage

  1. Call the StorageDevice.BeginShowSelector method to get a device index indicating which device the player prefers.

  2. Call BeginOpenContainer to open a StorageContainer on the device that is assigned the name of your title.

  3. Call FileExists to confirm that the file is not already present.

  4. Call CreateFile with the name of the file to create.

    CreateFile returns a Stream object that you can use to add data to the file.

  5. Call Close to close the file after you populate it with data.

  6. Call StorageContainer to commit the changes to the device.

C#
private static void DoCreate(StorageDevice device)
{
    // Open a storage container.
    IAsyncResult result =
        device.BeginOpenContainer("StorageDemo", null, null);

    // Wait for the WaitHandle to become signaled.
    result.AsyncWaitHandle.WaitOne();

    StorageContainer container = device.EndOpenContainer(result);

    // Close the wait handle.
    result.AsyncWaitHandle.Close();

    // Add the container path to our file name.
    string filename = "demobinary.sav";

    // Create a new file.
    if (!container.FileExists(filename))
    {
       Stream file = container.CreateFile(filename);
       file.Close();
    }
    // Dispose the container, to commit the data.
    container.Dispose();
}

Expand image See Also

Concepts

What Is Storage?

Reference

StorageDevice
BeginShowSelector
StorageContainer
CreateFile


Opening a File for Reading/Writing

Opening a File for Reading/Writing

Demonstrates how to use the StorageContainer class to open a save game file in the user storage area on a device specified by the gamer. This example assumes you obtained a StorageDevice, if not, see Getting a StorageDevice Asynchronously.

Note

The simplified example code demonstrates synchronous usage of BeginOpenContainer through the WaitOne method accessible through IAsyncResult.AsyncWaitHandle.

The preferred technique to use this function asynchronously is similar to the technique demonstrated in the Getting a StorageDevice Asynchronously topic.

Complete Sample

The code in the topic shows you the technique for opening a save game file for reading and writing. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download StorageDemo_Sample.zip

Opening a File

To open a save game file in user storage

  1. Call the StorageDevice.BeginShowSelector method to get a device index indicating which device the user prefers.

  2. Call BeginOpenContainer to open a StorageContainer on the device that is assigned the name of your title.

  3. Call OpenFile with the name of the file to open. You also may specify any FileMode, FileAccess, and FileShare attributes you require by using the appropriate overload of the method.

    OpenFile returns a Stream object that you can use to add data to the file.

  4. Call Close to close the file after it is read.

  5. Dispose the StorageContainer after closing the file.

C#
private static void DoOpen(StorageDevice device)
{
    IAsyncResult result =
        device.BeginOpenContainer("StorageDemo", null, null);

    // Wait for the WaitHandle to become signaled.
    result.AsyncWaitHandle.WaitOne();

    StorageContainer container = device.EndOpenContainer(result);

    // Close the wait handle.
    result.AsyncWaitHandle.Close();

    // Add the container path to our file name.
    string filename = "demobinary.sav";

    Stream file = container.OpenFile(filename, FileMode.Open);
    file.Close();

    // Dispose the container.
    container.Dispose();
}

Expand image See Also

Concepts

What Is Storage?

Reference

StorageDevice
BeginShowSelector
StorageContainer


Copying a File

Demonstrates how to use the StorageContainer class to copy a save game file in the user storage area on a device specified by the gamer. This example assumes you already obtained a StorageDevice, if not, StorageDevice, see Getting a StorageDevice Asynchronously.

Note

The simplified example code demonstrates synchronous usage of BeginOpenContainer through the WaitOne method accessible through IAsyncResult.AsyncWaitHandle.

The preferred technique to use this function asynchronously is similar to the technique demonstrated in the Getting a StorageDevice Asynchronously topic.

Complete Sample

The code in the topic shows you the technique for copying a save game file. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download StorageDemo_Sample.zip

Copying a File

To copy a save game file in user storage

  1. Call the StorageDevice.BeginShowSelector method to get a device index indicating which device the player prefers.

  2. Call BeginOpenContainer to open a StorageContainer on the device that is assigned the name of your title.

  3. Call FileExists to confirm that the original file exists and that the destination file does not exist.

  4. Call OpenFile with the name of the file to copy, and then call CreateFile with the name of the new file to be created.

  5. Call Stream.CopyTo to copy the file to the newly created file.

  6. Dispose the StorageContainer to commit the changes to the device.

C#
private static void DoCopy(StorageDevice device)
{
    IAsyncResult result =
        device.BeginOpenContainer("StorageDemo", null, null);

    // Wait for the WaitHandle to become signaled.
    result.AsyncWaitHandle.WaitOne();

    StorageContainer container = device.EndOpenContainer(result);

    // Close the wait handle.
    result.AsyncWaitHandle.Close();

    // Add the container path to our file name.
    string filename = "demobinary.sav";
    string copyfilename = "copybinary.sav";

    if (container.FileExists(filename) && !container.FileExists(copyfilename))
    {
        Stream file = container.OpenFile(filename, FileMode.Open);
       Stream copyfile = container.CreateFile(copyfilename);
       file.CopyTo(copyfile);

       file.Close();
       copyfile.Close();
    }

    // Dispose the container, to commit the change.
    container.Dispose();
}

Expand image See Also

Concepts

What Is Storage?

Reference

StorageDevice
BeginShowSelector
StorageContainer


Renaming a File

Demonstrates how to use the StorageContainer class to rename a save game file in the user storage area on a device specified by the gamer. This example assumes you obtained a StorageDevice, if not, see Getting a StorageDevice Asynchronously.

Note

The simplified example code demonstrates synchronous usage of BeginOpenContainer through the WaitOne method accessible through IAsyncResult.AsyncWaitHandle.

The preferred technique to use this function asynchronously is similar to the technique demonstrated in the Getting a StorageDevice Asynchronously topic.

Complete Sample

The code in the topic shows you the technique for creating a save game file. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download StorageDemo_Sample.zip

Renaming a File

To rename a save game file in user storage

  1. Call the StorageDevice.BeginShowSelector method to get a device index indicating which device the user prefers.

  2. Call BeginOpenContainer to open a StorageContainer on the device that is assigned the name of your title.

  3. Call FileExists to confirm that the original file exists and that the destination file does not exist.

  4. Call OpenFile with the name of the file to copy, and call CreateFile with the name of the new copy to be created.

  5. Call Stream.CopyTo to copy the file to the newly created file.

  6. Call DeleteFile to delete the original file.

  7. Dispose of the StorageContainer to commit the changes to the device.

C#
private static void DoRename(StorageDevice device)
{
    IAsyncResult result =
        device.BeginOpenContainer("StorageDemo", null, null);

    // Wait for the WaitHandle to become signaled.
    result.AsyncWaitHandle.WaitOne();

    StorageContainer container = device.EndOpenContainer(result);

    // Close the wait handle.
    result.AsyncWaitHandle.Close();

    // Add the container path to our file name.
    string oldfilename = "demobinary.sav";
    string newfilename = "renamebinary.sav";

    if (container.FileExists(oldfilename) && !container.FileExists(newfilename))
    {
       Stream oldfile = container.OpenFile(oldfilename, FileMode.Open);
       Stream newfile = container.CreateFile(newfilename);
       oldfile.CopyTo(newfile);

       oldfile.Close();
       newfile.Close();
       container.DeleteFile(oldfilename);
    }

    // Dispose the container, to commit the change.
    container.Dispose();
}

Expand image See Also

Concepts

What Is Storage?

Reference

StorageDevice
BeginShowSelector
StorageContainer


Enumerating Save Game Files

Enumerating Save Game Files

Demonstrates how to use the StorageContainer class to get a list of save game files in the user storage area on a device specified by the gamer. This example assumes you obtained a StorageDevice, if not, see Getting a StorageDevice Asynchronously.

Note

The simplified example code demonstrates synchronous usage of BeginOpenContainer through the WaitOne method accessible through IAsyncResult.AsyncWaitHandle.

The preferred technique to use this function asynchronously is similar to the technique demonstrated in the Getting a StorageDevice Asynchronously topic.

Complete Sample

The code in the topic shows you the technique for getting a list of save game files. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download StorageDemo_Sample.zip

Enumerating Files

To enumerate save game files in user storage

  1. Call the StorageDevice.BeginShowSelector method to get a device index indicating which device the user prefers.

  2. Call BeginOpenContainer to open a StorageContainer on the device that is assigned the name of your title.

  3. Call GetFileNames.

    GetFileNames returns an array of strings, where each string is the name of a file in the container.

  4. Dispose the StorageContainer.

C#
private static void DoEnumerate(StorageDevice device)
{
    IAsyncResult result =
        device.BeginOpenContainer("StorageDemo", null, null);

    // Wait for the WaitHandle to become signaled.
    result.AsyncWaitHandle.WaitOne();

    StorageContainer container = device.EndOpenContainer(result);

    // Close the wait handle.
    result.AsyncWaitHandle.Close();

    string[] FileList = container.GetFileNames();
    foreach (string filename in FileList)
    {
       Console.WriteLine(filename);
    }

    // Dispose the container.
    container.Dispose();
}

Expand image See Also

Concepts

What Is Storage?

Reference

StorageDevice
BeginShowSelector
StorageContainer


Deleting a Save Game File

Deleting a Save Game File

Demonstrates how to use the StorageContainer class to delete a save game file in the user storage area on a device specified by the gamer. This example assumes you obtained a StorageDevice, if not, see Getting a StorageDevice Asynchronously.

Note

The simplified example code demonstrates synchronous usage of BeginOpenContainer through the WaitOne method accessible through IAsyncResult.AsyncWaitHandle.

The preferred technique to use this function asynchronously is similar to the technique demonstrated in the Getting a StorageDevice Asynchronously topic.

Complete Sample

The code in the topic shows you the technique for deleting a save game file. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download StorageDemo_Sample.zip

Deleting a File

To delete a saved game file in user storage

  1. Call the StorageDevice.BeginShowSelector method to get a device index indicating which device the user prefers.

  2. Call BeginOpenContainer to open a StorageContainer on the device that is assigned the name of your title.

  3. Call FileExists to confirm that the file is present.

  4. Call File.Delete with the name of the file to delete.

  5. Call the StorageContainer method to commit the changes to the device.

C#
private static void DoDelete(StorageDevice device)
{
    IAsyncResult result =
        device.BeginOpenContainer("StorageDemo", null, null);

    // Wait for the WaitHandle to become signaled.
    result.AsyncWaitHandle.WaitOne();

    StorageContainer container = device.EndOpenContainer(result);

    // Close the wait handle.
    result.AsyncWaitHandle.Close();

    // Add the container path to our file name.
    string filename = "demobinary.sav";

    if (container.FileExists(filename))
    {
       container.DeleteFile(filename);
    }

    // Dispose the container, to commit the change.
    container.Dispose();
}

Expand image See Also

Concepts

What Is Storage?

Reference

StorageDevice
BeginShowSelector
StorageContainer


Saving Data to a Save Game File

Saving Data to a Save Game File

Demonstrates how to use the XmlSerializer class to write data in a custom class to a saved game, and how to load the data from the file.

Note

The simplified example code demonstrates synchronous usage of BeginOpenContainer through the WaitOne method accessible through IAsyncResult.AsyncWaitHandle.

The preferred technique to use this function asynchronously is similar to what is demonstrated in the Getting a StorageDevice Asynchronously topic.

Complete Sample

The code in the topic shows you the technique for creating a save game file. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download StorageDemo_Sample.zip

Serializing Data

To define save game data

  1. Define a new class or structure.

    The size of the class determines the size of your saved game files, so try to keep the class size small. Do not reference other objects from this class unless you also want to serialize them.

  2. Add the Serializable attribute to the class.

C#
[Serializable]
public struct SaveGameData
{
    public string PlayerName;
    public Vector2 AvatarPosition;
    public int Level;
    public int Score;
}

To serialize data to a save game file

  1. Create a StorageContainer to access the specified device.

    C#
    // Open a storage container.
IAsyncResult result =
    device.BeginOpenContainer("StorageDemo", null, null);

// Wait for the WaitHandle to become signaled.
result.AsyncWaitHandle.WaitOne();

StorageContainer container = device.EndOpenContainer(result);

// Close the wait handle.
result.AsyncWaitHandle.Close();

  2. Call FileExists to determine if an earlier save game file exists, and if it does, call DeleteFile to delete it.

    C#
    string filename = "savegame.sav";

// Check to see whether the save exists.
if (container.FileExists(filename))
   // Delete it so that we can create one fresh.
   container.DeleteFile(filename);

  3. Create a Stream object on the file by using the CreateFile method.

    C#
    // Create the file.
Stream stream = container.CreateFile(filename);

  4. Create an XmlSerializer object, passing the type of the structure that defines your save game data.

    C#
    // Convert the object to XML data and put it in the stream.
XmlSerializer serializer = new XmlSerializer(typeof(SaveGameData));

  5. Call Serialize, and then pass the Stream and the data to serialize.

    The XmlSerializer converts data in the structure to XML, and uses the Stream to write the data into the file.

    C#
    serializer.Serialize(stream, data);

  6. Close the Stream.

    C#
    // Close the file.
stream.Close();

  7. Dispose the StorageContainer to commit the changes to the device.

    C#
    // Dispose the container, to commit changes.
container.Dispose();

To read serialized data from a save game file

  1. Create a StorageContainer to access the specified device.

    C#
    // Open a storage container.
IAsyncResult result =
    device.BeginOpenContainer("StorageDemo", null, null);

// Wait for the WaitHandle to become signaled.
result.AsyncWaitHandle.WaitOne();

StorageContainer container = device.EndOpenContainer(result);

// Close the wait handle.
result.AsyncWaitHandle.Close();

  2. Call FileExists to determine if the save game exists.

    C#
    string filename = "savegame.sav";

// Check to see whether the save exists.
if (!container.FileExists(filename))
{
   // If not, dispose of the container and return.
   container.Dispose();
   return;
}

  3. Open a Stream object on the file by using the OpenFile method.

    C#
    // Open the file.
Stream stream = container.OpenFile(filename, FileMode.Open);

  4. Create an XmlSerializer object, and then pass the type of the structure that defines your save game data.

    C#
    XmlSerializer serializer = new XmlSerializer(typeof(SaveGameData));

  5. Call Deserialize, and then pass the Stream object.

    Deserialize returns a copy of the save game structure populated with the data from the save game file. (You will have to cast the return value from Object to your type.)

    C#
    SaveGameData data = (SaveGameData)serializer.Deserialize(stream);

  6. Close the Stream.

    C#
    // Close the file.
stream.Close();

  7. Dispose the StorageContainer.

    C#
    // Dispose the container.
container.Dispose();

Expand image See Also

Concepts

What Is Storage?

Reference

StorageContainer


Getting a StorageDevice Asynchronously

Demonstrates how to call BeginShowSelector and StorageDevice.EndShowSelector to get a StorageDevice object asynchronously.

Complete Sample

The code in the topic shows you the technique for getting a StorageDevice asynchronously. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download StorageDemo_Sample.zip.

Getting a StorageDevice Asynchronously

To get a StorageDevice asynchronously using IsCompleted

  1. In your Game constructor, add a new GamerServicesComponent to your Components collection.

  2. Create a variable to track when a request for a StorageDevice is pending. In this case, declare GameSaveRequested.

    When the player needs to access the StorageDevice for the first time (for example, to save a game), call StorageDevice.BeginShowSelector, specifying which player requested the save.

  3. Check Guide.IsVisible first to ensure the Guide is not already displayed.

    Calling StorageDevice.BeginShowSelector when the Guide is visible results in a GuideAlreadyVisibleException. StorageDevice.BeginShowSelector returns an IAsyncResult interface that is used to determine when the asynchronous request is finished.

  4. Set your tracking variable to indicate a request is pending.

  5. When a request is pending, check IAsyncResult.IsCompleted periodically to determine when the player selected the storage device.

  6. When IsCompleted is true, call StorageDevice.EndShowSelector, passing the IAsyncResult provided by StorageDevice.BeginShowSelector.

    The return value is the selected storage device.

  7. Use the return value of EndShowSelector to ensure that a valid device is chosen.

    If the player declines to select a device, null is returned. If the device was removed, IsConnected is false.

  8. If the StorageDevice is connected, use it to load or save data.

  9. Reset your tracking variable.

    C#
    public Game1()
{
    graphics = new GraphicsDeviceManager(this);
    Content.RootDirectory = "Content";

    this.Components.Add(new GamerServicesComponent(this));
}
IAsyncResult result;
Object stateobj;
bool GameSaveRequested = false;
GamePadState currentState;

protected override void Update(GameTime gameTime)
{
    GamePadState previousState = currentState;
    currentState = GamePad.GetState(PlayerIndex.One);
    // Allows the default game to exit on Xbox 360 and Windows
    if (currentState.Buttons.Back == ButtonState.Pressed)
        this.Exit();

    if ((currentState.Buttons.A == ButtonState.Pressed) &&
        (previousState.Buttons.A == ButtonState.Released))
    {
        // Set the request flag
        if ((!Guide.IsVisible) && (GameSaveRequested == false))
        {
            GameSaveRequested = true;
            result = StorageDevice.BeginShowSelector(
                    PlayerIndex.One, null, null);
        }
    }

    // If a save is pending, save as soon as the
    // storage device is chosen
    if ((GameSaveRequested) && (result.IsCompleted))
    {
        StorageDevice device = StorageDevice.EndShowSelector(result);
        if (device != null && device.IsConnected)
        {
            DoSaveGame(device);
        }
        // Reset the request flag
        GameSaveRequested = false;
    }
    base.Update(gameTime);
}

To get a StorageDevice asynchronously using AsyncCallback

  1. In your Game constructor, add a new GamerServicesComponent to your Components collection.

  2. Create an AsyncCallback object that represents the method to be called when the player chooses a device.

    That function must take an IAsyncResult as a parameter, and return void.

  3. When the player needs to access the StorageDevice for the first time (for example, to save a game), call StorageDevice.BeginShowSelector, specifying which player requested the save, and your AsyncCallback object.

    As an option, you may pass a tracking object to identify the request (or null).

  4. Check Guide.IsVisible first to ensure the guide is not already being displayed.

  5. Call StorageDevice.BeginShowSelector when the guide is visible results in a GuideAlreadyVisibleException.

  6. In your callback method, call StorageDevice.EndShowSelector, passing the same IAsyncResult passed into the callback method.

    The return value is the selected storage device.

  7. Use the return value of EndShowSelector to ensure that a valid device is chosen.

    If the player declines to select a device, null is returned. If the device was removed, IsConnected is false.

  8. If the StorageDevice is connected, use it to load or save data.

    C#
    public Game1()
{
    graphics = new GraphicsDeviceManager(this);
    Content.RootDirectory = "Content";

    this.Components.Add(new GamerServicesComponent(this));
}
IAsyncResult result;
Object stateobj;
bool GameSaveRequested = false;
GamePadState currentState;

protected override void Update(GameTime gameTime)
{
    GamePadState previousState = currentState;
    currentState = GamePad.GetState(PlayerIndex.One);
    // Allows the default game to exit on Xbox 360 and Windows
    if (currentState.Buttons.Back == ButtonState.Pressed)
        this.Exit();

    if ((currentState.Buttons.B == ButtonState.Pressed) &&
        (previousState.Buttons.B == ButtonState.Released))
    {
        if (!Guide.IsVisible)
        {
            // Reset the device
            device = null;
            stateobj = (Object)"GetDevice for Player One";
            StorageDevice.BeginShowSelector(
                    PlayerIndex.One, this.GetDevice, stateobj);
        }
    }
    base.Update(gameTime);
}

StorageDevice device;
void GetDevice(IAsyncResult result)
{
    device = StorageDevice.EndShowSelector(result);
    if (device != null && device.IsConnected)
    {
        DoSaveGame(device);
    }
}

Expand image See Also

Concepts

What Is Storage?
Xbox 360 Programming Considerations

Reference

StorageDevice
StorageDevice.BeginShowSelector
StorageDevice.EndShowSelector
AsyncCallback
IAsyncResult


Adding Xbox LIVE Features to Your Game

Adding Xbox LIVE Features to Your Game

This section contains topics that show how to use the classes and methods in the GamerServices namespace to add Xbox LIVE features to your game.

In This Section

Introduction to Gamer Services
Describes the functionality provided by the XNA Framework GamerServices namespace.
Initializing and Updating Gamer Services
Describes the the use of GamerServicesDispatcher or GamerServicesComponent to initialize and update Gamer Services.
Inviting Players to Join Your Game
Describes how to support game invitations for Xbox LIVE Indie Games.
Getting Gamer Profiles
Demonstrates how to retrieve gamertags and pictures using a technique that also can be applied to retrieve other gamer profile information.
Setting Presence Information
Describes how to configure and set presence information for a player.
Inviting a Group to Join Your Game (Xbox 360)
Describes how to add LIVE Party support to Xbox LIVE Indie Games.
Avatar Support Overview (Xbox 360)
Discusses avatars in XNA Game Studio applications targeting the Xbox 360 console.
Avatar Bones (Xbox 360)
Describes the bones of the avatar.
Rendering and Animating Avatars (Xbox 360)
Demonstrates how to render and animate a gamer's avatar
Simulating Trial Mode for Marketplace Content (Xbox 360, Windows Phone)
Demonstrates how to detect and simulate trial mode to test the display of a Marketplace offer that allows a player to purchase your game.

Expand image See Also

Reference

Microsoft.Xna.Framework.GamerServices Namespace


Introduction to Gamer Services

Introduction to Gamer Services

The GamerServices namespace provides functionality for working with Xbox LIVE, including querying for Xbox LIVE accounts, working with gamer avatars, retrieving player preferences for local accounts, and showing various Xbox LIVE user interface screens programmatically.

Windows Specific Information

Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

  • Initialization of Gamer Services
  • Player Sign In
  • Gamer Avatar
  • Player Profile Information
  • Guide User Interface

Initialization of Gamer Services

Users must explicitly initialize the gamer services subsystem before they can use any gamer services or networking API calls. Most games will use the GamerServicesComponent, a game component that takes care of the process of initializing and pumping the gamer services system. This component automatically will pass through the graphics device and window handle. It calls Update to pump the gamer services pump at regular intervals. To take advantage of this component, most games simply need to add one line to the Game constructor:

C#
Components.Add(new GamerServicesComponent(this));

Initializing the gamer services system can be a slow operation, and it has user-visible consequences. For example, the game may display the "Player Signed In" notification when the gamer services system is initialized. This happens when a local profile is set to sign in automatically, which triggers a system update. Because of this, it is desirable to initialize everything in the game startup code in the constructor if a game is going to use these services.

Programs that do not use the XNA Framework application model or component infrastructure can use GamerServicesDispatcher. In this case, you must also call the GamerServicesDispatcher.Initialize and GamerServicesDispatcher.Update methods directly. Under these conditions, you should initialize the GamerServicesDispatcher once at startup, and call GamerServicesDispatcher.Update at every frame.

The GamerServicesDispatcher.Update method enables the XNA Framework to raise events for notifications such as sign-in status changes and game invites when it is safe to raise the events.

Player Sign In

For standard game clients with a user interface, the Guide user interface automatically displays the appropriate user interface when a player presses either the HOME key on the keyboard or the Guide button on the Xbox 360 Controller, allowing players to sign in. Before a player signs in, you also can choose to manually display the sign-in user interface by using the Guide.ShowSignIn function.

When a SignedInGamer signs in, the SignedInGamer.SignedIn event occurs. You can get the list of players signed in at any time using the static property Gamer.SignedInGamers.

Gamer Avatar

Avatars are three-dimensional animated characters that represent the gamer in a versatile, personalized, engaging manner. Gamer services implements support for displaying and animating a gamer's avatar using standard effects and animations. In addition, access to an avatar's metadata (such as hierarchy information and textures) allows developers to implement custom rendering and animating of a gamer's avatar.

Note
Avatar support is available only for Xbox 360 applications.

Avatars are used in a variety of ways on the Xbox 360 console: as a gamer picture and integrated into the friends list display, the Xbox Guide, and the dashboard. Also, game titles can use avatars in-game to represent various game players and to provide unique spectators, cut scene actors, crowd members, or game characters.

For more information about implementing avatar support in your application, see Avatars.

Player Profile Information

The player profile information accessible BY using the Gamer.GetProfile method returns information such as the gamer picture, motto, and gamer zone. Specifically, the gamer profile provides the following information about a gamer:

  • Gamerscore
  • Gamer zone
  • Gamer picture
  • Region
  • Motto
  • Reputation
  • Number of achievements
  • Number of titles played

You may use SignedInGamer.GameDefaults to retrieve a local gamer's preferred settings, such as:

  • Controller sensitivity
  • Game difficulty
  • Primary and secondary colors
  • Action movement preferences such as auto-aim, auto-center, and y-axis inversion
  • Preferred racing camera angle, accelerator, brake, and transmission

Using SignedInGamer.Privileges, you can see if the player is allowed to:

  • Communicate using voice, text, or messaging.
  • Join online multiplayer sessions.
  • View profiles.

You can also view if a gamer is LIVE-enabled or a guest.

Privileges are enforced by the framework. A player can never create an online session if his or her multiplayer privilege is not enabled. We provide programmatic access to these settings so that games may check to see if anything is forbidden. In such a case, the relevant menu options are dimmed (meaning unavailable)—this keeps the user from selecting a forbidden option and getting an exception or error when trying to call the forbidden method.

Guide User Interface

The XNA Framework exposes a property, Guide.IsVisible, which checks to see if the Guide user interface is active. The Guide runs independently alongside games. The player can view the Guide at any time by pressing the HOME key on the keyboard or the Guide button on the controller.

Many of the Guide calls are blocking. The XNA Framework uses the standard .NET async pattern to expose asynchronous versions of all the Guide methods. Blocking versions of the Guide methods automatically pump the graphics device while the UI is active. They call GraphicsDevice.Present at regular intervals with an empty (black) back buffer. Games should have the asynchronous versions of the methods if it is desirable to continue rendering behind the Guide. The existing storage device UI has been changed to match the new design.


Initializing and Updating Gamer Services

Initializing and Updating Gamer Services

Automatically Updating the Gamer Services Dispatcher

The XNA Framework provides a GamerServicesComponent. This is a game component that automatically takes care of initializing and updating the gamer services dispatcher. To make use of this component, XNA Framework games need to add only one line of code to the Game constructor.

To automatically update the gamer services dispatcher

  • Add this line of code to the Game constructor:

    C#
    Components.Add(new GamerServicesComponent(this));

Manually Updating the Gamer Services System

In some cases, a program may not use the XNA Framework application model or component infrastructure. For this application, it is possible to call the GamerServicesDispatcher directly.

To manually initialize and update the gamer services system

  1. In the startup code for the application, call GamerServicesDispatcher.Initialize once to initialize the gamer services subsystem.

    C#
    protected override void Initialize()
{
    GamerServicesDispatcher.WindowHandle = Window.Handle;

    GamerServicesDispatcher.Initialize(Services);

    base.Initialize();
}

  2. Call GamerServicesDispatcher.Update once every frame to update the gamer services system.

    C#
    protected override void Update(GameTime gameTime)
{
    GamerServicesDispatcher.Update();
    base.Update(gameTime);
}

Expand image See Also

Concepts

Introduction to Gamer Services


Inviting Players to Join Your Game

Inviting Players to Join Your Game

The XNA Framework player match multiplayer network session type enables players to invite friends to play an online game on Xbox LIVE. Games of this type can host online players when the session is joinable, when there are open slots, and when game invitations are enabled.

Gamers can send game invitations from the Xbox LIVE friends list or by using the Guide.ShowGameInvite method. Game invitations can also be sent to members of a gamer's LIVE Party by using LocalNetworkGamer.SendPartyInvites. For more information about LIVE Parties, see Inviting a Group to Join Your Game (Xbox 360).

The NetworkSession.InviteAccepted event receives the notification of an accepted game invitation. For this reason, titles must register for the InviteAccepted event in order to send game invitations.

Gamers can accept game invitations from the message center or from the friends list. A gamer can also ask to join an existing game session without an invitation either from the game lobby or from the friends list by selecting Join Session In Progress. Either action causes an InviteAccepted event to be sent to the title.

Important
If your title does not register for the InviteAccepted event, its sessions always show as nonjoinable.

To register for the InviteAccepted event

  • Register an event handler for the NetworkSession.InviteAccepted event when your game starts.

    You can use the game constructor or the Game.Initialize method to register this event.

    C#
    NetworkSession.InviteAccepted +=
    new EventHandler<InviteAcceptedEventArgs>(
        NetworkSession_InviteAccepted);

Once the InviteAccepted event is registered, the registered event handler is called when the event is received. This happens either when a game invitation is accepted or when a player sends a request to join a session in progress.

To respond to the InviteAccepted event

  • In the handler registered for InviteAccepted, check if the invitation is for a preexisting local session by examining IsCurrentSession. If it is not for the current local session, call NetworkSession.JoinInvited to allow the gamer to join the remote session. If another local gamer has already joined the session, call NetworkSession.AddLocalGamer to add additional gamers to the session.

    C#
    void NetworkSession_InviteAccepted(object sender,
    InviteAcceptedEventArgs e)
{
    // if this is from a session that other local gamers are already in
    if (e.IsCurrentSession)
    {
        // and that sessions is still running...
        if (session != null)
            session.AddLocalGamer(e.Gamer); // add the additional gamer
    }
    else // else the invite is to a different session
    {
        if (session != null)
        {
            session.Dispose();
            session = null;
        }
        session = NetworkSession.JoinInvited(maxLocalGamers);
    }
}
Note
If an invitation is pending because the game started in response to a cross-title invite, the method to handle the game invitation event is called as soon as you subscribe to the event. Because of this, it is important to initialize everything upon which the event handler depends before it is registered.

When a game is able to host other gamers, the Send Game Invite option button automatically appears in the Xbox LIVE friends list. Because a gamer can send invitations at any point in the game by pressing the Guide button and then navigating to the friends list, typically you do not need to write additional code to display the game invitation screen.

There may be situations, however, when you would like to bring up the game invitation user interface (UI) yourself as a result of player actions in the game. In this case, you can use the Guide.ShowGameInvite method in your game's code to bring up the UI directly.

To display the game invitation user interface

  • Call Guide.ShowGameInvite to show the game invitation UI.

    You can do this from any point in your code, but be sure that the title already is registered to receive the InviteAccepted event as described above.

    C#
    if (IsButtonPressed(GamePadButton.Y) && !Guide.IsVisible)
{
    Guide.ShowGameInvite(PlayerIndex.One, null);
}

Invitations to Uninstalled Games

When a player accepts an invitation for an Xbox LIVE Indie Game that is not installed on his or her console, the invited player is taken to the game offer. The offer enables the invited player to download the game and accept the invitation to start the game.

For Creators Club games still waiting to pass peer review and for which no game offer exists, a game invitation is still sent over the Xbox LIVE service to the other player. If the game is not installed, the invited player receives a message indicating the game is available from the game creator.

Expand image See Also

Tasks

Inviting a Group to Join Your Game (Xbox 360)

Reference

NetworkSession.AllowJoinInProgress Property
Guide.ShowGameInvite Method
NetworkSession.InviteAccepted Event
NetworkSession.JoinInvited Method
NetworkSession.BeginJoinInvited Method
NetworkSession.EndJoinInvited Method


Getting Gamer Profiles

Getting Gamer Profiles

Demonstrates how to retrieve gamertags and pictures using a technique that also can be applied to retrieve other gamer profile information.

Retrieving Gamertags and Gamer Pictures

To retrieve a player's gamertag and profile picture

  • Use Gamer.GetProfile to retrieve the profile information for any player in the game.

    C#
    foreach (NetworkGamer gamer in session.AllGamers)
{
    string text = gamer.Gamertag;
    GamerProfile gamerProfile = gamer.GetProfile();
    Texture2D picture = Texture2D.FromStream(this.GraphicsDevice, gamerProfile.GetGamerPicture());
}
Note

This method completes quickly when you use it with a locally signed-in profile. It can, however, take some time if you call it on a remote gamer instance. For a remote case, you might use the non-blocking alternative Gamer.BeginGetProfile.

The GamerProfile returned by Gamer.GetProfile also contains such information as the motto, gamerscore, and more.

If the gamer is a SignedInGamer, you can retrieve the local player's preferred settings for gameplay by using the SignedInGamer.GameDefaults property. You also can retrieve the local player's privileges by using SignedInGamer.Privileges. Unlike Gamer.GetProfile, which can be slow for remote players, the properties of a SignedInGamer return instantly.


Setting Presence Information

Setting Presence Information

Presence information for a player is set by using the SignedInGamer.Presence property, which is a reference to a GamerPresence object. GamerPresence has two properties that are used to set presence information:

  • PresenceMode, which is set to one of the values of GamerPresenceMode.

    GamerPresenceMode contains values that represent strings describing what the player is doing in your game. For a description of each string, see the GamerPresenceMode reference topic.

  • PresenceValue, which is an integer that provides a numeric value used with presence modes such as Stage, Level, and Score.

To set presence information for a player

  • Set SignedInGamer.Presence.PresenceMode with one of the values of GamerPresenceMode.

    C#
    foreach (SignedInGamer signedInGamer in
    SignedInGamer.SignedInGamers)
{
    signedInGamer.Presence.PresenceMode =
        GamerPresenceMode.InCombat;
}

    As described previously, some values also require SignedInGamer.Presence.PresenceValue to be set.

Note

A game title is not displayed in a player's presence information on Xbox LIVE Service until that game passes peer review. Once a game passes peer review, the presence information for a player shows three things: a confirmation the player is playing an Xbox LIVE Indie Game, the game's title, and the presence information set by SignedInGamer.Presence.

For example:

        Xbox LIVE Indie Game
        My Game Title
        Fighting the Boss

While a game is in development, but before it passes peer review, presence information indicates the developer is using XNA Creators Club as shown:

        XNA Creators Club
        creators.xna.com
        Fighting the Boss

Expand image See Also

Reference

GamerPresence Class
SignedInGamer.Presence Property
GamerPresenceMode


Inviting a Group to Join Your Game (Xbox 360)

Inviting a Group to Join Your Game (Xbox 360)
See Also
CollapseAll image

LIVE Party gives groups of gamers more ways to connect, chat, and play together. The XNA Framework supports LIVE Party through the Guide, LocalNetworkGamer, and SignedInGamer classes. This topic shows you how to use these classes to add LIVE Party support to your game title.

Note
Currently, only Xbox 360 supports LIVE Party. Other platforms do not support LIVE Party functionality, even though the platform may support LIVE otherwise.

Showing the LIVE Party Screens

The Guide provides two screens related to LIVE Party: the Party screen and Party Sessions screen.

The Party screen serves as the main interface to LIVE Party functionality for a given player. It allows a player to do the following:

  • View all members in the current party.
  • Manage the party (if the player is the party organizer).
  • Send party invitations to other party members.

The Party Sessions screen allows a player to see all party members who are in a joinable session in the same game. It allows the player to join any of these sessions.

To show the Guide's LIVE Party screen

  • Call Guide.ShowParty with the PlayerIndex of the player for which the Party Sessions screen will be shown.
C#
    // Show the party screen for the player on the first controller.
    Guide.ShowParty(PlayerIndex.One);

To show the Guide's LIVE Party Sessions screen

  • Call Guide.ShowPartySessions with the PlayerIndex of the player for which the Party Sessions screen will be shown.
C#
    // Show the party sessions screen for the player on the first controller.
    Guide.ShowPartySessions(PlayerIndex.One);

Sending a Game Invitation to Party Members

For party members not yet in the game, the player can use the LocalNetworkGamer class to send them an invitation to the current game session.

To send a game invitation to all party members not in the current game session

  • Call LocalNetworkGamer.SendPartyInvites for the gamer for whom invitations will be sent.
C#
    // Send invitations to all members of each local network gamer's LIVE party.
    foreach(LocalNetworkGamer gamer in NetworkSession.LocalGamers)
    {
        gamer.SendPartyInvites();
    }
Note
When a gamer responds to a game invitation, the player who sent the invitation gets the NetworkSession.InviteAccepted event. For more information, see Inviting Players to Join Your Game

Retrieving the Number of Party Members for a Gamer

You can use the gamer's SignedInGamer class to determine the number of party members in a gamer party.

To get the number of party members for a player.

  • Read the value of SignedInGamer.PartySize.

    Note
    PartySize is read-only. It cannot be used to set the party size.
C#
    // get the party size for the first signed-in gamer.
    if(Gamer.SignedInGamers(0).PartySize > 0)
    {
        // The player is a member of a LIVE party!
        ...
    }

Expand image See Also

Tasks

Inviting Players to Join Your Game

Reference

Guide.ShowParty Method
Guide.ShowPartySessions Method
SignedInGamer.PartySize Property
LocalNetworkGamer.SendPartyInvites Method


Avatar Support Overview (Xbox 360)

Avatar Support Overview (Xbox 360)
See Also
CollapseAll image

Discusses avatars in XNA Game Studio applications targeting the Xbox 360 console. Avatar support includes retrieving existing gamer avatars or creating new ones, and rendering and animating avatars.

Overview

Avatars provide other ways of placing the player in your game. With avatars, you can render and animate the avatar within the game, or you can generate one or more random avatars to use as a crowd backdrop or as additional characters in the game.

You must meet the following requirements before using avatars in your game:

  • The game targets the Xbox 360 platform.

    Note
    Code related to avatars can be present in a Windows game, but, by design, all methods return default values and nothing renders to the screen.
  • Gamer services must be initiated. For more information, see the Initialization of Gamer Services section in Introduction to Gamer Services.

The avatar of a signed-in gamer is retreived by the BeginGetFromGamer and EndGetFromGamer methods. Create one or more random avatars using the CreateRandom method. This method creates an AvatarDescription object, initialized with random data. You then can render this avatar with a call to Draw.

XNA Game Studio provides avatar rendering with the AvatarRenderer class, and animation with the AvatarAnimation class. Use IAvatarAnimation if you want to integrate custom avatar animations with standard animations. The renderer uses basic lighting and shading effects. You can invoke the renderer with a single call to AvatarRenderer.Draw. This method also uses an animation to indicate the avatar currently is loading. This is used automatically by the renderer until loading is complete.

Once the avatar is displayed, idle animations cycle randomly unless you specify a specific animation from the standard list. For a complete list, see AvatarAnimationPreset. The AvatarRenderer class contains properties related to the lighting and rendering of the avatar. These properties include, among others, color and direction of directional light, and transformation matrices. For a full listing of these properties, see AvatarRenderer Properties.

Expand image See Also

Tasks

Rendering and Animating Avatars (Xbox 360)

Reference

AvatarDescription
AvatarExpression
AvatarRenderer
AvatarAnimation
IAvatarAnimation


Avatar Bones (Xbox 360)

Avatar Bones (Xbox 360)
See Also
CollapseAll image

Describes the bones of the avatar.

Avatar Bones

Animating the avatar requires moving the bones. Avatars have basic bones in the head, torso, arms, and legs, as well as some special additional bones. See AvatarBone Enumeration for the friendly names of all the bones.

Note
Code related to avatars can be present in a Windows game, but all methods will return default values and nothing will render to the screen. This is by design.

The Full Skeleton

The images show the full skeleton. Avatar bones have a hierarchical relationship, which means all bones, except for the Root bone, have a parent. The Root bone is the origin of all bones, and is located at the base of the avatar and between the feet. As illustrated in Figure 1 and Figure 2, the dot at the base of the avatar and between the feet indicates the Root bone.

Figure 1. Avatar and skeleton

Figure 2. Skeleton only

Special and Prop Bones

There are two bones in the space below the hand on both sides of the avatar. The special bone is closest to the hand, and the prop bone is farthest from the hand. The special bones are SpecialRight and SpecialLeft. The prop bones are PropRight and PropLeft. The following images show SpecialRight and PropRight on the right side of the avatar.

Figure 3. Avatar special bones and prop bones

Figure 4. Skeleton only, special bones and prop bones

Avatar Hand

The avatar hand has many tiny bones for showing complex movements. In Figure 5 and Figure 6 the bones of the fingers are shown. Each finger has three bones. For example, the index finger (next to the thumb) contains these bones: FingerIndexLeft, FingerIndex2Left, and FingerIndex3Left. For a full list of the bones of the hand see AvatarBone Enumeration.

Figure 5. Avatar hand bones

Figure 6. Avatar hand, skeleton only

Avatar Lower-Body Bones

Notice the angle of the AnkleLeft and AnkleRight bones. All the toes move together in either ToeRight or ToeLeft.

The spot between the feet indicates the Root bone.

Figure 7. Avatar lower-body bones

Figure 8. Avatar lower-body bones, skeleton only

Avatar Back Bones

The back has two bones: BackUpper and BackLower.

Figure 9. Avatar back bones

Expand image See Also

Tasks

Rendering and Animating Avatars (Xbox 360)

Reference

AvatarBone
AvatarRenderer
AvatarAnimation
IAvatarAnimation


Rendering and Animating Avatars (Xbox 360)

Rendering and Animating Avatars (Xbox 360)
See Also
CollapseAll image

Note
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and Xbox 360. By design, all avatar-related methods return default values, and rendering methods do not draw anything on the screen.

Complete Sample

The code in this topic shows you the technique for rendering and animating a gamer's avatar. Use IAvatarAnimation if you want to integrate custom avatar animations with standard animations. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download AnimatedAvatar_Sample.zip

To render a random model with a standard animation

  1. Initialize the gamer services dispatcher for your application.

    C#
    Components.Add(new GamerServicesComponent(this));

    For more information, see Initializing and Updating Gamer Services.

  2. Declare three new members in your main game class to store the various objects needed to render and animate the random avatar.

    C#
    AvatarDescription avatarDesc;
AvatarRenderer avatarRenderer;
AvatarAnimation avatarAnimation;

  3. Create and initialize the avatar data to a random set with a call to CreateRandom. Use the Initialize method of your Game class after the existing call to Initialize.

    C#
    avatarDesc = AvatarDescription.CreateRandom();

  4. Create a new avatar renderer with the standard loading effect for the recently created random avatar. Use the Initialize method of your Game class.

    C#
    avatarRenderer = new AvatarRenderer(avatarDesc, true);

  5. Create a new AvatarAnimation object, and load any standard animation from the list supported by AvatarAnimationPreset. Use the Initialize method of your Game class.

    Because the avatar gender is unknown at the time of rendering, for this example use the gender-neutral clap animation.

    Note
    Gender-specific animations work with any avatar, but each is designed with the proportions of that gender in mind. This prevents the avatar model from clipping through itself during the animation cycle.
    C#
    avatarAnimation = new AvatarAnimation(AvatarAnimationPreset.Clap);

  6. Initialize the avatar's transformational matrices (world, projection, and view), using the World, Projection, and View properties of the avatar object. Use the Initialize method of your Game class.

    C#
    avatarRenderer.World =
    Matrix.CreateRotationY(MathHelper.ToRadians(180.0f));
avatarRenderer.Projection =
    Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f),
    GraphicsDevice.Viewport.AspectRatio, .01f, 200.0f);
avatarRenderer.View =
    Matrix.CreateLookAt(new Vector3(0, 1, 3), new Vector3(0, 1, 0),
    Vector3.Up);
    Note
    The values used in this example are for demonstration purposes only. Although they provide a good location and orientation for the camera (in terms of this sample), your application will require different values, which are determined by your application's needs.

  7. Make any necessary modifications to the current values of the avatar's ambient light and directional light properties by using the similarly-named properties of the avatar object (for example, AvatarRenderer.AmbientLightColor).

  8. Update the current animation of the avatar.

    The recommended place for this code is within the Update method of your application.

    C#
    if (avatarRenderer.IsLoaded)
{
    avatarAnimation.Update(gameTime.ElapsedGameTime, true);
}

  9. In the Draw method of your game, render the avatar by calling Draw.

    C#
    avatarRenderer.Draw(avatarAnimation.BoneTransforms,
    avatarAnimation.Expression);

    When you render the avatar, keep in mind that various parts (for example, glasses) of the avatar model can be transparent. Transparent parts are rendered with the depth buffer disabled. For this reason, first render all opaque objects (except the avatar) in the scene, and then render the avatar and any other transparent objects sorted by depth (from back to front).

    In addition, avatar rendering ignores the current state of the FillMode property. It is always treated as if FillMode.Solid is the current value.

Expand image See Also

Avatar Support Overview (Xbox 360)
AvatarAnimation Class
IAvatarAnimation Interface
AvatarDescription Class
AvatarRenderer Class


Simulating Trial Mode for Marketplace Content (Xbox 360, Windows Phone)

Simulating Trial Mode for Marketplace Content (Xbox 360, Windows Phone)
CollapseAll image

Demonstrates how to detect and simulate trial mode to test the display of a Marketplace offer that allows a player to purchase your game.

Note

It is unnecessary to write special code to ensure that a Marketplace offer is available to players of Xbox LIVE Indie Games. By default, released trial mode games present a Marketplace offer to the player when the gameplay time limit expires. You might, however, want to write special code in your game to present a Marketplace offer, or to control other areas of gameplay when a game is in trial mode.

To simulate trial mode

The XNA Framework provides a property, Guide.SimulateTrialMode, that allows developers to test the behaviors of a game under trial mode conditions. When games are in trial mode, a developer might choose to limit the capabilities of the game.

  • Set Guide.SimulateTrialMode to true to test presentation of a Marketplace offer if the game is in trial mode. This property usually is set in the game constructor, and must be set before the first call to Game.Update.
C#
Guide.SimulateTrialMode = true;

To detect when a game is in trial mode

  1. Check if Guide.IsTrialMode is true.

  2. If this condition is met, call Guide.ShowMarketplace to present an offer to purchase the full version of the game.

C#
if (Guide.IsTrialMode)
{
    Guide.ShowMarketplace(signedInGamer.PlayerIndex);
}


Adding Xbox LIVE Multiplayer Support on Xbox 360 and Windows

Adding Xbox LIVE Multiplayer Support on Xbox 360 and Windows

This section contains introductory articles describing how to create and join multiplayer game sessions, to manage game state across clients, and to interact with the friends list on Xbox 360 and Windows.

Overviews

Prerequisites for Developing Xbox LIVE Multiplayer Games on Xbox 360
Introduces the key prerequisites for creating a networked XNA Framework game on Xbox 360.
Finding and Joining a Network Session
Describes how to find and join a network session.
Joining an In-Progress Game
Describes how to enable the AllowJoinInProgress property to make an in-progress game available to peers searching for available sessions.
Sending Network Data
Describes the options available for sending data to all clients or to a specific player.
Receiving Network Data
Describes how local players on a gaming machine receive data from the other players in a networked game.
Creating a Network Session
Describes the process of creating a new network session.
Joining and Leaving a Game
Manage data associated with a player by subscribing to events that occur when players join or leave a game.
Managing Player Movement Between Lobby and Gameplay Modes
Describes properties and events associated with a multiplayer session that allow a game to move between lobby and gameplay modes. It identifies the game's current mode.
Network Session Management
Defines the network session management capabilities in the XNA Framework, which allow for matchmaking access to profile data on all the gamers in a potential game.
Reliable Packet Delivery
Provides an overview of the reliable UDP protocol supported by the XNA Framework, and the packet delivery options that may be chosen.
Network Topologies and Host Migration
Discusses the relationship between session hosts and peers, and the actual network topology used to route gameplay.
Latency Simulation and Bandwidth Usage
Describes the packet loss simulation capabilities available to XNA Framework games.
Voice Support
Introduces the voice support options available in the XNA Framework.

Expand image See Also

Concepts

Introduction to Gamer Services
Networking Content Catalog at XNA Creators Club Online

Tasks

Setting up your Firewall
Setting Presence Information
Inviting Players to Join Your Game
Initializing and Updating Gamer Services
Getting Gamer Profiles
Simulating Trial Mode for Marketplace Content (Xbox 360, Windows Phone)

Reference

Microsoft.Xna.Framework.Net Namespace


Prerequisites for Developing Xbox LIVE Multiplayer Games on Xbox 360

Prerequisites for Developing Xbox LIVE Multiplayer Games on Xbox 360
See Also
CollapseAll image

Windows Specific Information

Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

Dependency on Gamer Services

XNA Framework games must explicitly initialize the gamer services system before networking methods are called. Gamer services allows your game to receive notifications such as sign-in status changes and game invitations and other messages from Xbox LIVE, and it gives your game access to the Guide. The Guide provides a user interface that allows players to sign in to Xbox LIVE, to view messages or game invitations, and to use Xbox LIVE user interface elements such as the on-screen keyboard during a game.

Most games use GamerServicesComponent, a game component that wraps the GamerServicesDispatcher object and takes care of sending and receiving messages from Xbox LIVE. This component also passes in the graphics device and window handle to allow rendering of the Guide, and it calls GamerServicesDispatcher.Update at regular intervals. To use this component, most games only need to add one line to the Game constructor:

C#
Components.Add(new GamerServicesComponent(this));

For more information about Gamer Services, see Introduction to Gamer Services.

XNA Creators Club and Xbox LIVE Membership Requirements

There are two types of online multiplayer games available when you create a networked game with XNA Game Studio: system link game sessions and LIVE sessions. These two forms of online multiplayer gaming describe if the multiplayer gaming session is on the local area network (system link games), or if the gaming session is advertised and found through the LIVE Service. With system link games, you can search the local area network to find the gaming sessions. With LIVE sessions, you can use the LIVE Service to find available game sessions. Use the searchProperties argument of NetworkSession.Find to specify the parameters used to search for an available game session—a game session that uses either system link or the LIVE service.

Developing and testing a networked game requires at least two machines, but you only need one Xbox 360 console and one Creators Club membership to test network code for the Xbox 360. This is because the XNA Framework supports cross-platform system links so developers can run one instance of a game on an Xbox 360, and a second on a Windows-based computer. This functionality helps creators debug their titles without having to purchase a second console. It is also possible for more than one Windows-based development computer to connect several machines in a system link session without any memberships required.

Memberships are required for a player on a Windows-based computer and an Xbox 360 console in a network session, depending on the session type that has been created.

 | Xbox 360 console | Windows-based development computer | Windows Phone
Run an XNA Framework Game | LIVE Silver membership + Premium XNA Creators Club membership | No memberships required | No memberships required
Use System Link for Local Area Network gameplay | LIVE Silver membership + Premium XNA Creators Club membership | No memberships required | No memberships required
Sign in to Xbox LIVE and Games for Windows - LIVE Servers | LIVE Silver membership + Premium XNA Creators Club membership | LIVE Silver membership + Premium XNA Creators Club membership | Not available on Windows Phone
Use LIVE to connect to other machines over the Internet while the game is in development | LIVE Gold membership + Premium XNA Creators Club membership | LIVE Silver membership + Premium XNA Creators Club membership | Not available on Windows Phone
Caution
XNA Framework components that interact with Games for Windows - LIVE require an XNA Creators Club membership. If for any reason a LIVE profile without a Creators Club membership is set to auto sign in to a Windows-based computer, the game will be unable to connect to the LIVE Service. Furthermore, the XNA Framework gamer services components, including the Guide, will be unavailable. To disable auto sign in for a LIVE profile on a Windows-based computer, disconnect from the network, launch an XNA Framework game, and then open the Guide.

Hardware Requirements

It is not possible to run multiple simultaneous instances of a networked game on a single development computer.

When you launch to multiple machines for network testing, we recommend that you load multiple copies of your solution into separate Visual Studio instances, one per machine.

For a system link game, you can use any one of the following hardware configurations to test a networked game:

  • One development computer and one Xbox 360 (running one instance of the game on the development computer and one on the Xbox 360). The creator needs one Xbox LIVE Silver and one Creators Club membership to run code on the Xbox 360.
  • One development computer and one client computer (running one instance of the game on each computer). Creators cannot run two networked XNA Framework games at the same time on the same computer. Creators need a second machine to run a second game instance for testing purposes. No Xbox LIVE memberships or Creators Club memberships are required for this scenario.
  • One development computer and two Xbox 360 consoles (running one instance of the game on each Xbox 360). Here a creator deploys and debugs the game on two Xbox 360s. The creator needs at least two Xbox LIVE Silver memberships and two Creators Club memberships (one pair for each Xbox 360) for this scenario.

If you want to use Xbox LIVE to connect to gaming machines over the Internet as opposed to using system link to connect gaming machines over a local subnet, you can use any one of the following hardware configurations:

  • One development computer and one Xbox 360 console (running one instance of the game on the development computer and one on the Xbox 360). The creator needs one Xbox LIVE Gold membership and one Xbox LIVE Silver membership and two Creators Club memberships (one pair for each machine) for this scenario.

  • One development computer and one client computer (running one instance of the game on each computer). The creator needs two Xbox LIVE Silver memberships and two Creators Club memberships (one pair for each machine).

  • One development computer and two Xbox 360 consoles (running one instance of the game on each Xbox 360 console). The creator needs two Xbox LIVE Gold memberships and two Creators Club memberships (one set for each console).

Expand image See Also

Setting up your Firewall


Finding and Joining a Network Session

Finding and Joining a Network Session

Describes how to find and join a network session.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample.

The NetworkSessionProperties collection used to create a session with specific properties can also be used to search for sessions with particular properties. Because these values are integers, we will create a set of enumerations in this example to describe them and their placement in NetworkSessionProperties collection.

Note
Setting session properties to use as search parameters is an optional step. You may also pass in an empty NetworkSessionProperties to NetworkSession.Find or NetworkSession.BeginFind to view all available sessions, regardless of property settings.
C#
enum SessionProperty{ GameMode, SkillLevel, ScoreToWin }

enum GameMode{ Practice, Timed, CaptureTheFlag }

enum SkillLevel{ Beginner, Intermediate, Advanced }

Joining a Network Session

To set search parameters

  1. Create a NetworkSessionProperties collection.

  2. Set the values to the desired search parameters.

    C#
    NetworkSessionProperties searchProperties =
    new NetworkSessionProperties();
searchProperties[(int)SessionProperty.GameMode] =
    (int)GameMode.Practice;
searchProperties[(int)SessionProperty.SkillLevel] =
    (int)SkillLevel.Beginner;

To find an available network session

  1. Create an AvailableNetworkSessionCollection to hold the search results.

    C#
    AvailableNetworkSessionCollection availableSessions;

  2. Use NetworkSession.Find to retrieve a list of available sessions.

  3. Specify the type of session in which you are interested, the number of local players that wish to join, and any session properties that should be matched when searching.

    C#
    int maximumLocalPlayers = 1;
availableSessions = NetworkSession.Find(
    NetworkSessionType.SystemLink, maximumLocalPlayers,
    searchProperties);

    The searchProperties argument is optional. You may pass in null to match any available session, regardless of the session's property settings.

    Note
    This search also may be performed asynchronously using NetworkSession.BeginFind and NetworkSession.EndFind.

    Once you have a list of available sessions, you can examine each session to determine which one to join. In this example, we print some information about an available session for the player to examine.

    C#
    int sessionIndex = 0;
AvailableNetworkSession availableSession =
    availableSessions[sessionIndex];

string HostGamerTag = availableSession.HostGamertag;
int GamersInSession = availableSession.CurrentGamerCount;
int OpenPrivateGamerSlots =
    availableSession.OpenPrivateGamerSlots;
int OpenPublicGamerSlots =
    availableSession.OpenPublicGamerSlots;
string sessionInformation =
    "Session available from gamertag " + HostGamerTag +
    "\n" + GamersInSession +
    " players already in this session. \n" +
    +OpenPrivateGamerSlots +
    " open private player slots available. \n" +
    +OpenPublicGamerSlots + " public player slots available.";

    spriteBatch.DrawString(spriteFont, sessionInformation,
        new Vector2(100, y), color);

To join an available multiplayer session

  1. Create a NetworkSession.

    C#
    NetworkSession session;

  2. Join the AvailableNetworkSession using NetworkSession.Join.

    C#
    session = NetworkSession.Join(
    availableSessions[selectedSessionIndex]);

  3. After joining a NetworkSession, subscribe to any session events that may interest the peer.

    C#
    session.GamerJoined +=
    new EventHandler<GamerJoinedEventArgs>(session_GamerJoined);
session.GamerLeft +=
    new EventHandler<GamerLeftEventArgs>(session_GamerLeft);
session.GameStarted +=
    new EventHandler<GameStartedEventArgs>(session_GameStarted);
session.GameEnded +=
    new EventHandler<GameEndedEventArgs>(session_GameEnded);
session.SessionEnded +=
    new EventHandler<NetworkSessionEndedEventArgs>(
        session_SessionEnded);

Expand image See Also

Concepts

Network Session Management

Tasks

Creating a Network Session


Joining an In-Progress Game

Describes how to enable the AllowJoinInProgress property to make an in-progress game available to peers searching for available sessions.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample.

Joining an In-Progress Game

To join an in-progress game

  1. After creating a NetworkSession, set AllowJoinInProgress to true.

    C#
    int maximumGamers = 8;
int privateGamerSlots = 2;
int maximumLocalPlayers = 1;

// Create the session
session = NetworkSession.Create(
    NetworkSessionType.SystemLink,
    maximumLocalPlayers, maximumGamers, privateGamerSlots,
    sessionProperties );

session.AllowJoinInProgress = true;

    In the NetworkSession.GamerJoined event handler, the gamer may be a player who joined an in-progress game.

  2. Associate any data necessary to enable a gamer to join while the game is in-progress.

    C#
    void session_GamerJoined(object sender, GamerJoinedEventArgs e)
{
    // Associate a tank object with this gamer.
    e.Gamer.Tag =
        new Tank(Content, GraphicsDevice.PresentationParameters);

}
Note
Network sessions of type NetworkSessionType.Ranked cannot be made join-in-progress because of the competitive nature of ranked sessions.

Expand image See Also

Concepts

Network Session Management

Tasks

Joining and Leaving a Game
Finding and Joining a Network Session


Sending Network Data

Sending Network Data

Describes the options available for sending data to all clients or to a specific player.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample.

Sending Data

To send data to all peers

  1. Create a PacketWriter to use in writing the data.

    The PacketWriter is a helper for efficiently formatting outgoing network packets. A multiplayer game can create a single PacketWriter instance at startup, and can reuse it any time players want to send a packet.

    C#
    PacketWriter packetWriter = new PacketWriter();

    Each LocalNetworkGamer playing on the same game machine might send data. At this point, players can loop through the LocalGamers collection.

  2. Call the various overloads of the PacketWriter.Write method to store data into the writer, and then pass the PacketWriter to SendData.

    C#
    foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
    // Get the tank associated with this player.
    Tank myTank = gamer.Tag as Tank;
    // Write the data.
    packetWriter.Write(myTank.Position);
    packetWriter.Write(myTank.TankRotation);
    packetWriter.Write(myTank.TurretRotation);
    packetWriter.Write(myTank.IsFiring);
    packetWriter.Write(myTank.Health);

    // Send it to everyone.
    gamer.SendData(packetWriter, SendDataOptions.None);

}
    Note

    Sending a packet automatically clears the PacketWriter. The sent packet can be reused to write different data for another packet. Although it is not used in this example, the PacketWriter supports offsets through the Position property.

    In the call to SendData, be careful to specify a SendDataOptions value for options that is appropriate for the type of data being sent. Not all game data needs to be sent reliably. Sending excessive data using SendDataOptions.ReliableInOrder can cause the client to lag as it waits for data to be delivered in order.

    Data can be sent to a specific player by identifying the player in a call to SendData.

Expand image See Also

Tasks

Setting up your Firewall


Receiving Network Data

Receiving Network Data

Describes how local players on a gaming machine receive data from the other players in a networked game.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample.

Receiving Data

To receive data

  1. Create a PacketReader to assist in reading incoming network data.

    A PacketReader is a helper for efficiently reading incoming network packets. A multiplayer game can create a single PacketReader instance at startup and can reuse it any time the players want to read a packet.

    C#
    PacketReader packetReader = new PacketReader();

    Each LocalNetworkGamer playing on the same game machine might receive data. At this point, players can loop through the LocalGamers collection.

  2. Pass the PacketReader to ReceiveData, and then use the various PacketReader.Read methods to extract data from the reader.

    C#
    foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
    // Keep reading while packets are available.
    while (gamer.IsDataAvailable)
    {
        NetworkGamer sender;

        // Read a single packet.
        gamer.ReceiveData(packetReader, out sender);

        if (!sender.IsLocal)
        {
            // Get the tank associated with this packet.
            Tank remoteTank = sender.Tag as Tank;

            // Read the data and apply it to the tank.
            remoteTank.Position = packetReader.ReadVector2();
            remoteTank.TankRotation = packetReader.ReadSingle();
            remoteTank.TurretRotation = packetReader.ReadSingle();
            remoteTank.IsFiring = packetReader.ReadBoolean();
            remoteTank.Health = packetReader.ReadInt32();
        }
    }
}

Expand image See Also

Tasks

Setting up your Firewall


Creating a Network Session

Creating a Network Session

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample.

A network session is made up of players in a game and an optional set of attributes to aid in describing the type of session that is being created. Attributes used to describe an available multiplayer session are known as session properties. These session properties, which you create, may contain such details as identifying a game as either a timed session or a capture-the-flag session.

Note
Creating a NetworkSessionProperties collection to describe your session is optional. You can also pass in null when creating a new network session.

The NetworkSessionProperties supports up to eight integer values that describe the session. Because these values are integers, we create a set of enums in this example to describe them and their placement in NetworkSessionProperties.

C#
enum SessionProperty{ GameMode, SkillLevel, ScoreToWin }

enum GameMode{ Practice, Timed, CaptureTheFlag }

enum SkillLevel{ Beginner, Intermediate, Advanced }

Conducting a Network Session

To describe session properties

  1. Create a new NetworkSessionProperties.

  2. Set the values to the custom session properties.

    C#
    NetworkSessionProperties sessionProperties =
    new NetworkSessionProperties();

sessionProperties[(int)SessionProperty.GameMode]
    = (int)GameMode.Practice;
sessionProperties[(int)SessionProperty.SkillLevel]
    = (int)SkillLevel.Beginner;
sessionProperties[(int)SessionProperty.ScoreToWin]
    = 100;

You can create many different types of sessions, including a local session that is used for split-screen gaming and requires no network traffic. Another is a system link session, which connects multiple gaming machines over a local subnet. Finally, there is an Xbox LIVE multiplayer session that occurs on the Internet. In this example, we will create a system link game.

Note
The gaming machine that creates the session is called the host. It owns the multiplayer session. The host does not imply a game server or authority. There are no implied network topologies such as client-server, peer-to-peer, or hybrid. The network topology is determined by your implementation of your game.
C#
NetworkSession session;

    int maximumGamers = 8;
    int privateGamerSlots = 2;
    int maximumLocalPlayers = 1;

    // Create the session
    session = NetworkSession.Create(
        NetworkSessionType.SystemLink,
        maximumLocalPlayers, maximumGamers, privateGamerSlots,
        sessionProperties );

To enable host migration and join-in-progress functionality

  • Set the AllowJoinInProgress and AllowHostMigration properties to values appropriate for your game.

    C#
    session.AllowHostMigration = true;
session.AllowJoinInProgress = true;

To subscribe to session events

  • Subscribe to any session events in which your game has an interest.

    Multiplayer sessions have events that occur when the game transitions from lobby to gameplay (GameStarted and GameEnded, respectively), when players join and leave (GamerJoined and GamerLeft, respectively), when the host changes (HostChanged), and when the session ends (SessionEnded).

    C#
    session.GamerJoined +=
    new EventHandler<GamerJoinedEventArgs>(session_GamerJoined);
session.GamerLeft +=
    new EventHandler<GamerLeftEventArgs>(session_GamerLeft);
session.GameStarted +=
    new EventHandler<GameStartedEventArgs>(session_GameStarted);
session.GameEnded +=
    new EventHandler<GameEndedEventArgs>(session_GameEnded);
session.SessionEnded +=
    new EventHandler<NetworkSessionEndedEventArgs>(
        session_SessionEnded);

To end the session

  • If you are a host purposely ending the session , and the conditions for ending the session have been met, call NetworkSession.EndGame.

    In this example, when the host presses the ESC key or Back button indicating that the player wants to exit the game, the host checks to see if players remain in the game. If not, the host ends the session.

    C#
    // Check for exit.
if ( IsButtonPressed(GamePadButton.B ) ||
    IsButtonPressed( GamePadButton.Back ) )
{
    if (session != null)
    {
        if (session.AllGamers.Count == 1)
        {
            session.EndGame();
            session.Update();
        }
    }
}

    The end of a game is controlled by the NetworkSession.EndGame method. At the end of a game, you might choose to move back to the lobby or to end the session. Players in the game can subscribe to the NetworkSession.GameEnded and NetworkSession.SessionEnded events.

Expand image See Also

Concepts

Network Session Management
Setting up your Firewall

Tasks

Finding and Joining a Network Session


Joining and Leaving a Game

Joining and Leaving a Game

Manage data associated with a player by subscribing to events that occur when players join or leave a game.

A NetworkSession contains several properties that list the players who have joined a session. The collection of all gamers in a session is described by the NetworkSession.AllGamers property. This information is guaranteed to be the same on each game machines in a session. Within this list, the gamers might be local (playing on the same game machine through split-screen play) or remote (playing on a different game machine). The property NetworkSession.LocalGamers provides a list of all local players playing on a local game machine. The NetworkSession.RemoteGamers property provides a list of all players not playing on the local game machine.

To respond to players joining or leaving the game, you may subscribe to the NetworkSession.GamerJoined and NetworkSession.GamerLeft events and create custom event handlers.

Subscribing to Gamer Events

To subscribe to gamer events

  1. After creating or joining a session, subscribe to events associated with players joining or leaving the game.

    C#
    session.GamerJoined +=
    new EventHandler<GamerJoinedEventArgs>(session_GamerJoined);
session.GamerLeft +=
    new EventHandler<GamerLeftEventArgs>(session_GamerLeft);

  2. Create the GamerJoined event handler.

    C#
    void session_GamerJoined(object sender, GamerJoinedEventArgs e)
{
    // Associate a tank object with this gamer.
    e.Gamer.Tag =
        new Tank(Content, GraphicsDevice.PresentationParameters);

}
    Note

    The GamerJoinedEventArgs object contains a Gamer property. You can use it to read information about, or to associate information with, a specific player. Use the Gamer.Tag property to associate data with a player.

  3. Create the GamerLeft event handler.

    C#
    void session_GamerLeft(object sender, GamerLeftEventArgs e)
{
    Tank tank = e.Gamer.Tag as Tank;

    tank.LeaveGame();
}
Note
If the host player leaves the session calling Game.Exit, this forces a host reelection. The host is automatically migrated to another player. If you use a client-server or hybrid network topology instead of a peer-to-peer, and if your host also is a server in the game, it is necessary to migrate game state to the new game server when the host is migrated. Players in the game can use the HostChanged event to respond to host migration.

Expand image See Also

Concepts

Network Session Management

Tasks

Creating a Network Session
Finding and Joining a Network Session


Managing Player Movement Between Lobby and Gameplay Modes

Managing Player Movement Between Lobby and Gameplay Modes

Describes properties and events associated with a multiplayer session that allow a game to move between lobby and gameplay modes. It identifies the game's current mode.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Sample.

Managing Player Movement Between Modes

To manage player movement between lobby and gameplay modes

  1. Hook up the session state change events.

    The NetworkSession.GameStarted event indicates that all players have moved from the lobby to gameplay. The NetworkSession.GameEnded event occurs when players move from gameplay back to the lobby. NetworkSession.SessionEnded occurs when the session is over, and all players move from the lobby of a session back to find another available session.

    C#
    session.GameStarted +=
    new EventHandler<GameStartedEventArgs>(session_GameStarted);
session.GameEnded +=
    new EventHandler<GameEndedEventArgs>(session_GameEnded);
session.SessionEnded +=
    new EventHandler<NetworkSessionEndedEventArgs>(
        session_SessionEnded);

  2. Use NetworkGamer.IsReady to signal that a player is ready to move from the lobby to the game.

    C#
    // Signal I'm ready to play!
if (IsButtonPressed(GamePadButton.A))
{
    foreach (LocalNetworkGamer gamer in session.LocalGamers)
        gamer.IsReady = true;

}

  3. On the host gaming machine, check NetworkSession.IsEveryoneReady to determine if all players are ready.

  4. If this is true, call NetworkSession.StartGame to change the game state from lobby to gameplay mode.

    C#
    // The host checks if everyone is ready,
// and moves to game play if true.
if (session.IsHost)
{
    if (session.IsEveryoneReady)
    {
        session.StartGame();
        foreach (SignedInGamer signedInGamer in
            SignedInGamer.SignedInGamers)
        {
            signedInGamer.Presence.PresenceMode =
                GamerPresenceMode.InCombat;
        }
    }
}

  5. In the NetworkSession.GameStarted event handler, make preparations for the game to begin.

    In this example, the game object states are reset for the new game.

    C#
    void session_GameStarted(object sender, GameStartedEventArgs e)
{

    //// Reset everything when we are starting a new game.
    NetworkSession session = (NetworkSession)sender;

    for (int i = 0; i < session.AllGamers.Count; i++)
    {
        Tank tank = session.AllGamers[i].Tag as Tank;
        tank.Reset(i);
    }
}

  6. In the NetworkSession.GameEnded event handler, make preparations—such as recording the high score—to return players to the lobby.

    C#
    void session_GameEnded(object sender, GameEndedEventArgs e)
{
    ReturnToLobby();
}

  7. In the NetworkSession.SessionEnded event handler, return to the game title screen.

    C#
    void session_SessionEnded(object sender, NetworkSessionEndedEventArgs e)
{
    ReturnToTitleScreen();
}
    Note

    Before the session ends, it can move between lobby and gameplay states as many times as the player wants. To retrieve the session state at any time, check the NetworkSession.SessionState property.

Expand image See Also

Concepts

Network Session Management

Tasks

Creating a Network Session
Finding and Joining a Network Session
Joining and Leaving a Game


Network Session Management

Network Session Management

Any matchmaking scenario involves the creation of a network session. Network sessions give XNA Framework games access to profile data on all the gamers in a potential game.

  • Session Updates
  • Matchmaking
  • Session Types
  • Finding Sessions
  • Session Management

Session Updates

The NetworkSession class has a single Update method that must be called once per frame. This update call performs the following actions:

  • Sends the network packets.
  • Changes the session state, such as which players are in the session and which player is talking currently.
  • Raises the managed events for any significant state changes.
  • Returns the incoming packet data.

This explicit update call allows the framework to synchronize the session so that packet-received and state-change events will never be raised asynchronously with the rest of the game code. This allows developers to program against the network session object without any threading concerns.

Session updates are kept separate from the gamer services system pumping for two reasons:

  • To clarify when session events will be raised.
  • To allow developers the option to update the session from a background worker thread, which allows these developers the option to run this in parallel with the main game update.

Matchmaking

To play a networked game with other people, the game needs a way to publish an instance of the game for others to discover the instance and join the game. This matchmaking and peer discovery mechanism is available through the NetworkSession.Find and NetworkSession.BeginFind methods, which return a collection of AvailableNetworkSession instances. You may examine the properties of each AvailableNetworkSession, and pass a suitable AvailableNetworkSession to Join to join the session.

Players

The NetworkSession object exposes a collection of player instances, along with events indicating when players join or leave the session. There are properties for querying which player is the host (NetworkSession.Host), and for determining which players are local players signed on to the same machine and physically located together (NetworkGamer.IsLocal).

Friends

The XNA Framework exposes basic functionality for programmatic friends list access:

  • Query the contents of the friends list using SignedInGamer.GetFriends, obtaining gamertags and presence information using the methods and properties available from a FriendGamer.
  • Query whether another player is a friend using SignedInGamer.IsFriend.

Local Sign-In

When you first create a session, a game must specify the maximum number of local players that it supports (1, 2, 3, or 4). The framework will automatically add up to this number of profiles to the session, and keep this up to date if the sign-in state changes. If there are more signed-in profiles than the game wants, only the lower-numbered profiles will be added to the session. If extra players sign after the session is created the players will not be added. If the host player signs off, the session will either be torn down or a host migration will take place depending on whether the NetworkSession.AllowHostMigration option is enabled.

Session Types

The XNA Framework supports four kinds of sessions:

  • Local
  • System link
  • Xbox LIVE unranked session
  • LIVE ranked session

The same matchmaking API is used for both LIVE and system link session types. The session type must be specified when creating or searching for sessions, and only sessions of an identical type will be returned by the query.

Local sessions are interesting for games that want to build both networking and local split-screen multiplayer on top of the same infrastructure. This allows this type of game to implement both online and offline game modes using the same framework session interfaces.

Finding Sessions

The XNA Framework provides a single fixed matchmaking query in the form of a NetworkSessionProperties collection that represents the desired session to match. This collection is passed to the NetworkSession.Find and NetworkSession.BeginFind static methods. These methods return an AvailableNetworkSessionCollection containing a maximum of 25 AvailableNetworkSession objects, which in turn contain the following data about each session:

  • Gamertag of the host.
  • Number of players in the network session.
  • Number of free public and private slots. On Windows- and Xbox 360-based games, the supported range is between 2 and 31. On the Zune platform, the supported range is between 2 and 8.
  • Quality of service information. This information is filled in over time, so search results will be returned initially without quality of service data, that will then become available at a later time.

Session Management

One important task in writing a networked game is managing the session, or instance, of the game. The events on the NetworkSession object allow you to be aware of the following:

  • A player connects or disconnects using GamerJoined and GamerLeft
  • The game has changed state between lobby, gameplay, and post-gameplay modes using GameStarted, GameEnded, and SessionEnded
  • The network machine hosting the session changes using HostChanged

Lobby Transitions

The XNA Framework keeps track of whether the session is in the lobby or actually playing the game. It enables events to notify titles when the state changes. While in the lobby, each player can use IsReady to signal that he or she is ready to move from the lobby and into the game. The host can check IsEveryoneReady to see if all the players are ready to begin the game.

Each network session can use AllowJoinInProgress to specify whether the game supports join-in-progress. This is used in conjunction with the lobby versus play state to automatically update the session joinability status on the matchmaking servers.

Expand image See Also

Tasks

Creating a Network Session
Joining and Leaving a Game
Managing Player Movement Between Lobby and Gameplay Modes


Reliable Packet Delivery

Reliable Packet Delivery

Reliable TCP sockets, for a variety of reasons, generally are considered unsuitable for game networking. Most of the reasons relate to how the sockets handle congestion and how they prioritize in-order delivery over timeliness. Most games use User Datagram Protocol (UDP) sockets, which means they send the vast bulk of their gameplay data unreliably. Reliable delivery, however, is still necessary for some data subsets. To improve reliablity, the XNA Framework provides a reliable delivery mechanism on top of UDP.

The XNA Framework SendData and ReceiveData methods are built over a reliable UDP packet layer. This packet layer provides optional ordering and delivery guarantees, as well as automatic packet coalescence (if several packets are sent in rapid succession) and splitting (if the payload is too big for a single UDP wire packet) to make efficient use of the underlying UDP channel.

Fundamentally, this is a peer-to-peer architecture with reliable connections from each machine to all other machines. However, this does not place any limitation on what topologies the game can use for its own network traffic. Client-server, peer-to-peer, or any kind of hybrid architecture can benefit from the reliable UDP protocol supported by the XNA Framework.

Packet Delivery Options and Network Performance

There are five packet delivery options available through the SendDataOptions parameter that is passed to any call to SendData.

  • Unreliable, out of order (SendDataOptions.None)
  • Unreliable, in order (SendDataOptions.InOrder)
  • Reliable, out of order (SendDataOptions.Reliable)
  • Reliable, in order (SendDataOptions.ReliableInOrder)
  • Chat data (SendDataOptions.Chat)

If a reliable, sequential message sent by using SendDataOptions.ReliableInOrder is dropped, later sequential messages cannot be delivered until the message is resent and received. In effect, this stalls the channel. If you use this option to send more messages, you will see real-world bottlenecks. If the receiver does not call ReceiveData quickly enough, or just stops altogether, the queue of messages to resend fills up.

Unreliable, sequential messages sent by using SendDataOptions.InOrder may have gaps in the sequence, but they will never go backward or stall because of previous non-reliable sequential messages. Unreliably sent data will not be resent. This is good for information such as player position that is updated frequently. Newer information will be available by the time the sender attempts to resend the data. For all game data that is sent—regardless of the delivery option— be sure to send the minimum amount of data necessary to communicate the information. This can be done by sending only changes in the game state rather than the entire game state.

For best performance in a network game, minimize the use of reliable and in-order packet delivery. In general, reliable packet delivery should be used only for data critical for your game to function properly because it consumes bandwidth resending packets as necessary.

SendDataOptions.Chat can be included independently of any other flags, and has two effects. First, any in-order chat sends are guaranteed only to be ordered with regard to other chat sends. There is no guarantee of ordering between non-chat and chat sends. Second, data within a chat send is unencrypted between the sender and receiver.

Expand image See Also

Tasks

Setting up your Firewall


Network Topologies and Host Migration

Network Topologies and Host Migration

Although the XNA Framework specifies one machine as the host of a session, this does not imply anything about the network topology used to route the actual gameplay. The host is responsible for the following:

  • Owning the session description on the Xbox LIVE servers
  • Updating multiplayer session properities as the game state changes
  • Controlling when to transition between the lobby and play states
  • Removing players from the session (peers cannot directly remove other peers – only the host can do this)

Games are free to choose any network topology for their gameplay data:

  • Peer-to-peer
  • Client-server, where the host doubles as the server
  • Client-server, using one of the other session members as the server
  • Any other hybrid approach

The host and server are often the same, but they are not required to be. The host has significance to the LIVE service, while the server relates purely to gameplay. The host is chosen by the XNA Framework. The host will be the machine that creates the session. However, the host may change if there is a host migration. The game architecture determines which server is chosen. The host is an important part of XNA Framework gamer services, but the concept of a server only exists inside the game code. There are no types or properties relating to servers in the framework itself. Games need not have any server at all if they are using a pure peer-to-peer architecture.

Hosts and Peers

One of the gaming machines is designated the host for a LIVE multiplayer session. The other gaming machines are peers. The concept of host or peer is independent of the network topology chosen for the game. That is, the concept of host does not necessarily imply that the console is the network host, or even that a client-host topology is in use, even though many titles align the two concepts.

The XNA Framework automatically handles host migration. When a host leaves, the run time will automatically elect a new host. It then raises an event to inform the game of the change. Support for host migration is optional. It is disabled by default.

Note that the XNA Framework automatically migrates the host, but not the server. The game is still responsible for migrating the simulation state. This is often trivial for peer-to-peer titles, but can be more challenging for client-server architectures. If the host quits the game gracefully through a menu selection, the game code could explicitly transfer the server simulation state before actually leaving the session. However, this is very difficult to do, particularly for the more general case of forced exits such as a hardware reboot.


Latency Simulation and Bandwidth Usage

Latency Simulation and Bandwidth Usage

To debug and test a networked game, you need to create at least two peers and have them communicate. There are several ways to create multiple peers, including running multiple instances across equal numbers of computers or a mix of computers and Xbox 360 consoles. Most development will take place on a local area network (LAN) where network throughput and quality is not an issue. Networked games that run across the Internet, however, will need to handle a number of issues such as lower bandwidth availability, non-reliable delivery of messages, and firewall and proxy support.

To help developers test networked games over a subnet where you will typically see much lower levels of latency and packet loss than can be expected, the XNA Framework includes a latency and packet loss simulator. This simulator requires no special hardware, extra network cards, or unusual Windows network configurations. You can use the latency simulation capabilities to test techniques, such as client-side prediction, that you might use in your game design.

You can use NetworkSession.SimulatedLatency to set the desired latency, and you can use NetworkSession.SimulatedPacketLoss to set a desired packet loss percentage.

The network simulation respects the SendDataOptions.Reliable and SendDataOptions.InOrder flags. Packets that are sent reliably will never be discarded, no matter how high SimulatedPacketLoss is set. Packets sent without SendDataOptions.InOrder will be delayed by a random value from a bell curve centered on the current SimulatedLatency setting, which has the effect of reordering packets in addition to delaying them. Packets that use SendDataOptions.InOrder will be delayed without any reordering.

For a game to play well over the Internet, it is recommended that you design it to handle up to 0.1 (10%) packet loss, and give it 200 milliseconds of latency.

The XNA Framework also includes performance metrics with the NetworkSession.BytesPerSecondSent and NetworkSession.BytesPerSecondReceived so games can easily measure upstream and downstream bandwidth usage.


Voice Support

Voice Support

Voice data is automatically transmitted and replayed without any title effort whatsoever. The GamerPrivileges.AllowCommunication property enables you to see which players are allowed to send voice data. The LocalNetworkGamer.EnableSendVoice method allows a game to programmatically specify which players can talk. Titles can use this to implement team chat or proximity voice. The XNA Framework does not expose direct program access to the voice data stream.

There are three Boolean properties exposed to query the voice status of another player:

  • Do they have voice access? NetworkGamer.HasVoice
  • Are they currently talking? NetworkGamer.IsTalking
  • Are they muted? NetworkGamer.IsMutedByLocalUser

These properties allow games to display voice-related information in the user interface. One example would be flashing the name of the player who is currently talking.

Related Topics

Recording Sounds with Microphones
Topics that provide guidance on writing code to support microphones for XNA Game Studio.


Adding Art, Music, and Other Game Assets

Adding Art, Music, and Other Game Assets

Describes game assets, such as bitmaps, models, textures, and sounds. These assets, a collection of data files used to support gameplay, are managed by the XNA Framework Content Pipeline.

This section discusses how you can manage the assets in a game project.

In This Section

Adding Content to a Game
Describes how to add and load content such as textures, meshes, sounds, and data in your game.
Game Content Project
Describes a project type designed to store all content for a game.
Game Content References
Describes the use of the Content References node within a game project.
How to: Add a Game Content Project
Describes the process to create a new content project in an XNA Game Studio solution.
How to: Add Game Assets to a Content Project
Demonstrates how to add an art asset to a game content project.
Game Asset Properties
Describes property settings, indicating which actions the project system should perform on a game asset file of a supported type.
Adding New Content Types
Describes the architecture and features of the Content Pipeline, and how to add new content types.

Related Overview Topics

Displaying Pictures and Playing Video
Provides overviews about how to use the Media API to retrieve system media, including pictures, songs, and video.
Getting Started with XNA Game Studio Development
Provides introductory documentation for developing games with XNA Game Studio.


Adding Content to a Game

Adding Content to a Game

In This Section

What Is Content?
Describes the purpose of the XNA Game Studio Content Pipeline and how it helps you add art and data assets to your game.
Standard Importers and Processors
Describes the standard Content Pipeline importers and content processors of XNA Game Studio that support various common art asset file formats.
How to: Add Game Assets to a Content Project
Demonstrates how to add an art asset to a game content project.
Loading Content
Demonstrates how to load content such as models, textures, sounds, and effects.
Using an XML File to Specify Content
Describes how to use XML files for custom game data through the Content Pipeline.
Loading Content from a Game Library
Demonstrates how to load content from a game library.
Content Compression
XNA Game Studio offers data compression—an easy way to decrease the size of certain built game assets such as textures, shaders, and meshes. Data compression reduces not only the size required for media storage and downloads, but also the deploy time required for debugging a game.
Parameterized Processors
Describes how parameterized processors work in XNA Game Studio. Many of the standard Content Pipeline content processors shipped with XNA Game Studio support parameter usage.

Expand image See Also

Concepts

Writing Game Code
Content Pipeline Content Catalog at XNA Creators Club Online


What Is Content?

What Is Content?
See Also
CollapseAll image

The XNA Game Studio Content Pipeline is a set of processes applied to a game's art and data assets when the game is built. The process starts with an art asset in its original form as a file, and it continues to its transformation as data that can be retrieved and used within an XNA Game Studio game through the XNA Framework Class Library.

Content is all the parts of your game that are not executing managed code. It includes all art assets, such as textures, sprites, meshes, effects, and fonts; and includes sound assets, such as music or brief sound effects. It also can include data assets, such as tables of levels or character attributes.

Most content will be created using a digital content creation (DCC) tool, such as a paint program or a 3D model editor. The content your game uses is stored in a variety of file formats. Most will be standard file formats, such as JPEG for textures or Autodesk FBX format for 3D models. However, they might also be in a custom format or house custom data in XML format.

Benefits of the Content Pipeline

The chief reason XNA Game Studio uses a Content Pipeline is to help your game run fast. Without the content pipeline, your game would have to be built with its art assets in their original file format. When the game needs to load its art to draw it on the screen, it would have to determine its format and convert the data into a form it can use more directly. This would have to be performed at run time, for each asset, making the player wait to have fun.

The Content Pipeline remedies this by shifting this time-consuming work to when the game is built. At build time, each asset is imported from its original file format and processed into a managed code object. Those objects are then serialized to a file that is included in the game’s executable.

At run time, the game can then read the serialized data from the file directly into a managed code object for immediate use.

This architecture also provides several other benefits.

  • Game artists can use the DCC tools of their choice.
  • Game developers can use the files game artists produce directly in their XNA Game Studio projects.
  • If all game assets are in file formats supported by the Standard Importers and Processors provided by XNA Game Studio, the game developer never needs to be concerned with the specifics of that file format, nor possess a detailed knowledge of how the Content Pipeline works.
  • If required, the Content Pipeline can easily be customized or extended to import a new file format or to produce custom output.

Using the Content Pipeline

For XNA Game Studio games that use the most common types of art assets and formats, a detailed knowledge of how the Content Pipeline works is unnecessary. XNA Game Studio supplies standard importers and processors for many popular DCC file formats. The only procedure necessary is to add these assets to the game's content project. For a list of formats XNA Game Studio inherently supports, see Standard Importers and Processors.

To use a DirectX Effect (.fx) file in your game, for example, just add the file to the XNA Game Studio game solution's content project. XNA Game Studio recognizes the .fx file type as one it supports, and it assigns the correct components to it that are used to process it when the game is built. The game then can access the effect through the standard ContentManager.Load method of the XNA Framework. The game programmer does not need to be concerned about all the steps taken by the Content Pipeline to ready it for this straghtforward use.

There are other circumstances, however, when it helps to understand how the Content Pipeline works.

  • A third party may provide custom XNA Game Studio Content Pipeline components that support additional art assets and formats.
  • You may need to write your own custom XNA Game Studio Content Pipeline components to support a new type of art asset or format from a DCC.
  • You may wish to write your own custom XNA Game Studio Content Pipeline components to derive special-purpose content from another piece of content at the time the game is built.

Content Pipeline Components

The processes that comprise the XNA Game Studio Content Pipeline fall into two types, depending on when they execute: build-time components and run-time components.

Build-Time Components

The build-time components of the Content Pipeline that process your art assets execute within Visual Studio when you build your XNA Game Studio game and produce an executable file. These processes perform the initial transformation of an asset from a DCC format to a managed code object that your game can use when it executes.

These build-time components make use of the library, which can be used and extended to create custom Content Pipeline build-time components.

Component | Description
Importer | An importer converts art assets from a particular DCC file format to objects in the XNA Game Studio Content Document Object Model that standard content processors can consume, or to some other custom form that a particular custom processor can consume.
Content processor | A processor takes one specific type of imported art asset, such as a set of meshes, and compiles it into a managed code object that can be loaded and used by XNA Game Studio games on Windows, Xbox 360, or Windows Phone.

When you include an art asset file in your XNA Game Studio solution's content project, its Properties page specifies the appropriate importer and processor. Thereafter, when you build your game (by pressing F5), the assigned importer and processor for each asset is invoked automatically. The asset is built into your game in a form that can be loaded at run time by your game by using ContentManager.Load.

Run-time Components

The run-time components of the XNA Game Studio Content Pipeline support the loading and use of the transformed art asset by your XNA Game Studio game.

These run-time components make use of the library, which can be extended to create custom Content Pipeline run-time components.

Expand image See Also

Concepts

Adding Content to a Game
Adding New Content Types
Content Pipeline Content Catalog, XNA Creators Club Online


Standard Importers and Processors

Standard Importers and Processors

Describes the standard Content Pipeline importers and content processors of XNA Game Studio that support various common art asset file formats.

Importers and content processors are implemented as assemblies. In addition to the standard ones provided by XNA Game Studio and listed below, you can also use custom importers and processors developed by you or third parties. Use the Properties window to assign an appropriate importer and processor to each game asset added to your game project (see Using dialog properties for more information).

Standard Importers

The following is a description of the standard importers shipped with XNA Game Studio and the type of game asset each supports.

All standard importers are declared as part of the Microsoft.Xna.Framework.Content.Pipeline namespace.

Name | Type name | Output type | Description
Autodesk FBX FbxImporter NodeContent

Imports game assets specified with the Autodesk FBX file format (.fbx).

This importer is designed to work with assets exported with the 2006.11 version of the FBX exporter.
Effect | EffectImporter | EffectContent | Imports a game asset specified with the DirectX Effect file format (.fx).
Sprite Font Description | FontDescriptionImporter | FontDescription | Imports a font description specified in a .spritefont file.
Texture | TextureImporter | TextureContent | Imports a texture. These file types are supported: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga.
X File | XImporter | NodeContent | Imports game assets specified with the DirectX X file format (.x). This importer expects the coordinate system to be left-sided.
XACT Project N/A N/A

Imports game audio specified in the Microsoft Cross-Platform Audio Creation Tool (XACT) format (.xap file).

Tip

Associating an .xap file with XACT allows you to automatically open XACT when editing any .xap file.

To associate the file in XNA Game Studio

  1. In Solution Explorer, right-click the .xap file, and then click Open With.
  2. In the dialog box, select the XACT-specific string, and then click Set As Default.

To run XACT

If the XACT-specific option is unavailable, you must run XACT before this option appears. The application is available from the Microsoft XNA Game Studio group.

  • On the Start menu, click Tools, and then click Microsoft Cross-Platform Audio Creation Tool (XACT) .

XML Content XmlImporter object

Imports XML content used for editing the values of a custom object at run time. For instance, you could pass XML code to this importer that looks for the specified property of a custom type and changes it to the specified value. You could then process the custom object with a processor or pass it to your game untouched using the No Processing Required processor.

This importer is designed for scenarios like importing an XML file that describes game data at run time (similar to the Sprite Font Description importer) or importing terrain data in an XML file that then is passed to a processor that generates a random terrain grid using that data.

Standard Content Processors

XNA Game Studio ships with a variety of processors that support several common game asset types. Many of the standard processors, such as the TextureProcessor, support parameters for modifying the default behavior of the processor. For more information, see Parameterized Processors.

The following describes the standard processors and the type of game asset each supports.

Name | Type name | Input type | Output type | Description
Model ModelProcessor NodeContent Class ModelContent Class

A parameterized processor that outputs models as a ModelContent Class object.

Available parameters:

  • Color Key Color–Any valid Color. Magenta is the default value.
  • Color Key Enabled–A Boolean value indicating if color keying is enabled. The default value is true.
  • Generate Mipmaps–A Boolean value indicating if mipmaps are generated. The default value is false.
  • Generate Tangent Frames–A Boolean value indicating if tangent frames are generated. The default value is false.
  • Resize Textures to Power of Two–A Boolean value indicating if a texture is resized to the next largest power of 2. The default value is false.
  • Scale–Any valid float value. The default value is 1.0.
  • Swap Winding Order–A Boolean value indicating if the winding order is swapped. This is useful for models that appear to be drawn inside out. The default value is false.
  • Texture Format–Any valid SurfaceFormat value. Textures are either unchanged, converted to the Color format, or DXT Compressed. For more information, see TextureProcessorOutputFormat.
  • X Axis Rotation–Number, in degrees of rotation. The default value is 0.
  • Y Axis Rotation–Number, in degrees of rotation. The default value is 0.
  • Z Axis Rotation–Number, in degrees of rotation. The default value is 0.
No Processing Required PassThroughProcessor Object Object

Performs no processing on the file.

Select this processor if your content is already in a game-ready format (for example, an externally prepared DDS file) or a specialized XML format (.xml) designed for use with XNA Game Studio.
Sprite Font Description | FontDescriptionProcessor | FontDescription | SpriteFontContent | Converts a .spritefont file specifying a font description into a font.
Sprite Font Texture FontTextureProcessor TextureContent SpriteFontContent

A parameterized processor that outputs a sprite font texture as a SpriteFontContent object.

Available parameters:

  • First Character–Any valid character. The space character is the default value.
Sprite Font Texture | FontTextureProcessor | Texture2DContent | SpriteFontContent | Converts a specially marked 2D bitmap file (.bmp) into a font. Pixels of Color.Magenta are converted to Color.Transparent.
Texture TextureProcessor TextureContent Class TextureContent Class

A parameterized processor that outputs textures as a TextureContent Class object.

Available parameters:

  • Color Key Color–Any valid Color. Magenta is the default value.
  • Color Key Enabled–A Boolean value indicating if color keying is enabled. The default value is true.
  • Generate Mipmaps–A Boolean value indicating if mipmaps are generated. The default value is false.
  • Resize to Power of Two–A Boolean value indicating if a texture is resized to the next largest power of 2. The default value is false.
  • Texture Format–Any valid SurfaceFormat value. Textures are either unchanged, converted to the Color format, or DXT Compressed. For more information, see TextureProcessorOutputFormat.
XACT Project | N/A | N/A | N/A | Generates audio assets from an XACT project.

Expand image See Also

Adding Content to a Game
What Is Content?
Adding a Custom Importer


How to: Add Game Assets to a Content Project

How to: Add Game Assets to a Content Project

This topic demonstrates how to add an art asset to the game content project, using a texture asset as the example. The same procedure also can be applied to model and sound assets.

It is assumed that an existing Xbox 360, Windows, or Windows Phone game project is loaded in XNA Game Studio.

There are two ways to add a game asset to your game, either by adding the asset file or by adding a link to the asset.

Tip

Adding an existing asset to your project is quite different from adding an existing item as a link to your project. The first method creats a copy of the asset file and adds the copy to your project. Adding an asset as a link stores only the path to the asset file.

Adding the Texture Asset to the Content Project

When you add a game asset (not as a link), XNA Game Studio makes a copy of the asset file and adds the copy to the content project. For this reason, adding a game asset in this manner may be most appropriate when the asset is used by only one developer in one project and is not expected to be changed.

To add the texture asset to the content project

  1. In Solution Explorer, right-click Content, click Add, and then click Existing Item.

  2. Navigate to the location of the texture, and select it.

    For this example, the asset is called B1_nebula01.tga.

  3. Click the Add button.

    This creates a copy of the selected asset in your project.

  4. Save the solution.

Adding the Texture Asset as a Link to the Content Project

Adding an asset as a link is useful if the referenced asset depends on additional external assets. It ensures that the solution always uses the latest version. For this reason, adding a game asset as a link may be most appropriate when the asset is shared with other people or other game projects, or is likely to be changed.

To add the texture asset as a link to the content project

  1. In Solution Explorer, right-click Content, click Add, and then click Existing Item.

  2. Navigate to the location of the texture, and select it.

    For this example, the asset is called B1_nebula01.tga.

  3. Click the small arrow to the right of the Add button, and then click Add as Link.

    This creates a reference to the selected asset (and not a copy) in your project.

  4. Save the solution.

Verifying the Content Importer

You should use this procedure each time you add a game asset. This ensures that the asset is correctly recognized and processed by the Content Pipeline.

To verify the game asset will use the correct content importer

  1. After you add the asset to the solution, open the Properties window to verify that you specified the correct importer and processor.

  2. To verify, in Solution Explorer right-click the file, and then click Properties.

    For this example, the Content Importer is Texture - XNA Framework and the Content Processor is Texture - XNA Framework.

  3. Save the solution.

For more information about the Properties window of a game asset, see Game Asset Properties.

Expand image See Also

Loading Content
Adding Content to a Game


Loading Content

Complete Sample

The code in this topic shows you the technique for loading content. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download GameLoop_Sample.zip

Loading Content

You need a content project in your game if you are using Visual Studio 2010 Express to compile and build your project. For more information, see How to: Add Game Assets to a Content Project.

To load content and ensure it is reloaded when necessary

  1. Derive a class from Game.

  2. Override the LoadContent method of Game.

  3. In the LoadContent method, load your content using the ContentManager.

    C#
    protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);
    // TODO: use this.Content to load your game content here
}

  4. Override the UnloadContent method of Game.

  5. In the UnloadContent method, unload resources that are not managed by the ContentManager.

    C#
    protected override void UnloadContent()
{
    // TODO: Unload any non ContentManager content here
}

Expand image See Also

Reference

Game Class
LoadContent
UnloadContent
Game Members
Microsoft.Xna.Framework Namespace


Using an XML File to Specify Content

Using an XML File to Specify Content

Game assets managed through the Content Pipeline include graphic items such as textures, models and meshes; sound files such as dialogue or music; and custom data that governs the behavior of the game.

Data tables, for example, are custom data that might describe different characters’ attributes or the features of each level in the game. The content and format of this data is specific to the requirements of the game. Custom game data in the form of an XML file also can be loaded into your game through the standard features of the Content Pipeline.

When the Content Pipeline is used, the game does not have to parse the XML format in which the game data is originally stored. Data loaded by the game through ContentManager is read in deserialized form directly into a managed code object.

In This Section

Creating an XML File
Describes how to use IntermediateSerializer from a Windows application to generate XML content to add to a XNA Game Studio application.
Adding an XML Content File to a Visual Studio Project
Describes how to add custom game data as an XML file through the Content Pipeline.
Loading XML Content at Runtime
Describes how to load custom game data at game runtime through the Content Pipeline.
XML Elements for XMLImporter
Describes the elements of an XML file that can be processed by the XmlImporter Class.
Sprite Font XML Schema Reference
Describes the valid tags and values for Sprite-Font (.spritefont) XML files used by the Content Pipeline to create SpriteFont textures.

Expand image See Also

Concepts

Adding Content to a Game
Writing Game Code


Creating an XML File

Creating an XML File

For complex game data, using a software tool to create and maintain these assets may be useful. Level tables, for example, might be easier to develop through a custom-level editor tool.

The IntermediateSerializer class of the XNA Framework can be employed by custom tools running under Windows to directly serialize game data to an XML file.

An XML file generated in this way then can be included in the game project and imported by XmlImporter Class as part of the Content Pipeline. Because XmlImporter is actually a wrapper for IntermediateSerializer, it is certain that the XML file will be in the correct format to be deserialized by the same facility.

The IntermediateSerializer class is controlled through the XmlWriter class of the .NET Framework Class Library defined in System.Xml. The properties of the XmlWriterSettings class can be used to specify its output properties.

The serializer produces its output according to these rules:

  • All public fields and properties are serialized; a separate XML element is used for each.
  • Protected, private, or internal data is skipped.
  • Get-only or set-only properties are skipped.
  • Properties come before fields.
  • If there is more than one field or property, these are serialized in the order they are declared.
  • Nested types are serialized using nested XML elements.
  • When the class derives from another, members of the base class are serialized before data from the derived type.

XML Serialization Example

The following steps create a simple program that demonstrates how a program can use the IntermediateSerializer method IntermediateSerializer.Serialize Generic Method to serialize program data to an XML file.

Step 1: Create a New Project

You will create a new project in Visual Studio.

  1. On the File menu, click New, and then click Project.

  2. In the New Project dialog box, ensure Windows is selected in the Project types pane, and then click Console Application in the Templates pane.

  3. In Solution Explorer, right-click the References folder, and then click Add Reference.

  4. In the Add Reference dialog box, select Microsoft.Xna.Framework.Content.Pipeline assembly, and then click OK.

Step 2: Add XML Serialization

  1. In Solution Explorer, double-click Program.cs to edit it.

  2. Add using declarations for the System.Xml and Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate namespaces.

    C#
    using System.Xml;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate;

  3. Define a class to serialize to XML.

    C#
    namespace XMLSerializerTest
{
    class MyData
    {
        public int elf = 23;
        public string hello = "Hello World";
    }
}

  4. Within the function Main, add the following code that employs IntermediateSerializer.Serialize Generic Method to serialize the MyData class an XML file.

    C#
    MyData ExampleData = new MyData();

XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;

using (XmlWriter writer = XmlWriter.Create("example.xml", settings))
{
    IntermediateSerializer.Serialize(writer, ExampleData, null);
}

Step 3: Generate XML

  1. Press F5 to build and execute the program.

  2. Examine the example.xml file in the project's bin\Debug folder.

    XML
      <?xml version="1.0" encoding="utf-8"?>
  <XnaContent>
    <Asset Type="XMLSerializerTest.MyData">
      <elf>23</elf>
      <hello>Hello World</hello>
    </Asset>
  </XnaContent>

Expand image See Also

Concepts

Using an XML File to Specify Content
Adding Content to a Game

Reference

IntermediateSerializer Class


Adding an XML Content File to a Visual Studio Project

Adding an XML Content File to a Visual Studio Project

Describes how to add custom game data as an XML file through the Content Pipeline.

Adding XML files to game content

Custom game data that is expressed in an XML format can be easily integrated into your game through the XNA Game Studio Content Pipeline.

This example demonstrates the procedure for integrating custom XML data into the content project of a simple XNA Game Studio game for the Windows platform.

To define game data

Within the XNA Game Studio solution, you create a new Windows Game Library project.

  1. Right-click the solution node, point to Add, click New Project, and then select the Windows Game Library template.

    Note

    A Windows Game Library project is created instead of a Content Pipeline Extension Library project so that the class we will define can be used by both the content importer that runs at build-time and the content loader at game runtime.

  2. In the Name box, type MyDataTypes, and then click OK.

  3. In Solution Explorer, double-click Class1.cs to edit the new library project file.

  4. Replace the default template with the following code to define the class.

    C#
    namespace MyDataTypes
{
    public class PetData
    {
        public string Name;
        public string Species;
        public float Weight;
        public int Age;
    }
}

To add an XML file to game content

In this procedure, the "MyDataTypes" library is added as a reference in the content project.

  1. In Solution Explorer, right-click the game content project, point to Add Reference, click the Projects tab, select MyDataTypes, and then click OK.

    A new content item is created next.

  2. In Solution Explorer, right-click the game content folder, point to Add, and then click New Item.

  3. In the Add New Item dialog box, select XML file (.xml) in the Templates pane.

  4. In the Name box, type pets as the file name, and then click OK.

    The new "pets.xml" file automatically opens for editing.

  5. Replace the contents of the template file with the following XML code:

    XML
    <?xml version="1.0" encoding="utf-8" ?>
<XnaContent>
  <Asset Type="MyDataTypes.PetData[]">
    <Item>
      <Name>Fifi</Name>
      <Species>Dog</Species>
      <Weight>11</Weight>
      <Age>6</Age>
    </Item>
    <Item>
      <Name>Bruno</Name>
      <Species>Dog</Species>
      <Weight>21</Weight>
      <Age>12</Age>
    </Item>
    <Item>
      <Name>Chloe</Name>
      <Species>Cat</Species>
      <Weight>6</Weight>
      <Age>3</Age>
    </Item>
    <Item>
      <Name>Pickles</Name>
      <Species>Hamster</Species>
      <Weight>0.4</Weight>
      <Age>1</Age>
    </Item>
  </Asset>
</XnaContent>

When you press F6 to build the solution, it should build successfully, including the custom game content imported from the XML file.

To load the data at runtime, see the tutorial Loading XML Content at Runtime.

Expand image See Also

Using an XML File to Specify Content
Adding Content to a Game


Loading XML Content at Runtime

Loading XML Content at Runtime

Describes how to load custom game data at game runtime through the Content Pipeline.

Loading custom game content

This example concludes the procedure begun in the tutorial Adding an XML Content File to a Visual Studio Project.

Once custom game data is integrated as game content from an XML file through the Content Pipeline, it exists within your game runtime package in binary format. The data can be loaded at runtime through the ContentManager.

To load the custom data in the game

The "MyDataTypes" library is added as a reference in the game project.

  1. In Solution Explorer, right-click the game project, click Add Reference, click the Projects tab, select MyDataTypes, and then click OK.

  2. In Solution Explorer, double-click Game1.cs to edit it.

  3. Add the using declaration for the MyDataTypes namespace.

    C#
    using MyDataTypes;

  4. Add a data declaration for an array of type PetData, the class defined in the "MyDataTypes" library.

    C#
    PetData[] pets;

  5. In the LoadContent override function, load the custom content.

    C#
    protected override void LoadContent()
{
    // Load the pet data table
    pets = Content.Load<PetData[]>("pets");
}

    The custom game data now resides in the array of PetData objects.

Expand image See Also

Using an XML File to Specify Content
Adding Content to a Game


XML Elements for XMLImporter

XML Elements for XMLImporter

XML Elements

The following base elements are recognized by XmlImporter Class:

Element | Parent | Children | Description
<XnaContent> | — | <Asset> | Top-level tag for XNA Content.
<Asset> | <XnaContent> | <Item> | Marks the asset. The Type attribute specifies the corresponding namespace and class of the matching data type.
<Item> | <Asset> | — | When the asset contains multiple objects (as in an array), marks a single object within the group. The child elements correspond to the properties of the data type's class definition.

Examples

Example 1: Single Object

This example demonstrates an XML file that defines an asset that consists of a single item (not an array).

Assume that the XML file is to define a single object of data for the class that is defined as:

C#
          namespace XMLTest
          {
          class MyTest
          {
          public int elf;
          public string hello;
          }
          }

The XML file that specifies the data that the Content Loader will read into the object would appear as:

XML
<?xml version="1.0" encoding="utf-8"?>
<XnaContent>
  <Asset Type="XMLTest.MyTest">
    <elf>23</elf>
    <hello>Hello World</hello>
  </Asset>
</XnaContent>

Example 2: Multiple Objects

This example demonstrates an XML file that defines an asset that is an array of objects.

Assume that the XML file is to define an array of data for the class that is defined as:

C#
namespace MyDataTypes
{
    public class CatData
    {
        public string Name;
        public float Weight;
        public int Lives;
    }
}

The XML file that specifies the data that the Content Loader will read into the object array would appear as:

XML
<?xml version="1.0" encoding="utf-8"?>
<XnaContent>
  <Asset Type="MyDataTypes.CatData[]">
    <Item>
      <Name>Rhys</Name>
      <Weight>17</Weight>
      <Lives>9</Lives>
    </Item>
    <Item>
      <Name>Boo</Name>
      <Weight>11</Weight>
      <Lives>5</Lives>
    </Item>
  </Asset>
</XnaContent>

Expand image See Also

Using an XML File to Specify Content
Adding Content to a Game


Sprite Font XML Schema Reference

Sprite Font XML Schema Reference
See Also Example
CollapseAll image

Describes the valid tags and values for Sprite-Font (.spritefont) XML files used by the Content Pipeline to create SpriteFont textures.

Tag name | Content type | Content description
<FontName> | string | The name of the font to be imported. This is not the name of a font file, but rather the friendly name that identifies the font once it is installed on your computer. You can use the Fonts folder in Control Panel to see the names of fonts installed on your system, and to install new ones as well. The Content Pipeline supports the same fonts as the System.Drawing.Font class, including TrueType fonts, but not bitmap (.fon) fonts.
<Size> | float | The point size of the font to be imported.
<Spacing> | float | The number of pixels to add between each character when the string is rendered.
<UseKerning> | Boolean | Specifies whether to use kerning information when rendering the font. Default value is true.
<Style> | Regular, Bold, Italic, or Bold Italic | The style of the font to be imported.
<DefaultCharacter> | char | The Unicode character to substitute any time an attempt is made to render characters that are not in the font. Specifying this element is optional.
<CharacterRegions> | One or more <CharacterRegion> tags | One or more numerical ranges indicating which subset of Unicode characters to import.
<CharacterRegion> | One <Start> and one <End> tag | The beginning and ending of a region of Unicode characters.
<Start> | char | The first Unicode character to include in a <CharacterRegion>.
<End> | char | The last Unicode character to include in a <CharacterRegion>.

Expand image Example

Here is a sample .spritefont file:

<?xml version="1.0" encoding="utf-8"?>

<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
  <Asset Type="Graphics:FontDescription">
    <FontName>Courier New</FontName>
    <Size>18</Size>
    <Spacing>0</Spacing>
    <UseKerning>true</UseKerning>
    <Style>Regular</Style>
    <CharacterRegions>
      <CharacterRegion>
        <Start>32</Start>
        <End>127</End>
      </CharacterRegion>
    </CharacterRegions>
  </Asset>
</XnaContent>

Expand image See Also

Concepts

Adding Content to a Game

Reference

SpriteFont


Loading Content from a Game Library

Demonstrates how to load content from a game library.

Loading Content from a Game Library

XNA Game Studio allows code and content to be run from Game Library projects that are added as references to Game projects. If you use a Game Library, you can embed binary resources directly in the Game Library and load them from within. This allows you to distribute code that displays textures, models, or fonts (such as a DrawableGameComponent) in a .DLL without distributing the .xnb files separately. Note that embedded resources are loaded into memory with the .DLL, and cannot be unloaded from main memory.

To add content to a Game Library

  1. Build an existing project containing the content you wish to add.
  2. In a library project, choose Add, New Item, and select "Resources File."
  3. If the Resource Designer is not opened automatically, double-click the .resx file in the Solution Explorer.
  4. From the Resource Designer, choose Add Resource, Add Existing File.

  5. Navigate to the "bin\x86\Debug\Content" directory of the project that built the content you wish to add.

    This assumes it was built as an x86 Debug project.

  6. Select the .xnb file for the content you wish to add to the library.

    Ensure the dialog box is displaying "All Files."

Once content has been added to the Resource Designer, any code running from within the Library can load the content with a special ContentManager.

To load content from a Game Library

  1. Define a new ContentManager.

  2. Create a new instance of the ResourceContentManager class and assign it to your ContentManager.

    The second parameter to the ResourceContentManager constructor identifies the resource project that contains your embedded resources.

  3. In the LoadContent method, load your content normally using your ContentManager.

Expand image See Also

Reference

Game Class
LoadContent
UnloadContent
Game Members
Microsoft.Xna.Framework Namespace


Content Compression

Content Compression

XNA Game Studio offers data compression—an easy way to decrease the size of certain built game assets such as textures, shaders, and meshes. Data compression reduces not only the size required for media storage and downloads, but also the deploy time required for debugging a game.

Transparent Compression

Compression and decompression of game assets is a transparent operation. You do not need to modify your game to use compressed data.

  • Compression occurs in the build as part of the Content Pipeline processes. It is performed automatically when you select the property in the Content Build page of the Project Designer.
  • Decompression occurs automatically when you access the assets through ContentManager.Load.

Compression Algorithm

The compression used by XNA Game Studio is a variant of the LZ family of compression algorithms, which is an efficient, lossless method. The ratio of compressed data to source data can vary significantly depending on the character of the source data. For most game asset types, the average compression ratio is about 60 percent.

The automatic compression algorithms do not compress source data that is small in size—less than one disk sector. Performance benefits of data compression typically are lost, or even made worse, by the execution overhead required for decompression. Assets are saved in an uncompressed format.

Disabling Compression

Some content types, such as Song Class and SoundEffect Class data, may not benefit from a general lossless compression algorithm. This is especially true if data is already compressed in a specialized format.

When implementing a custom content importer, compression can be disabled by overriding the method ContentTypeWriter.ShouldCompressContent, which must return false. If compression is permitted, no action is required. The base class definition of ContentTypeWriter.ShouldCompressContent returns true.

Expand image See Also

Adding Content to a Game


Parameterized Processors

Parameterized Processors

Describes how parameterized processors work in XNA Game Studio. Many of the standard Content Pipeline content processors shipped with XNA Game Studio support parameter usage. Parameterization makes any standard or custom processor more flexible and better able to meet the needs of your XNA Framework application. In addition to specifying values for standard parameters, you can easily implement parameter support for a new or an existing custom processor. For more information, see Developing with Parameterized Processors.

When you select a game asset, the Properties window displays the parameters for the related asset processor. Use the Properties window at any time to modify these parameter values.

Note
If you change the processor for a game asset to a different processor, all parameter values are reset to their default values. This means that if you modify the Generate Mipmaps parameter value for the TextureProcessor and then switch to a different processor (for example, FontTextureProcessor Class), the parameters switch to the default values for that processor. If you then swith back again, the modified values are reset to the default values of the original processor. The values do not revert to the modified values you set originally.

Standard Parameterized Processors

The following describes only standard processors that accept parameters, the parameter types, and their default value. For more information about all standard processors, see Standard Importers and Processors.

Friendly name Type name Input type Output type Description
Model ModelProcessor NodeContent Class ModelContent Class

A parameterized processor that outputs models as a ModelContent Class object.

Available parameters:

  • Color Key Color–Any valid Color. Magenta is the default value.
  • Color Key Enabled–A Boolean value indicating if color keying is enabled. The default value is true.
  • Generate Mipmaps–A Boolean value indicating if mipmaps are generated. The default value is false.
  • Generate Tangent Frames–A Boolean value indicating if tangent frames are generated. The default value is false.
  • Resize Textures to Power of Two–A Boolean value indicating if a texture is resized to the next largest power of 2. The default value is false.
  • Scale–Any valid float value. The default value is 1.0.
  • Swap Winding Order–A Boolean value indicating if the winding order is swapped. This is useful for models that appear to be drawn inside out. The default value is false.
  • Texture Format–Any valid value from TextureProcessorOutputFormat. Textures are either unchanged, converted to the Color format, or DXT Compressed.
  • X Axis Rotation–Number, in degrees of rotation. The default value is 0.
  • Y Axis Rotation–Number, in degrees of rotation. The default value is 0.
  • Z Axis Rotation–Number, in degrees of rotation. The default value is 0.
Sprite Font Texture FontTextureProcessor TextureContent Class SpriteFontContent

A parameterized processor that outputs a sprite font texture as a SpriteFontContent object.

Available parameters:

  • First Character–Any valid character. The space character is the default value.
Texture TextureProcessor TextureContent Class TextureContent Class

A parameterized processor that outputs textures as a TextureContent Class object.

Available parameters:

  • Color Key Color–Any valid Color. Magenta is the default value.
  • Color Key Enabled–A Boolean value indicating if color keying is enabled. The default value is true.
  • Generate Mipmaps–A Boolean value indicating if mipmaps are generated. The default value is false.
  • Resize to Power of Two–A Boolean value indicating if a texture is resized to the next largest power of 2. The default value is false.
  • Texture Format–Any valid value from TextureProcessorOutputFormat. Textures are unchanged, converted to the Color format, or DxtCompressed.

Texture Processing with XNA Game Studio

In XNA Game Studio 2.0 or earlier, the following standard processors were used for texture processing.

  • TextureProcessor
  • ModelTextureProcessor
  • SpriteTextureProcessor

In XNA Game Studio, the Texture - XNA Framework processor replaces the functionality of this entire group. For new XNA Game Studio projects and for projects converted by the Project Upgrade Wizard for XNA Game Studio 2.0, the correct processor is selected automatically. For existing custom processors that make calls to any processor from the list above, however, the code must be modified to use the new TextureProcessor with the proper parameters. The following describes the parameter values required for emulating each previous texture processor.

Processor type name Required parameters and values
TextureProcessor

Call the Texture (TextureProcessor) with the following parameter values:

  • GenerateMipmaps: false
  • Destination format: NoChange
  • Colorkey Enabled: false
  • Colorkey Value: Magenta
  • Resize: false
ModelTextureProcessor

Call the Texture (TextureProcessor) with the following parameter values:

  • Destination format: DXTCompressed
  • Colorkey Enabled: true
  • Colorkey Value: Magenta
  • Resize: false
SpriteTextureProcessor

Call the Texture (TextureProcessor) with the following parameter values:

  • Destination format: Color
  • Colorkey Enabled: true
  • Colorkey Value: Magenta

For more information about modifying and declaring parameter values programmatically, see Developing with Parameterized Processors.

Expand image See Also

Adding Content to a Game


Game Content Project

Game Content Project

A game content project contains the game assets (models, textures, sounds, and so on) used by the game projects in your solution. A game solution, which may contain multiple content projects, should contain at least one content project to specify and build game content. Game assets are added as project items to the content project by using either the standard Add New Item or Add Existing Item. Each item's properties (accessible in the Properties window) define how the content item is imported and processed by the Content Pipeline when building the game projects that use the assets.

Game content projects are assigned to game projects in the Content References node of each game project. In this way, content projects can be used to apply different collections of game assets to game projects intended for different platforms. The References node in the content project identifies the assemblies and projects containing the Content Pipeline importers and processors assigned to each game asset.

Caution
The Build Action property of any item moved into the content project is set automatically to Compile. This setting persists even if the same item later is moved out of the content project.

Content in Game Libraries

Classes and methods in game libraries may rely on specific content, such as textures and shaders, to perform game-related functions. Game libraries provide their own content subfolders that can contain those assets to ensure their availability.

When a game project includes a reference to a game library, a copy of the output of that game library is included in the output directory of the game project. In this way, both the game library's referenced assembly and its associated content are available at run time.

All content in the game content subproject of a successfully built game library is compiled through the Content Pipeline, just as the code of a game library is stored in its compiled form. This permits game projects that reference these reusable elements of the game library to build more quickly.

Content within a game library may be referenced directly by the game project. There is no requirement that the game library's classes or methods must reference the library's content.

Project Designer Properties

Project design properties are unavailable to game content projects. All changeable properties are in the Content Pipeline properties.

Content Pipeline Properties

The content project has additional properties (other than those available in the Project Designer tabs) that specify operating parameters for the XNA Framework Content Pipeline.

To access Content Pipeline properties

  1. In Solution Explorer, select the Content node.

  2. On the View menu, click Properties Window or press F4.

    The Properties window opens.

Content Root Directory

Specifies the name of the subdirectory that will hold the final output files of pipeline content generated from the project folder. This may be useful if your game project has multiple content projects and you wish to keep the output of each in different subdirectories.

Code-Only Builds

By manually editing a .csproj file, you can build your game project without also building the content project. If you are using XNA Game Studio, open the related .csproj file, and add the following property:

      <SkipNestedContentBuild>true</SkipNestedContentBuild>

If you are building from the command line, use the following command to skip the content project:

Msbuild /p:SkipNestedContentBuild=true WindowsGame1.csproj

For more information about using MSBuild with project files, see How to: Edit Project Files and Visual Studio Integration (MSBuild).

In addition, you can build only the content project from the command line by invoking MSBuild directly in the .contentproj file of your content project.

Expand image See Also

How to: Add a Game Content Project
Adding Art, Music, and Other Game Assets
Getting Started with XNA Game Studio Development


Game Content References

Game Content References

The content projects that you construct and add to in your XNA Game Studio solution identify and organize the art assets that can be used by your game. If you want your game to use these assets, the Content References node for the game project must include a reference to each asset.

When the game project is built, all assets within the referenced content projects are compiled, creating Content Pipeline objects that are appropriate for the game project's designated platform. This enables multiple game projects within a single solution (for example, Windows and Xbox 360 verions) to reference a common set of content projects.

To add a new content reference to your game project

  1. Open an XNA Framework game or library project in XNA Game Studio.
  2. In Solution Explorer, right-click the game project, and then click Add Content Reference.
  3. In the Add Content Reference dialog box, select one of the content folders offered on the Projects tab page.

Only content projects that are part of the game solution are listed in the Add Content Reference dialog box. To add an existing content project to a solution, see How to: Add a Game Content Project.

Expand image See Also

How to: Add a Game Content Project
Game Content Project
Adding Art, Music, and Other Game Assets
Getting Started with XNA Game Studio Development


How to: Add a Game Content Project

How to: Add a Game Content Project

When initially created, an XNA Game Studio solution contains a single content project to contain game assets to be managed through the Content Pipeline. It may be convenient to create and maintain additional content projects, perhaps to manage differing types or collections of content.

To add a new content project

  1. Open an XNA Framework game or library project in XNA Game Studio.
  2. In Solution Explorer, right-click the root solution node or any blank area.
  3. Click Add, and then click New Project.
  4. In the Add New Project dialog box, click Empty Content Project, and then enter the name for the new content project.

To add an existing content project

  1. Open an XNA Framework game or library project in XNA Game Studio.
  2. In Solution Explorer, right-click the root solution node or any blank area.
  3. Click Add, and then click Existing Project.
  4. In the file selection dialog box, navigate to the existing content project file, and then select it and click Open.

To remove a content project

  1. Open an XNA Framework game or library project in XNA Game Studio.
  2. In Solution Explorer, right-click the game content project.
  3. Click Remove.
Important

For assets your content project will use in the game, you must add references to the content project in the game projects that will use them. The procedure to add content references is described in the topic Game Content References.

Expand image See Also

Adding Art, Music, and Other Game Assets
Getting Started with XNA Game Studio Development


Game Asset Properties

Game Asset Properties

Describes property settings, indicating which actions the project system should perform on a game asset file of a supported type. For example, you can set file properties to indicate the importer and processor to be used for the game asset file.

Note
When adding a game asset of a type not recognized by XNA Game Studio, you need to modify the Content Processor and Content Importer properties (by specifying a custom processor and custom importer that build assets of this type) before the asset is built by the Content Pipeline.

To examine the properties of a game asset

  • In Solution Explorer, right-click the file, and then select Properties on the context menu. The Properties window appears.

In addition to the standard properties, XNA Game Studio content files have additional custom properties: Asset Name, Content Importer, and Content Processor.

Asset Name

The name of the managed object generated by the Content Pipeline from the game asset. At run time, this name is used to load the managed asset by using the ContentManager.Load method. The default name is the original file name without the file extension.

Content Importer

The name of the importer for the related game asset. The list contains both custom importers referenced by the content project and standard importers provided by XNA Game Studio.

Content Processor

The name of the processor for the related game asset. The list contains both custom processors referenced by the content project and standard processors provided by XNA Game Studio. Processors that have modifiable parameters are indicated with a small plus sign next to the Content Processor row. Clicking this expands the Content Processor row to display any supported parameters. Modify these paramter values as you would other properties in this pane. For more information about parameterized processors, see Parameterized Processors.

Expand image See Also

What Is Content?
Adding a Custom Importer
Getting Started with XNA Game Studio Development


Adding New Content Types

Adding New Content Types

The XNA Game Studio Content Pipeline builds game assets included in your project into a form your game can load at run time on Xbox 360, Windows, or Windows Phone devices.

This game asset build process is controlled by Content Pipeline importers and content processors. When you press F5 to build a game created with XNA Game Studio, the appropriate Content Pipeline importer and processor for each asset is invoked. Each asset then is automatically built into your game.

The flexibility of this process enables you to create and update game assets using a variety of digital content creation (DCC) tools. XNA Game Studio supplies importers for several popular export formats supported by DCC tools, and also lets you develop custom importers for other formats.

In This Section

What is the Content Pipeline?
Describes the components and execution flow of the XNA Game Studio Content Pipeline.
Content Pipeline Document Object Model
Describes the built-in object support features for assets in the Content Pipeline.
Loading Additional Content Types
Describes the options for customizing the Content Pipeline to support nonstandard game assets or special-purpose needs.
Creating a Custom Importer and Processor
Describes how a content importer adds support for a new art asset file format.
Tips for Developing Custom Importers and Processors
Provides useful information about how to design and debug a custom Content Pipeline importer or processor.
Adding a Custom Importer
Describes how to add a custom processor or importer to an existing game solution.
Extending a Standard Content Processor
Describes how XNA Game Studio lets you modify or extend the behavior of any standard Content Pipeline processor that ships with the product.
Developing with Parameterized Processors
Describes how developing with parameterized processors, both standard and custom, requires additional thought and care.
How to: Extend the Font Description Processor to Support Additional Characters
Describes the process of developing a custom content processor needed to add additional characters to a FontDescription object based on the text that is required by the game.

Expand image See Also

Concepts

Writing Game Code
Content Pipeline Content Catalog at XNA Creators Club Online


What is the Content Pipeline?

What is the Content Pipeline?
See Also
CollapseAll image

The XNA Game Studio Content Pipeline is a set of processes applied when a game that includes art assets is built. The process starts with an art asset in its original form as a file, and continues to its transformation as data that can be retrieved and used within an XNA Game Studio game through the XNA Framework Class Library.

The Content Pipeline is designed to be extensible, so that it can easily support new input file formats and new types of conversion.

Most XNA Game Studio developers can ignore the inner workings of the Content Pipeline. The most commonly used types of game assets and formats are inherently supported by XNA Game Studio. However, if you are a game developer who needs to support a new file format or game-engine capability, it is useful to understand the stages of the Content Pipeline that transform an asset from a digital-content creation (DCC) output file to part of the game binary.

Content Pipeline Components

A game asset is made available to an XNA Game Studio game after it is added to the Content project. Once the asset is part of the game solution, it is included in the Content Pipeline.

Here are the Content Pipeline processes.

Processes fall into two types depending on when they execute: design time components and runtime components.

Here is a summary of how the two components differ:

Activity | Design time | Runtime
Executes on | Development computer | Game device
Runs under | Visual Studio (on Windows) | Windows, Xbox 360, or Windows Phone
Uses framework | Content Pipeline Class Library | XNA library (redistributable)
Distributed with game? | No | Yes

Design-Time Components

The design-time components of the XNA Game Studio Content Pipeline that process your game assets execute within Visual Studio when you build your XNA Game Studio game as an executable file. These processes perform the initial transformation of an asset from its digital content creation (DCC) format to a managed code object that your game can use upon execution.

Design-time components use the Content Pipeline Class Library, which can be used and extended to create custom Content Pipeline design-time components.

Importer

An importer converts game assets from a particular DCC file format into objects in the XNA Game Studio Content Document Object Model (DOM) that standard content processors can consume, or into some other custom form that a particular custom processor can consume.

An importer typically converts content into managed objects based on the Content DOM, which includes strong typing for such assets as meshes, vertices, and materials. A custom importer, however, may produce custom objects for a particular custom content processor to consume.
Content processor

A processor takes one specific type of an imported game asset and compiles it into a managed code object that can be loaded and used by XNA Game Studio games on Windows, Xbox 360, or Windows Phone.

Each content processor acts upon a specific object type. For example, the Effect Processor accepts only EffectContent objects, representing a DirectX Effect asset.

When you include a game asset file in your XNA Game Studio solution's content project, its using dialog properties page specifies the appropriate importer and processor. Thereafter, when you build your game (by pressing F5), the assigned importer and processor for each asset is invoked automatically. The asset is built into your game in a form that can be loaded at run time by your game.

The managed code objects created by the content processor are serialized into a compact binary format (also referred to as an intermediate format) file with an .XNB extension by the Content Pipeline content compiler. This .XNB file is used by the runtime components of the Content Pipeline that assist your game in retrieving the transformed game assets.

The format of data in the .XNB file is tightly coupled to the XNA Framework. It is not designed for use by other runtime libraries.

Runtime Components

Runtime components of the Content Pipeline support loading and using the transformed game asset by your XNA Game Studio game. These components use the XNA library, which can be extended to create custom components.

Content Loader When the game needs the game asset's managed code object, it must call the ContentManager.Load method to invoke the content loader, specifying the object type it expects. The content loader then locates and loads the asset from the compact binary format (.XNB) file into the memory space of the game where it can be used.

Expand image See Also

Adding New Content Types
What Is Content?
Loading Additional Content Types


Content Pipeline Document Object Model

Content Pipeline Document Object Model

The XNA Game Studio Content Document Object Model (DOM) represents the set of built-in classes that can be consumed by standard content processors.

Currently, the DOM provides support for meshes, materials, textures, sprite-fonts, and animations. Outside of these, a custom importer can return a ContentItem with custom information in its opaque data, or a custom type you have developed.

The following diagram lists the complete Content DOM.

Expand image See Also

What Is Content?
What is the Content Pipeline?
Creating a Custom Importer and Processor
Extending a Standard Content Processor
Adding New Content Types


Loading Additional Content Types

Loading Additional Content Types

XNA Game Studio provides standard Content Pipeline components that import and process the most commonly used game asset file types. These file types include, for example, importers for the Autodesk (.fbx) format and the DirectX (.x) format. A complete list of file types is available in the Standard Importers and Processors topic. Most digital Content creation (DCC) tools are capable of creating output in at least one of these standard formats.

Choosing to Customize

A custom importer is required for game assets available only in formats unsupported by XNA Game Studio standard importers. One may already be available from a third party. Custom importers can be developed by DCC vendors, game-engine developers, and interested game hobbyists. Once a custom importer is installed on your computer, you can associate art files with the importer to invoke it when you build the art files (see Adding a Custom Importer).

You may need to write your own custom XNA Game Studio Content Pipeline components to:

  • Support a new type of game asset or format from a DCC tool.
  • Derive special-purpose content from another piece of content at the time the game is built.

Here are some typical scenarios, and a summary of which Content Pipeline components require customization.

Component When to customize Output options
Importer
  • A game asset created by a DCC tool is available only in a format unsupported by a XNA Game Studio standard importer.
  1. Content Document Object Model (DOM) object that can be consumed by a standard content processor.
  2. A custom object that must be consumed by a custom content processor.
Content processor
  • Must process the custom output of a custom importer.
  • Needs to process the output of a standard importer in a special-purpose way.
  1. A standard processor output type.
  2. A custom processor output type that must be consumed by a custom content loader at game run time.
Content loader

  • Must load custom output of a customized content processor.

  • A custom content loader is implemented by extending the ContentManager.Load method to load the new custom data type.

  1. A standard XNA Framework class object.
  2. A custom class object.

Customization Scenarios

This section examines some typical examples where customization is needed, and illustrates which Content Pipeline components must be changed.

Supporting a New File Format

In this example, a nonstandard file format contains information that can be represented by a standard Content DOM type.

As illustrated, only a custom importer that can read the nonstandard file format and output a Content DOM object (in this case, a TextureContent object) is required. The remainder of the Content Pipeline process can be performed by a standard content processor and content loader.

Creating Special-Purpose Data from Standard Objects

For this example, a texture object that represents a map of normalized vectors derived from the original texture object is created.

Since the texture is contained in a standard format for the game asset, a standard importer can be used to create the TextureContent object. A custom content processor (NormalMapProcessor) creates the special-purpose data, but uses the standard TextureContent class to contain the result so that it can be loaded by the standard content loader.

Supporting Custom Data from a Nonstandard Game Asset

Illustrated in this example is a nonstandard game asset file containing data that does not correspond to any standard data types.

To read the nonstandard game asset file, a custom importer is required that outputs a CustomContent object. Since the output of the importer is a custom class, a custom content processor also is needed, and the ContentManager.Load method must be extended to support the custom data object.

Expand image See Also

Adding New Content Types
What Is Content?
What is the Content Pipeline?


Creating a Custom Importer and Processor

Creating a Custom Importer and Processor

Describes how a content importer adds support for a new art asset file format.

You will need to write a new content importer to add support. Also, you may need to write a custom processor, writer, and reader for the new art asset type after it has been imported.

Complete Sample

This topic provides a simple example to demonstrate the steps needed to write an importer and processor, and also the writer and reader needed to save and load the results. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download CPExtPixelShader_Sample.zip

Overview

Most of the art, sound, or data assets that your game will use are likely in one of the commonly used file formats supported by the Standard Importers and Processors. A third party also may provide the custom importers and processors you need to support additional formats. In such cases, it is unnecessary to write your own custom importer or processor. However, if you need to support a new file format or data type in the Content Pipeline, writing your own importer and processor can be fairly straightforward.

The goal of the example in this tutorial is to import a pixel shader (in a file with the .psh extension), and to produce compiled effect data that can be assigned to an instance of Effect.

The sections below describe each step.

  • Creating a Content Pipeline Extension Library
  • Implementing a Simple Importer
  • Implementing a Processor
  • Implementing a Writer
  • Implementing a Reader for the Pixel Shaders
  • Using the Output of the New Processor in Your Game

Creating a Content Pipeline Extension Library

The first step in writing an importer and processor is to create a new project for them. You need to do this because your importer and processor are used by the Content Pipeline when your game is being built. They are not part of the game itself. As a result, you need to provide them as a separate library assembly that the Content Pipeline can link to when it needs to build the new file format you are supporting.

To create a Content Pipeline extension library

  1. In XNA Game Studio, load a game solution you are developing (the sample uses "CPExtPixelShader").

  2. In Solution Explorer, right-click the Solution node, click Add, and then click New Project.

    The Add New Project dialog box opens.

  3. In the Projects type pane under the Visual C# node, select XNA Game Studio 4.0 .

  4. In the Templates pane, select Content Pipeline Extension Library (4.0).

  5. Next, in the Name box, enter PSProcessorLib as the project name, and then click OK.

  6. In Solution Explorer, right-click the ContentProcessor1.cs item, and then click Delete.

    The remaining steps create a reference to the PSProcessorLib content extension project.

  7. In Solution Explorer, right-click the Content node of the CPExtPixelShader project, and then click Add Reference.

  8. On the Projects tab page, select your content extension project, and then click OK.

The new project is now ready for your custom importer and processor implementation.

Implementing a Simple Importer

The objective of the importer is to read asset data from the file in to memory for further conversion by the processor. The importer may also perform some intermediate data transformation if necessary.

In this example, the importer reads the pixel shader from the file. It also appends a technique declaration, which is given the same name as the file, as required to transform the shader into an effect.

Follow these steps to add a content importer to your processor.

To implement a simple importer

  1. Create a class to hold the input data you are importing.

    In this case, it takes the form of a string of high-level shader language (HLSL) source code.

  2. Add a new C# class named PSSourceCode to the processor project.

    The first thing to do in the file containing your new class definition is to add the following using statement at the beginning of the file:

    C#
    using Microsoft.Xna.Framework.Content.Pipeline;

  3. Next, define the class:

    C#
    class PSSourceCode
{
    const string techniqueCode = "{ pass p0 { PixelShader = compile ps_2_0 main(); } }";

    public PSSourceCode(string sourceCode, string techniqueName)
    {
        this.sourceCode = sourceCode + "\ntechnique " + techniqueName + techniqueCode;
    }

    private string sourceCode;
    public string SourceCode { get { return sourceCode; } }
}

  4. Write an importer class to import the HLSL source code.

    This class must be derived from ContentImporter and implement the Import method.

    The importer reads a text file containing HLSL source code into your PSSourceCode class. It also appends a technique declaration, which is given the same name as the file, as required to transform the shader into an effect.

  5. In the New Item dialog box, add a new Content Importer item named PSImporter to the processor project.

  6. Define the class next:

    C#
    [ContentImporter(".psh", DefaultProcessor = "PSProcessor",
      DisplayName = "Pixel Shader Importer")]
class PSImporter : ContentImporter<PSSourceCode>
{
    public override PSSourceCode Import(string filename,
        ContentImporterContext context)
    {
        string sourceCode = System.IO.File.ReadAllText(filename);
        return new PSSourceCode(sourceCode, System.IO.Path.GetFileNameWithoutExtension(filename));
    }
}

The ContentImporter attribute applied to the PSImporter class provides some context for the user interface of XNA Game Studio. Since this importer supports files with a .psh extension, XNA Game Studio automatically selects the PSImporter importer when a .psh file is added to the project. In addition, the DefaultProcessor argument specifies which processor XNA Game Studio selects when a .psh file is added.

Note
To specify multiple file types, separate with a comma the file extensions listed in the ContentImporterAttribute. For example, [ContentImporter (".bmp",".dds",".tga")] declares an importer that accepts .bmp, .dds, and .tga file types. Normally, an importer that accepts multiple file formats is specialized to generate one particular kind of output type, such as textures. Aside from difficulties of maintenance, there is nothing to prevent a single importer from being written to handle many different content types.

When the game is built, the ContentImporter.Import function is called once for each XNA content item in the current project.

When invoked against an input file in the appropriate format, a custom importer is expected to parse the file and produce as output one or more content objects of appropriate types. Since an importer's output is passed directly to a Content Pipeline processor, each type that an importer generates must have at least one processor available that can accept it as input.

Tip
An importer that generates Document Object Model objects may also automatically generate an intermediate XML cache file that serializes these objects. For this to happen, the importer must be implemented with the CacheImportedData attribute flag set to true. This flag is false by default. To set the attribute flag to true, begin the implementation of your importer class like this:
 [ContentImporter( ".MyExt", CacheImportedData = true )] class PSImporter :
        ContentImporter<PSSourceCode> { ... }

Implementing a Processor

After the new importer has read in the pixel shader source code from a text file, your content processor compiles the shader into binary form.

To write the processor

  1. Create a class to store the compiled output, which in this case takes the form of an array of bytes.

  2. Add a C# class named CompiledPS to the processor project, and then define the new class:

    C#
    class CompiledPS
{
    public CompiledPS(byte[] compiledShader)
    {
        this.compiledShader = compiledShader;
    }

    private byte[] compiledShader;
    public byte[] CompiledShader {
        get { return (byte[])compiledShader.Clone(); }
    }
}

    Now you are ready to write the processor class, which converts a PSSourceCode object into a CompiledPS object.

  3. In the New Item dialog box, add a new Content Processor item named PSProcessor to the processor project.

  4. Define the class:

    C#
    [ContentProcessor(DisplayName = "Pixel Shader Processor")]
class PSProcessor : ContentProcessor<PSSourceCode, CompiledPS>
{
    public override CompiledPS Process(PSSourceCode input,
        ContentProcessorContext context)
    {
       // Load the shader into an effect and compile it
        EffectContent content = new EffectContent();
        content.EffectCode = input.SourceCode;
        EffectProcessor compiler = new EffectProcessor();
        CompiledEffectContent compiledContent = compiler.Process(content, context);

        // Return the compiled effect code portion only
        return new CompiledPS(compiledContent.GetEffectCode());
    }
}

The processor uses the EffectProcessor class to compile the shader that our importer transformed in to an effect. The processor then returns the resulting binary code that can be used in an Effect class.

The context.TargetPlatform argument targets the platform. If an error occurs during compilation, PSProcessor throws an InvalidContentException. The error appears in the Error List window of XNA Game Studio.

Note

The example processor could, and perhaps should, return the full Effect class, making use of the standard writer and reader for that class that is part of the Content Pipeline library. However, because we wish to demonstrate writing a custom writer and reader, we have chosen to return only the compiled binary result within the Effect class.

Implementing a Writer

The final design-time class to implement is a writer that saves the compiled pixel shader effect produced by your processor as a binary .xnb file.

To implement the writer for the compiled shader effect

  1. In the New Item dialog box, add a new Content Type Writer item named PSWriter to the processor project.

  2. Define the new class:

    C#
    [ContentTypeWriter]
class PSWriter : ContentTypeWriter<CompiledPS>
{
    protected override void Write(ContentWriter output, CompiledPS value)
    {
        output.Write(value.CompiledShader.Length);
        output.Write(value.CompiledShader);
    }
    public override string GetRuntimeType(TargetPlatform targetPlatform)
    {
        return typeof(CompiledPS).AssemblyQualifiedName;
    }
    public override string GetRuntimeReader(TargetPlatform targetPlatform)
    {
        return "CPExtPixelShader.PSReader, CPExtPixelShader," +
            " Version=1.0.0.0, Culture=neutral";
    }
}

    The GetRuntimeType method identifies the type of object your game should load from the .xnb file written by the writer object. In this instance, the .xnb file contains the binary array from your custom CompiledPS type.

    The GetRuntimeReader method specifies what reader should be invoked to load the .xnb file in your game. It returns the namespace and name of the reader class, followed by the name of the assembly in which that class is physically located.

  3. In your code, change the assembly name to match the actual name of your game and its assembly, since that is where you will be loading the shaders.

    At this point, the code for your PSProcessorLib library is complete.

Implementing a Reader for the Pixel Shaders

Now move from the PSProcessorLib library project back to your game project, and write the class that your game uses to load the .xnb files that your processor creates. This is the class that your writer previously specified as its reader.

To implement a reader for the pixel shaders

  1. In your game project, add a C# class named PSReader to your game project.

  2. Add the using statements you will need at the top of the file:

    C#
    using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

  3. Deriving from the ContentTypeReader generic class , override the Read method, and define your class:

    C#
    class PSReader : ContentTypeReader<CompiledPS>
{
    /// <summary>
    /// Loads an imported shader.
    /// </summary>
    protected override CompiledPS Read(ContentReader input,
        CompiledPS existingInstance)
    {
        int codeSize = input.ReadInt32();
        byte[] shaderCode = input.ReadBytes(codeSize);

        IGraphicsDeviceService graphicsDeviceService =
          (IGraphicsDeviceService)input.ContentManager.ServiceProvider.
          GetService(typeof(IGraphicsDeviceService));
        return new CompiledPS(shaderCode);
    }
}

  4. At this point, build the processor project.

    When the build is complete you are ready to use the new importer and processor to build pixel shaders into your game.

Using the Output of the New Processor in Your Game

Try adding a test HLSL source file with a .psh extension to your game project and see how it works.

To test your output

  1. Copy into a folder in your game project a simple HLSL source file that you know is free of bugs, and rename the file "Ripple.psh."

  2. In Solution Explorer, right-click your game project, click Add, click Existing Item, and then click Ripple.psh.

  3. Right-click Ripple.psh, and click Properties.

    In the Properties dialog box, you should now see entries assigning PSImporter as its content importer and PSProcessor as its content processor. Next time you build your game, Ripple.psh will be built into TestShader.xnb in a form appropriate for your target platform.

  4. To use the resulting compiled pixel shader effect in your game, load it using ContentManager.Load as follows:

    C#
    protected override void LoadContent()
{
    CompiledPS shader = Content.Load<CompiledPS>("Ripple");
    Effect shaderEffect = new Effect(graphics.GraphicsDevice, shader.CompiledShader);
}

Expand image See Also

What Is Content?
What is the Content Pipeline?
Extending a Standard Content Processor
Adding New Content Types


Tips for Developing Custom Importers and Processors

Tips for Developing Custom Importers and Processors

The information provided should help when you develop Content Pipeline extensions.

Importing Basic Graphics Objects

The following information should help you import basic graphics objects.

  • Make your coordinate system right-handed.

    From the standpoint of the observer, the positive x-axis points to the right, the positive y-axis points up, and the positive z-axis points toward you (out from the screen).

  • Create triangles that have a clockwise winding order.

    The default culling mode removes triangles that have a counterclockwise winding order.

  • Call SwapWindingOrder to change the winding order of a triangle.

  • Set the scale for graphical objects to 1 unit = 1 meter.

  • Call TransformScene to change the scale of an object.

Taking Advantage of Content Pipeline Mesh Classes

There are several properties and classes that are particularly useful when using NodeContent objects to represent a 3D scene or mesh.

  • The NodeContent.Children property represents hierarchical information.

  • The NodeContent.Transform property contains the local transform of the 3D object.

  • The Pipeline.Graphics.MeshContent class (a subclass of Pipeline.Graphics.NodeContent) is used to represent meshes.

The Content Pipeline provides two classes that make it easier to create and work with Pipeline.Graphics.MeshContent objects.

  • The Pipeline.Graphics.MeshBuilder class creates new Pipeline.Graphics.MeshContent objects, when necessary.

  • The Pipeline.Graphics.MeshHelper class implements useful operations on existing Pipeline.Graphics.MeshContent objects.

Debugging Custom Importers and Processors

In a manner similar to projects that create a DLL, Content Pipeline extension projects cannot be directly run or debugged. After completing a few simple steps, however, you can debug any custom importer and processor used by your game. The following procedure details these steps.

Note
The Start External program control (located on the Debug page of a project's property pages) is unavailable in the Microsoft Visual C# Express Edition development environment.

To debug a custom importer or processor

  1. Load an existing XNA Game Studio Content Pipeline extension project (later referred to as ProjCP) containing the custom importers or processors to be debugged.

  2. Create a separate test game project (later referred to as "ProjG").

  3. In the References node of ProjG's nested content project, add a project-to-project reference to ProjCP.

  4. Add one or two appropriate items of test content to ProjG, and ensure they are set to use the importer or processor (in ProjCP) you wish to debug.

  5. Open the property pages for ProjCP.

  6. Click the Debug tab, and then select Start external program.

  7. Enter the path to the local version of MSBuild.exe.

    For example, C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild.exe.

  8. For the Command line arguments control, enter the path to ProjG's nested content project.

    If this path contains spaces, quote the entire path.

  9. Set any required breakpoints in the importer or processor code in ProjCP.

  10. Build and debug ProjCP.

Debugging ProjCP causes MSBuild to compile your test content while running under the debugger. This enables you to hit your breakpoints in ProjCP and to step through your code.

Expand image See Also

What Is Content?
What is the Content Pipeline?
Creating a Custom Importer and Processor
Extending a Standard Content Processor
Adding New Content Types


Adding a Custom Importer

Adding a Custom Importer

XNA Game Studio provides standard importers and processors for a number of common file formats used to store such basic game assets as models, materials effects, sprites, textures, and so on. For a list of file formats supported by these standard importers and processors, see Standard Importers and Processors.

Security Note
Before you open an existing project or component, determine the trustworthiness of the code outside of the Visual Studio designer. Opening projects or components in the Visual Studio designer automatically executes that code on your local machine in the trusted process of VCSExpress.exe or DevEnv.exe.

To add a custom importer or processor to a game project

This procedure assumes you have copied the new importer or processor to a local folder in the game project.

  1. Open XNA Game Studio.
  2. Load the solution associated with your game.
  3. In Solution Explorer, right-click Content, and then click Add Reference.
  4. Navigate to the directory containing the assembly with the custom importer or processor, and then add it to the solution.
  5. Save the solution.

The new importer or processor now appears as a choice in using dialog properties for importing or processing a newly added game asset.

Expand image See Also

Adding New Content Types
Standard Importers and Processors


Extending a Standard Content Processor

Extending a Standard Content Processor

Describes how XNA Game Studio lets you modify or extend the behavior of any standard Content Pipeline processor that ships with the product. See Standard Importers and Processors for a description of standard processors.

Because there are so many asset variants supported by different digital content creation (DCC) tools, it is often useful to be able to modify how one of the standard processors operates. The following examples illustrate some of the kinds of things you might want to do.

Note
The following code samples are provided only for demonstration. Most of the functionality described is already available by using parameters on a standard processor.

Adding a Scaling Operation to a Processor

There are many reasons why you might want to modify the existing functionality of a standard processor. Here is one example. If your source assets and your game are at different scales, you may want the processor to scale each model automatically at build time. You can implement such automatic scaling by overriding the Process method of the ModelProcessor class, which generates a Model. In the override, you first scale the entire scene, and then invoke the base class functionality to process as usual.

The following code illustrates this technique:

[ContentProcessor]
class ScalingModelProcessor : ModelProcessor
{
    public override ModelContent Process(
        NodeContent input, ContentProcessorContext context )
    {
        MeshHelper.TransformScene( input, Matrix.CreateScale( 10.0f ) );
        return base.Process( input, context );
    }
}

Generating Additional Data

In some cases, you may want to add information to a game asset that a standard processor would not. For example, if a custom effect you want to apply requires tangent or binormal data, you can extend the standard model processor to build this additional data into the asset. To do this, you override the Process method of the ModelProcessor class. In the override, navigate the NodeContent hierarchy of the game asset, and call CalculateTangentFrames for each MeshContent object you find.

The following code shows how to do this:

[ContentProcessor]
class ModelProcessorWithTangents : ModelProcessor
{
    public override ModelContent Process( NodeContent input, ContentProcessorContext context )
    {
        GenerateTangentFramesRecursive( input );
        return base.Process( input, context );
    }

    private void GenerateTangentFramesRecursive( NodeContent node )
    {
        MeshContent mesh = node as MeshContent;
        if (mesh != null)
        {
            MeshHelper.CalculateTangentFrames( mesh, VertexChannelNames.TextureCoordinate( 0 ),
                VertexChannelNames.Tangent( 0 ), VertexChannelNames.Binormal( 0 ) );
        }

        foreach (NodeContent child in node.Children)
        {
            GenerateTangentFramesRecursive( child );
        }
    }
}

Changing the Processors Called for Child Objects

Another useful technique is to override a standard processor, and to change how child objects are processed just by changing the processors they use.

Consider, for example, the hierarchy of calls through which textures in a model are processed:

  • The standard ModelProcessor.Process method is called to process a NodeContent object that represents the root of a scene.
  • ModelProcessor.Process in turn calls the ModelProcessor.ConvertMaterial method once for every MaterialContent object used in the scene.
  • ModelProcessor.ConvertMaterial in turn invokes the MaterialProcessor.Process method on the MaterialContent object passed to it.
  • MaterialProcessor.Process in turn calls the MaterialProcessor.BuildTexture method once for each texture in the MaterialContent.Textures collection in the MaterialContent object passed to it.
  • MaterialProcessor.BuildTexture in turn invokes the ModelTextureProcessor.Process method on the TextureContent object passed to it.

One reason you may want to change how this works is that the ModelTextureProcessor.Process method applies DXT1 or DXT5 compression to all textures it processes. If textures in your game assets are compressed already, you may want to avoid a second compression.

To prevent compression of textures during processing

Here is how to prevent compression from being applied to model textures during processing.

  1. Create an override of the standard MaterialProcessor.BuildTexture method, and invoke the TextureProcessor.Process method, which does no compression, instead of ModelTextureProcessor.Process.
  2. Create an override of ModelProcessor.ConvertMaterial that invokes your override of MaterialProcessor.BuildTexture instead of the standard one.

The first of these overrides could be coded as:

[ContentProcessor]
class NoCompressionMaterialProcessor : MaterialProcessor
{
    protected override ExternalReference<TextureContent> BuildTexture(
        string textureName, ExternalReference<TextureContent> texture, ContentProcessorContext context )
    {
        return context.BuildAsset<TextureContent, TextureContent>( texture, "TextureProcessor" );
    }
}

There are several things to note about this code.

  • An ExternalReference is an asset object that is shared between multiple classes, such as a diffuse texture used by more than one material. When such an asset is specified, the Content Manager loads only one copy of the ExternalReference at run time and builds it only once, no matter how many references there are to it.
  • The ContentProcessorContext BuildAsset method lets you invoke a processor by name to build the content in an object.
  • Although textureName, the first argument to BuildTexture, is ignored in the override above, you could use it if you wanted to process textures differently depending on normal maps or other criteria.

Given the processor created by your first override above, you could code the second override:

[ContentProcessor]
class NoCompressionModelProcessor : ModelProcessor
{
    protected override MaterialContent ConvertMaterial(
        MaterialContent material, ContentProcessorContext context )
    {
        return context.Convert<MaterialContent, MaterialContent>(
            material, "NoCompressionMaterialProcessor" );
    }
}

Because this override is processing MaterialContent objects in memory rather than ExternalReference objects, it uses the ContentProcessorContext.Convert function instead of BuildAsset to invoke the processor created by your first override.

After building and installing your new NoCompressionModelProcessor (see Adding a Custom Importer), you can assign it to any models whose textures are already compressed and no further compression is applied.

Expand image See Also

Concepts

Adding New Content Types
What Is Content?
What is the Content Pipeline?
Standard Importers and Processors
Adding a Custom Importer
Content Pipeline Content Catalog at XNA Creators Club Online


Developing with Parameterized Processors

Developing with Parameterized Processors

Describes how developing with parameterized processors, both standard and custom, requires additional thought and care. This topic discusses a method for programmatically modifying existing parameter values, and for adding new parameters to your own processors.

Programmatically Setting Parameter Values

When you need to pass parameter values from one processor to another (also referred to as chaining), use the BuildAsset and BuildAndLoadAsset methods. Pass the parameter and its value using the ProcessorParameters argument of the respective function. For example, a custom model processor would invoke a second processor for model textures with a call to BuildAsset and pass any parameter values in the ProcessorParameters argument.

The following code example demonstrates this technique. First, add several parameters to a data dictionary:

      //create a dictionary to hold the processor parameter
      OpaqueDataDictionary parameters = new OpaqueDataDictionary();

      //add several parameters to the dictionary
      parameters.Add( "ColorKeyColor", Color.Magenta );
      parameters.Add( "ColorKeyEnabled", true );
      parameters.Add( "ResizeToPowerOfTwo", true );

After adding the necessary parameters, pass the dictionary to the chained processor:

      context.BuildAsset<TextureContent, TextureContent="">(
      texture, typeof( TextureProcessor ).Name,
      parameters,
      null,
      null );

This call passes all parameters (stored in parameters) to a texture processor.

Again, any parameters not recognized by the receiving processor are ignored. Therefore, if the parameter ColorKeyCode is entered into the dictionary as ColourKeyCode, it is ignored by the receiving processor.

Declaring Process Parameters

Adding one or more parameters to your custom processor requires additonal code in your processor's definition. Parameters support the following types:

  • bool
  • byte
  • sbyte
  • char
  • decimal
  • double
  • float
  • int
  • uint
  • long
  • ulong
  • short
  • ushort
  • string
  • enum
  • Vector2, Vector3, and Vector4
  • Color

Parameters of other types are ignored by the processor.

Tip
Apply the Browsable attribute (with a value of false) to an individual parameter to prevent that parameter from being displayed in the Properties window.

The following code example defines a simple custom processor that switches the coordinate system of a model using a single parameter (called switchCoordinateSystem):

      public class SwitchCoordSystemProcessor : ModelProcessor
      {
      #region Processor Parameters
      private bool switchCoordinateSystem = false;

      [DisplayName("Switch Coordinate System")]
      [DefaultValue(false)]
      [Description("Switches the coordinate system of a model.")]
      public bool SwitchCoordinateSystem
      {
        get { return switchCoordinateSystem; }
        set { switchCoordinateSystem = value; }
      }
      //additional class code follows...

In this code, the SwitchCoordSystemProcessor class is derived from ModelProcessor. This indicates that the processor accepts a model as input. The next few lines declare a single property called SwitchCoordinateSystem of type bool. Note that every parameter must have a set method. The property also has several attributes applied to it:

Attribute name | Usage
DisplayName | Name of the property when it appears in the Properties window of XNA Game Studio. If not specified, the internal property name, declared in the source code, is used. For this example, "Switch Coordinate System" would be displayed.
DefaultValue | A user interface (UI) hint specifying the possible default value of the property. This value is used only as a UI hint; it will not be set on the property, nor will it override the default value declared in the code.
Description | Descriptive text displayed when you select the property in the Properties window of XNA Game Studio.

This completes the definition of the SwitchCoordinateSystem property.

In the next code example, the class definition is continued with an override of the Process method:

      //additional class code precedes...

      public override ModelContent Process(NodeContent input, ContentProcessorContext context)
      {
        if (switchCoordinateSystem)
        {
          Matrix switchMatrix = Matrix.Identity;
          switchMatrix.Forward = Vector3.Backward;
          MeshHelper.TransformScene(input, switchMatrix);
        }

        return base.Process(input, context);
      }

This code passes the SwitchCoordinateSystem property (declared earlier) value to TransformScene, which is a helper method that applies a transform to a scene hierarchy.

Expand image See Also

Adding New Content Types
Parameterized Processors


How to: Extend the Font Description Processor to Support Additional Characters

How to: Extend the Font Description Processor to Support Additional Characters
See Also
CollapseAll image

Describes the process of developing a custom content processor needed to add additional characters to a FontDescription object based on the text that is required by the game.

In a font description (.spritefont) file, the <CharacterRegions> area can be used to add additional characters to a font description. This enables you to use a SpriteFont to render an additional range of characters.

For some languages, this approach is not ideal. For example, Chinese and Japanese both have many thousands of characters. Adding the full range of characters to <CharacterRegions> dramatically increases the size of the font asset and the time required to build the font asset. A better solution adds individual characters whenever the specific characters are needed. You can create a custom content processor to implement this solution.

In this example, a file called messages.txt contains all the text rendered by the game. The custom processor adds all the characters contained in the text in this file to a FontDescription. Then it processes the object in the standard way using the base FontDescriptionProcessor functionality. All the characters in messages.txt will then be available to the SpriteFont object at run time.

Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download CPFontProcessor_Sample.zip.

Using the Font Description Processor

To specify the character regions and messages to process

  1. To add a new Sprite Font called DefaultFont to a game project, go to Solution Explorer, right-click the nested Content node, click Add, and then click New Item.

  2. To add the new sprite font to the game, select the Sprite Font template, and then click Add.

  3. Modify this file to use an existing font and any additional characteristics you prefer.

    For more information, see Sprite Font XML Schema Reference.

  4. Add a file named messages.txt to the game project.

  5. Right-click on the game project node in Solution Explorer, click Add, and then click New Item.

  6. Select the Text File template, enter messages.txt for the file name, and then click Add to add the text file to the game.

  7. In the new text file, enter any messages that will be printed by the font described in the Sprite Font file.

    Caution
    We will use the method File.ReadAllText to read the text in this file. This method requires a carriage return ("\r") or line feed ("\n") after the last string, so be sure to follow the last line of text in the file with a carriage return or line feed.

To create the new content processor project

The Content Pipeline is part of the build process, and it is separate from your game code. Therefore, you need to create a new assembly that contains the code developed in this topic. Creating this new assembly project is the first step in developing a new processor.

Note
It is assumed that you have an existing game project that you will modify. For the purposes of this example, the game project is called "FontGame."

  1. To add the new processor project to the game solution, go to Solution Explorer, right-click the Solution node, click Add, and then click New Project.

  2. In the dialog box, select the Content Pipeline Extension Library (4.0) template, enter FontProcessor in the Name field, and then click OK. The new project automatically contains references to the XNA Framework run-time and design–time Content Pipeline assemblies.

To extend the font processor

  1. Add the following lines of code, after the last using statement:

    C#
    using System.IO;
using System.ComponentModel;

  2. In ContentProcessor1.cs, remove the placeholder code that assigns the processor input (TInput) and output (TOutput) types. It will not be needed.

  3. Using attributes, add a processor parameter to the beginning of the class declaration.

    This parameter stores the name of the text file that stores the messages displayed by the game.

    C#
    [DefaultValue("messages.txt")]
[DisplayName("Message File")]
[Description("The characters in this file will be automatically added to the font.")]
public string MessageFile
{
    get { return messageFile; }
    set { messageFile = value; }
}
private string messageFile = "messages.txt";

  4. Change the derivation of ContentProcessor1 from ContentProcessor to FontDescriptionProcessor.

  5. Modify the Process method override to match the following code:

    C#
    public override SpriteFontContent Process(FontDescription input, ContentProcessorContext context)

    This modification replaces the template parameter and return types with the proper types needed for the extended font processor.

  6. Register a Content Pipeline dependency on messages.txt.

    This dependency tells the Content Pipeline that if messages.txt changes, the font must be rebuilt.

    C#
    string fullPath = Path.GetFullPath(MessageFile);

context.AddDependency(fullPath);

  7. Read the contents of the file, and add each letter to the input font one by one. Note that the Characters collection keeps track of duplicates automatically. It is not necessary for the user to make sure that each letter is added only once. The Characters collection will contain only one instance of each character, no matter how many times Add has been called.

    C#
    string letters = File.ReadAllText(fullPath, System.Text.Encoding.UTF8);

foreach (char c in letters)
{
    input.Characters.Add(c);
}

    In this example, messages.txt has been saved with Unicode UTF-8 encoding, which is why this encoding format is specified in the call to File.ReadAllText. The default file encoding format for text files that have been added to a Visual Studio project is Western European (Windows) encoding, corresponding to code page 1252. If your text file uses the default encoding, specify the character encoding as follows:

    string letters = File.ReadAllText( fullPath, System.Text.Encoding.GetEncoding( 1252
            ) );

  8. Call the existing Process method of the base FontDescriptionProcessor to build the font with the newly requested characters.

    C#
    return base.Process(input, context);

To associate the custom font processor with the sprite font

  1. Compile the solution to build MyFontProcessor.

    Now you need to add your custom font processor as an available content processor for the game.

  2. From Solution Explorer, right-click the Content node, and then click Add Reference.

  3. From the Projects tab, select your content extension project (FontProcessor) node, and click OK.

    To ensure that the processor project is always up to date when the main game is built, you need to create a project dependency.

  4. In Solution Explorer, right-click the game project (FontGame) node, and then click Project Dependencies.

  5. Select the check box next to FontProcessor, and then click OK to add a new dependency so that FontGame depends on FontProcessor.

  6. Change the content processor for the .spritefont file from Sprite Font Description - XNA Framework to the newly created processor.

  7. Select the .spritefont file, and then in the Properties window, choose your custom processor from the drop-down list associated with the ContentProcessor field.

When you build the solution, the new processor adds the characters in the messages.txt file to the list of characters available to the SpriteFont.

Tip

To debug a Content Pipeline importer or processor, add the following line to the processor code to launch the debugger.

System.Diagnostics.Debugger.Launch();

Expand image See Also

XNA Game Studio 4.0
Extending a Standard Content Processor
Adding New Content Types


Packing and Distributing Your Game

Packing and Distributing Your Game

When you've created something incredible and want to show it off to others, XNA Game Studio makes it easy.

The XNA Creators Club offers the best way to share your game with a large community of gamers, to get feedback, and to build enthusiasm for your game.

There are a variety of ways to share and distribute your game.

  • For all platforms, you can use the XNA Game Studio Package utility (xnapack.exe) to create a special package that other XNA Game Studio users can unpack and play. Using this utility allows you to share your game without exposing your source code or assets to other XNA Game Studio users.

    You can share Xbox 360 games packaged in this format with XNA Creators Club members through the XNA Creators Club Online for peer review, and possible listing on Xbox LIVE Marketplace.

    You can share Windows Phone games packaged in this format through Windows Phone Marketplace for possible listing.

  • For all platforms, you can choose to share your source code and assets with other XNA Game Studio users. This is useful if you would like someone to review or modify your code or assets.
  • For Windows games only, you can make your game available to any Windows user by distributing your completed game executables, along with a set of prerequisite software (called "redistributables"). All Windows users can play your game, even if they do not have XNA Game Studio installed on their computer.

Sharing options available based on the design platform are identified next.

Option | Platform
Windows-based computer | Xbox 360 | Windows Phone
To share with XNA Game Studio users

  • See Sharing Your Game Package

  • See Sharing Your Source Code and Assets

  • See Sharing Your Game Package

To share with Windows user

  • See Distributing Your Finished Windows Game

To share with XNA Creators Club members

  • See Sharing Your Game Package

  • See Sharing Your Source Code and Assets

To share through Xbox LIVE Marketplace (after approval)

  • See Sharing Your Game Package

To share through Windows Phone Marketplace (after approval)

  • See Sharing Your Game Package

For more information, see the topics listed In This Section. There is infromation about each sharing and distribution type, including how to prepare your game to be shared or distributed, and how to play a game someone has shared with you.

In This Section

Sharing Your Game Package
Describes how to distribute your game to other XNA Game Studio users in a package that protects your source code and assets.
Sharing Your Source Code and Assets
Presents information about sharing your game's source code and assets with other XNA Game Studio users.
Distributing Your Finished Windows Game
Presents information about how to share your game with any Windows user, even if the user does not have XNA Game Studio installed.
XNA Game Studio Package Utility
Describes the XNA Game Studio package utility.


Sharing Your Game Package

Sharing Your Game Package

Describes how to distribute your game to other XNA Game Studio users in a package that protects your source code and assets.

Quick Information

Platform Source code visible Format Windows user requirements Xbox 360 user requirements Windows Phone user requirements
Windows, Xbox 360, and Windows Phone No .ccgame XNA Creators Club Game Package
  • Must have XNA Game Studio installed.
  • Must have XNA Game Studio installed.
  • Must have an active membership in XNA Creators Club.
  • Must have XNA Game Studio installed.
  • Must have an active membership in the Windows Phone Marketplace.

If you would like to share your XNA Game Studio game with other XNA Game Studio users, but do not want to share your source code and assets, you can use the XNA Game Studio package utility (xnapack.exe). The package utility can be used from within supported versions of Microsoft Visual Studio tools, or from the command line.

You can share Xbox 360 games packaged in this format with XNA Creators Club members through the XNA Creators Club website for peer review and possible listing on the Xbox LIVE Marketplace.

Note
Currently, only Xbox 360 games can be shared through XNA Creators Club.

You can share Windows Phone games packaged in this format through Windows Phone Marketplace for possible listing.

There are two fundamental ways that a game package can be used:

  • Sharing a Game with Another User
  • Sharing a Game from Another User

Sharing with Another User

The XNA Game Studio package utility compresses your game's built executable and assets into a special compressed format that other XNA Game Studio users can open and play. You can package only XNA Game Studio game projects. The package utility does not support XNA Game Studio library projects.

To package your game using the XNA Game Studio package utility from the Visual Studio development environment

  1. In XNA Game Studio, open the project you want to package.

  2. On the Build menu, click Package [projname] as XNA Creators Club Game, where [projname] is the name of the current project.

    The output window indicates the status of the packing operation. If the packing operation is successful, the package file is created with a .ccgame extension and placed in the appropriate output folder of the project. For example, the package file for the release version of your Windows game would be located in the bin\x86\Release folder. This example assumes the default project settings have not been modified.

You may share this .ccgame file with other XNA Game Studio users. It is a compressed version of your project that contains no source code or source assets. Other users can play it, but are unable to view or modify your source files.

To package your game using the XNA Game Studio package utility from the command line

  1. To open an XNA Game Studio command line, open the Start menu, click XNA Game Studio 4.0, select Tools, and then click XNA Game Studio Command Prompt.
  2. From the command line, use the cd command to change the active folder to the appropriate output folder of the project you want to package.

  3. Enter a packing command using the syntax required by the XNA Game Studio package utility.

    The following example packs a Windows game named MyWinGame and suppresses the logo and copyright messages.

    xnapack MyWinGame.exe /nologo

    The command-line window indicates the current status of the packing operation. If the packing operation is successful, you created the package file with a .ccgame extension, and it is placed in the same folder as the startup assembly.

After you pack a game, you can share the .ccgame file with other XNA Game Studio users. It is a compressed version of your project that contains no source code or source assets. Other users can play it, but are unable to view or modify your source files.

Sharing from Another User

When you receive a .ccgame file from another XNA Game Studio user, you can unpack it by using either the graphical unpacking utility or the command-line utility.

Consider the following before unpacking.

  • XNA Game Studio must be installed.

  • Unpacking a .ccgame file automatically deploys the assets and game assembly to the target platform.

    • For a Windows project, you must have the same version of the XNA Framework installed with which the .ccgame file was built.
    • For an Xbox 360 project, you must have at least one Xbox 360 console specified already in XNA Game Studio Device Center, a valid XNA Creators Club membership, and XNA Game Studio Connect running on the Xbox 360 console to which you are deploying the assets and game assembly.
    • For a Windows Phone project, you must have at least one Windows Phone digital media device connected.

To unpack a packaged game from Windows Explorer

  1. From Windows Explorer, double-click the .ccgame file you want to unpack.

    A dialog box appears.

  2. Click Unpack to begin the unpacking process.

  3. When the unpacking process is complete, the next step depends on the platform.

    • For a Windows project, a folder containing the game executable opens in Windows Explorer. Run the game by double-clicking the executable.
    • For an Xbox 360 project, you can run the game from the Game Library.
    • For a Windows Phone project, you can run the game from the Games list.
Caution
If the intended destination of an unpacked game already exists, the XNA Game Studio package utility deletes the existing destination and its contents. It then creates a new container or folder containing the contents of the new game package. This applies to games targeting Windows, Xbox 360, and Windows Phone platforms.

To unpack a packaged game from the command line

  1. To open an XNA Game Studio command prompt, on the Start menu, click XNA Game Studio 4.0, click Tools, and then click XNA Game Studio Command Prompt.
  2. From the command line, use the cd command to change the active folder to the folder containing the appropriate package.

  3. Enter an unpacking command using the syntax required by the XNA Game Studio packing utility.

    The following example unpacks an XNA Creators Club game package containing a Windows game called MyWinGame, and suppresses all non-error messages.

    xnapack unpack MyWinGame-Windows.ccgame /quiet

  4. When the unpacking process is complete, the next step depends on the platform.

    • For a Windows project, a folder containing the game executable opens in Windows Explorer. Run the game by double-clicking the executable.
    • For an Xbox 360 project, you can run the game from the Game Library on your Xbox 360 console.
    • For a Windows Phone project, you can run the game from the Games list on your Windows Phone device.
Caution
If the intended destination of an unpacked game already exists, the XNA Game Studio package utility deletes the existing destination and its contents. It then creates a new container or folder containing the contents of the new game package. This applies to games targeting Xbox 360, Windows Phone, and Windows platforms.

Expand image See Also

Sharing Your Source Code and Assets
Distributing Your Finished Windows Game


Sharing Your Source Code and Assets

Sharing Your Source Code and Assets

Presents information about sharing your game's source code and assets with other XNA Game Studio users.

Quick Information

Platform Source code visible Format Windows user requirements Xbox 360 user requirements Windows Phone User requirements
Windows, Xbox 360, and Windows Phone Yes .zip or other compressed format
  • Must have XNA Game Studio installed.
  • Must have XNA Game Studio installed.
  • Must have an active membership in the XNA Creators Club.
  • Must have XNA Game Studio installed.

Sharing your entire project, including source code and content, is useful when you want other users to review your code or content, or to make modifications. In some cases, however, you may not want others to see your source code or assets. If you want feedback on gameplay or existing game art, and do not explicitly need your code to be reviewed, consider using the method described in Sharing Your Game Package.

Sharing with Another User

To share your project, including source code, with an XNA Game Studio user

  1. In XNA Game Studio, open the project you want to share.

  2. On the Build menu, click Clean Solution.

    This removes any built and intermediate files, leaving only the source code and assets. If you do not have this menu item, see "Cleaning the Solution Before You Build" in Deploying an Xbox 360 Game.

  3. Open Windows Explorer, and then select the folder that contains the project you want to share.

  4. Right-click the project folder in Windows Explorer, click Send To, and then click Compressed (zipped) Folder.

The compressed file is ready to share.

Sharing from Another User

To open a project with source code as an XNA Game Studio user

  1. Upon receiving a compressed file with source code and assets, extract the contents to a folder.

    Tip
    If it is a .zip file, you can right-click the file in Windows Explorer, click Open With, and then click Compressed (zipped) Folders to begin the extraction process.
  2. After the files are extracted, start XNA Game Studio.
  3. In XNA Game Studio, on the File menu, click Open Project.
  4. Use the dialog box to locate the project folder you specified in Step 1, and then select the .csproj file.
  5. Click Open.

The project is loaded into XNA Game Studio and ready for viewing or modification.

Expand image See Also

Sharing Your Game Package
Distributing Your Finished Windows Game


Distributing Your Finished Windows Game

Distributing Your Finished Windows Game

Presents information about how to share your game with any Windows user, even if the user does not have XNA Game Studio installed.

Quick Information

Platform Source code visible Format Windows user requirements
Windows No Setup.exe and manifest, or .zip or other compressed format.
  • Must be running, at minimum, Windows XP Service Pack 2.
  • Must have a video card that supports, at minimum, Shader Model 1.1.
Important

Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

Also, the XNA Framework Redistributable file does not contain the Content Pipeline Build Runtime. Building content at run time is supported only when XNA Game Studio has been installed on the Windows-based development computer.

If you would like to share your XNA Game Studio game with other Windows users, but do not want to share your source code and assets, you can create an installable package that contains your game binaries and the necessary redistributable files.

The ClickOnce publishing feature of Visual Studio provides a convenient way to produce a portable installation package for distribution on a CD, Web site, or other media.

Sharing with Another Windows User

You may package XNA Game Studio game projects for use without XNA Game Studio installed only for the Windows platform.

You can use one of the following methods to create a portable install package:

Using ClickOnce Deployment
You can use the ClickOnce feature of Visual Studio to build and create an installation package for your XNA Game Studio game. This method automatically ensures that all required supporting files are included in your installation package.
Using Another Installation Package Tool
You can use an installation package tool of your choice. With this method, you must take more care to include all of the required supporting files for an XNA Game Studio game.

Using ClickOnce Deployment

ClickOnce is a deployment technology that allows you to create self-updating Windows-based applications that can be installed and run with minimal user interaction.

To build a ClickOnce installation package

  1. In Solution Explorer, select the game project for the Windows platform to which you want to deploy.

  2. On the Build menu, click Publish.

    The Publish Wizard appears.

  3. On the Where do you want to publish the application? page, enter the path or FTP location where the application will be deployed.

    The default location is a folder named "publish" below the project's folder.

  4. Click Next to continue.
  5. On the How will users install the application? page, select the From a CD-ROM or DVD-ROM option (the default) if that is your choice, and then click Next to continue.

  6. On the Where will the application check for updates? page, select an update option:

    • If the application checks for updates, click The application will check for updates from the following location, and enter the location where updates will be posted. This can be a file location, website, or FTP Server.
    • If the application will not check for updates, click The application will not check for updates.
    • Click Next to continue.
  7. Click Finish to deploy the application.

Visual Studio builds your XNA Game Studio game project and, if successful, deploys your application to the location specified in step 3. A Windows Explorer window then opens to show the Setup.exe file produced and the manifest.

The ClickOnce feature for XNA Game Studio automatically includes all of the required software packages as part of the installation package.

An alternate method of initiating ClickOnce is through the Publish properties of the Project Designer. These properties can be accessed by double-clicking the Properties item in Solution Explorer or by clicking [project name] Properties on the Project menu, and then clicking the Publish tab. This tab provides the facility to set several more options, including the version number of the deployed application.

If you wish to distribute your game on a CD, use a CD-Rewriter or DVD-Rewriter to copy the files from the specified location to a CD-ROM or DVD-ROM.

Special Considerations for Game Data Files

Your game may require the use of a data file to read and store information. For example, the starter kit provided with XNA Game Studio uses an XML file to read and store game settings. Other games may use a text file or other format.

The default behavior of the ClickOnce publishing wizard assigns any XML, text, or other data files in a project to "Data File" as its Publish Status. However, this status is for files containing data used by the installer package, not for files accessible to your game when it executes. Files assigned to this type will be placed in the path denoted in the .NET Framework's ApplicationDeployment.DataDirectory property.

This is likely to be inconvenient, as the file will be inaccessible to your game through conventional storage APIs. The recommended actions to correct this are as follows:

  1. Ensure the Build Action property of the data file is set to "Content." This specifies that the data file is to be included in the install package.
  2. Reassign the Publish Status to "Include."

The Build Type setting may be changed through the file's property window.

The Publish Status is changed through the Application Files dialog box of the Publish properties section of Project Designer.

To change the publish status

  1. In Solution Explorer, double-click the Properties item of your project.
  2. Navigate to the Publish tab in Project Designer.
  3. Click the Application Files button.
  4. Select the drop-down box in the Publish Status column of the dialog box to change the setting.
  5. Click OK.

Using Another Installation Package Tool

To use an installation package tool other than ClickOnce, you will need to build your game binaries and include the required software packages.

To compile your game binaries for distribution with another installation package tool

  1. In XNA Game Studio, open the project you want to package.

  2. On the Build menu, click Build Solution.

    This creates the necessary files needed to run your game on other computers.

  3. Using an installation package tool of your choice, package all files located in the appropriate output directory of your project.

Required Software Packages

In addition to the requirements listed in the previous table, there are additional software prerequisites that must be installed on a player's machine if the computer does not have XNA Game Studio installed.

The following software packages must be installed on the player's computer in order for your game to run.

  • The .NET Framework 4.0 Redistributable.

  • The XNA Framework Redistributable 4.0.

    Tip
    You can verify that your game was built with the XNA Framework 4.0 by loading your project in XNA Game Studio, and then by clicking the project node in Solution Explorer. The XNA Framework Version property is visible in the property pane.

    To determine whether the player already has the redistributable installed, use the Windows Installer function MsiQueryProductState with the product code for the version of the redistributable that you want to verify. The following table lists the product code for the XNA Framework Redistributable 4.0.

    Redistributable version corresponding to | Product code
    XNA Game Studio 4.0 | 2BFC7AA0-544C-4E3A-8796-67F3BE655BE9

    An alternative to checking the product code for the version of the XNA Framework Redistributable for XNA Game Studio 4.0 is to check the registry for the following value:

    [HKEY_LOCAL_MACHINE\Software\Microsoft\XNA\Framework\v4.0]
Installed=1

  • The following files from the DirectX 9.0c Redistributable.

    • OCT2006_d3dx9_31_x86.cab
    • APR2007_d3dx9_33_x86.cab
    • APR2007_xinput_x86.cab
    • Mar2009_xact_x86.cab
    • Mar2009_XAudio_x86.cab
    • Mar2009_X3DAudio_x86.cab
    • DSETUP.dll
    • dsetup32.dll
    • DXSETUP.exe
    • dxupdate.cab

    These files are installed automatically as part of the XNA Framework Redistributable install package for XNA Game Studio 4.0. You do not need to perform a separate install step when you create games with this version of XNA Game Studio.

Expand image See Also

Sharing Your Source Code and Assets
Sharing Your Game Package


XNA Game Studio Package Utility

XNA Game Studio Package Utility

The XNA Game Studio package utility compresses your game's built executable and assets into a special compressed format that other XNA Game Studio users can open and play. You may package only XNA Game Studio game projects. The package utility does not support XNA Game Studio library projects.

  • Using Xnapack to Package a Game
  • Using Xnapack to Unpack a Packaged Game

Using Xnapack to Package a Game

xnapack assembly [platform] [/archive:] [/nologo] [/output:file] [/quiet] [/thumbnail:file]

Option | Description
assembly | The startup assembly of your project. This is the .exe built by your XNA Game Studio project.
[platform] | Deprecated and optional. Specifies the platform for which the project is built. This value can be Windows, Xbox360, or Zune, and must match your game's project type.
/archive: | Specifies an archive file (for example, a Windows Phone .xap file) that contains the complete game package. By default, all files at the same location as the startup assembly will be included in the created package. This option limits the package to the specified archive file. (Short form: /a:)
/nologo | Suppresses logo/copyright messages.
/output:file | Specifies the path and file name of the output file. By default, your game is created in the same folder as the startup assembly with the same name. (Short form: /o:)
/quiet | Suppresses all non-error messages.
/thumbnail:file | Specifies the path to an optional thumbnail that is displayed with your game. (Short form: /th:) For a Windows game, this thumbnail appears in the graphical unpacking utility. For an Xbox 360 game, the thumbnail also appears in the Game Library. For a Windows Phone game, the thumbnail appears in the Games list.

The following example packs a Windows game called MyWinGame and suppresses the logo/copyright messages.

xnapack MyWinGame.exe /nologo

Using Xnapack to Unpack a Packaged Game

xnapack unpack package [platform] [/listplatforms] [/listtargets] [/nologo] [/platform:name] [/quiet] [/run] [/showui] [/target:name]

Option Description

package

An XNA Framework game package, previously created with the XNA Game Studio package utility.

If the game is intended for the Xbox 360 console, see Connecting to Your Xbox 360 Console with XNA Game Studio 4.0 for information about adding registered consoles to your computer.

[platform]

 Deprecated and optional. Specifies the platform for which the project is built. This value can be Windows, Xbox360, or Zune, and must match your game's project type.

/listplatforms

Lists the platforms that support the XNA Creators Club game package.

/listtargets

 Lists the platform instances for a given platform. Must be used with /platform option.

/nologo

Suppresses logo/copyright messages.

/platform:name

 Specifies the platform to which the game package is being deployed. Required if the package supports more than one platform and the target cannot be resolved.

/quiet

Suppresses all non-error messages.

/run

 Runs the game once installation is complete. Applies only to Xbox 360 and Windows Phone games.

/showui

Displays the user interface for confirming and copying files.

/target:name

Specifies the named platform instance to which the game package is being deployed. If no platform instance is specified, the default target is used. For a list of available targets, use the /listtargets option.

Note

For Windows Phone game packages, the default target is the Windows Phone emulator that is installed as part of the Microsoft Windows Phone Developer Tools. To deploy to a Windows Phone device, use this option to specify the device.

The following example unpacks an XNA Creators Club game package containing a Windows game called MyWinGame, and suppresses all non-error messages.

xnapack unpack MyWinGame-Windows.ccgame /quiet


Advanced Topics

Advanced Topics

Describes how XNA Game Studio provides numerous feature extensions to Visual Studio and Visual C# Express to help create eye-popping games.

This section discusses the special features of the XNA Game Studio development environment.

In This Section

How to: Create a Localized Game
Describes the process of creating an XNA Game Studio game that can be localized.
Game Studio Features
Describes features and usage of XNA Game Studio.
Extending Game Studio
Describes how XNA Game Studio can be customized to support special functions to aid development of games.
FuelCell Example Game
Discusses the FuelCell 3D game tutorial.

Expand image See Also

Getting Started with XNA Game Studio Development


How to: Create a Localized Game

How to: Create a Localized Game

A localized game is one in which the UI displays alternative sets of text that are appropriate to the language and culture of the gamer.

This tutorial demonstrates methods that allow a game to display differing UI text according to the platform's current culture setting stored in CultureInfo. It also demonstrates how to extend the Content Pipeline so that the minimum number of additionally required font characters are included in the game executable for the localized text.

For more detailed information about localization issues, see How to: Build a Localized Application for Windows Phone.

  • Complete Sample
  • Creating Resource Files
  • Extending the Content Pipeline
  • Associating Localization Data and Processors With Fonts
  • Using Localized Strings in the Game

Complete Sample

The code in the topic shows you the technique for creating a game that can be localized. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Localization_Sample.zip

Creating Resource Files

A localized game should maintain its resources in resource (.resx) files in the game's code project. The game should maintain at least one resource file for every language/culture it is to support. Each resource file defines identifiers for each localizable UI string in the game, with a localized version of that string for the intended language/culture. In this way, localization can be maintained independently from coding.

To create resource files

  1. In Solution Explorer, right-click the code project node, select Add, and then click New Item.

  2. In the Add New Item dialog box, select the resources file, and rename it as appropriate, for example, Strings.resx.

    This file will contain the resources for the default language for the application.

  3. Identify strings in your application and add them to the resource file.

    Each string has a name, a value, and an optional comment. The name must be unique so make it as descriptive as possible. The value is the string to be displayed in the application to the user. Adding a comment is useful, especially in large resource files as a reminder of the purpose of the string and later as information for the translator to understand the correct context.

    Figure 1. An example of English language strings for the Strings.resx resource file

  4. Add a new resource file to your project for each language/culture the application will support.

    Note

    Each resource file must follow the naming convention:

    name of the resource file for the default language.culture name

    An example of this format is MyStrings.fr.resx, where the culture name—fr in this instance—is derived from the CultureInfo class.

    As shown in the next figure, the strings defined for the resource file must have the same set of identifying names as defined in the default resource file.

    Figure 2. An example of French language strings for the resource file Strings.fr.resx

    Figure 3. An example of strings in the Japanese language resource file Strings.ja.resx

Windows Phone Specific Information

To deploy resource files, Windows Phone developers must add values to the <SupportedCultures> element in the Visual Studio Project file (.csproj) for the Windows Phone game. For more information about how to use <SupportedCultures>, please see How to: Build a Localized Application for Windows Phone.

  1. Close the Visual Studio Project file (.csproj) for the Windows Phone game project, then open the project file in a text editor.

  2. Locate the <SupportedCultures> element and set the value to a semicolon delimited list of all supported cultures for the game. The default UI culture does not need to be included in this tag. For example:

    <SupportedCultures>ja-jp</SupportedCultures>

Extending the Content Pipeline

To accommodate a localized game, you need to create a new Content Pipeline Library Extension project to process the resource files and fonts.

The new content library extension must extend the FontDescription class to support a list of the resource files that later will be included in the .spritefont file.

You also will need to create a new content processor that extends FontDescriptionProcessor to process the resource file list, and to include the required characters in the built game executable.

To create a Content Pipeline Extension Library project

  1. On the File menu, click New Project.

  2. Select the Content Pipeline Extension Library (4.0) project type.

  3. In the Name box, type the name for the new library project.

    You might name the project LocalizationPipeline for example.

  4. Click OK to create and load the new project.

To extend the FontDescriptor class

You will add a new file to contain the new class.

  1. In Solution Explorer, right-click the newly created Content Pipeline Library Extension project, select Add, click New Item, and then select Class.

    Assign the new file a name such as LocalizedFontDescription.cs.

  2. In the new class file, declare a new class (for example, LocalizedFontDescription) that derives from FontDescription.

    C#
    class LocalizedFontDescription : FontDescription

  3. Within the class, define a new ResourceFiles property.

    This action results in recognition of a ResourceFiles element in the .spritefont XML file, which will contain the list of resource files.

    C#
    [ContentSerializer(Optional = true, CollectionItemName = "Resx")]
public List<string> ResourceFiles
{
    get { return resourceFiles; }
}

List<string> resourceFiles = new List<string>();

To extend the FontDescriptionProcessor class

A new file to contain the new FontDescriptionProcessor class will be added.

  1. In Solution Explorer, right-click the content pipeline extension project, select Add, click New Item, and then select Class.

    Assign the new file a name, such as LocalizedFontProcessor.cs.

  2. In the new class file, declare a new class (for example, LocalizedFontProcessor) that derives from ContentProcessor, and specifies the new LocalizedFontDescription class as input.

    C#
    [ContentProcessor]
class LocalizedFontProcessor : ContentProcessor<LocalizedFontDescription,
                                                SpriteFontContent>

    Within the class, override the Process with the new LocalizedFontDescription class as input.

    C#
    public override SpriteFontContent Process(LocalizedFontDescription input,
                                          ContentProcessorContext context)

  3. In the new Process method, step through the ResourceFiles property of the LocalizedFontDescription object to load each declared resource file.

    C#
    foreach (string resourceFile in input.ResourceFiles)
{
    string absolutePath = Path.GetFullPath(resourceFile);

    // Make sure the .resx file really does exist.
    if (!File.Exists(absolutePath))
    {
        throw new InvalidContentException("Can't find " + absolutePath);
    }

    // Load the .resx data.
    XmlDocument xmlDocument = new XmlDocument();

    xmlDocument.Load(absolutePath);

  4. For each resource file, scan each string and add found characters to the LocalizedFontDescription object.

    C#
    // Scan each string from the .resx file.
foreach (XmlNode xmlNode in xmlDocument.SelectNodes("root/data/value"))
{
    string resourceString = xmlNode.InnerText;

    // Scan each character of the string.
    foreach (char usedCharacter in resourceString)
    {
        input.Characters.Add(usedCharacter);
    }
}

  5. Using AddDependency, mark that the font should be rebuilt if the resource file changes.

    C#
    context.AddDependency(absolutePath);
  6. Use the FontDescription class to build the font.
    7. C#
        return context.Convert<FontDescription,
                           SpriteFontContent>(input, "FontDescriptionProcessor");
}

Associating Localization Data and Processors With Fonts

Now that project data is divided into resource files, and has a custom content processor to consume it, the parts need to be bound together to help them work. This is accomplished by providing extended information in a .spritefont file, and binding the file to the custom content processor.

To extend the .spritefont file

Create a new .spritefont file.

  1. In Solution Explorer, right-click the content project node, select Add, and then click New Item.

  2. In the Add New Item dialog box, select "Sprite Font," and then in the Name box, enter a name (for example, Font.spritefont) for the new file.

  3. Click Add to create the new file.

  4. Double-click the newly created file to open it for editing.

  5. Change the asset type declaration to reference the previously created extended FontDescriptor class.

    <Asset Type="LocalizationPipeline.LocalizedFontDescription">

  6. Add a block within <ResourceFiles> tags that lists each resource file using the <Resx> elements.

    The example tags below specify resource files for the default language, as well as for Danish (da), French (fr), Japanese (ja), and Korean (ko).

    <ResourceFiles>
   <Resx>..\Strings.resx</Resx>
   <Resx>..\Strings.da.resx</Resx>
   <Resx>..\Strings.fr.resx</Resx>
   <Resx>..\Strings.ja.resx</Resx>
   <Resx>..\Strings.ko.resx</Resx>
</ResourceFiles>
  7. Save the file.

To assign the cusom content processor to the .spritefont file

  1. Compile the solution to build the Content Pipeline Extension Library project.

  2. In Solution Explorer, right-click the project, and then click Add Reference.

  3. In the Add Reference dialog box, click the Projects tab, and then select the previously created Content Pipeline Extension Library project (for example, LocalizationPipeline).

  4. Click OK.

  5. In the content project, right-click the .spritefont file, and then select Properties.

  6. In the resulting Properties pane, choose your custom processor (for example, LocalizedFontProcessor) from the drop-down list associated with the ContentProcessor field.

Using Localized Strings in the Game

The localized strings will be available in your game as a class with the same name as the base file name of the resource file for the default language (for example, Strings).

Setting the Culture property of this class from the CultureInfo.CurrentCulture property will cause the correct language version of the localized strings to be loaded according to the platform's current culture setting.

C#
Strings.Culture = CultureInfo.CurrentCulture;

Expand image See Also

Extending a Standard Content Processor
Adding New Content Types
XNA Game Studio 4.0


Game Studio Features

Game Studio Features

Describes features and usage of XNA Game Studio.

In This Section

Project Properties
Describes the unique property settings of Project Designer in XNA Game Studio.
Expert Settings
Describes how to enable expert settings features in Microsoft Visual Studio 2010 Express for Windows Phone.
Visual Studio Unsupported Features
Describes the features of Visual Studio that are not supported for XNA Game Studio.
Visual Studio Differences Between Game Platforms
Describes the differences in the appearance and behavior of the integrated development environment (IDE) of XNA Game Studio when developing for the Xbox 360 or Windows Phone.


Project Properties

Project Properties

Describes the unique property settings of Project Designer in XNA Game Studio.

Topics in this section describe the special project designer properties of the XNA Game Studio development environment.

In This Section

XNA Game Studio Properties Page
Enables the user to change profile and other properties for the current XNA Game Studio project.
Content Build Page, Project Designer
Describes how you can use the Content Build page of the Project Designer to specify the build configuration properties for the content project.

Expand image See Also

Advanced Topics
Getting Started with XNA Game Studio Development


XNA Game Studio Properties Page

XNA Game Studio Properties Page

Enables the user to change profile and other properties for the current XNA Game Studio project.

You open the XNA Game Studio Properties page from Project Designer. Open Project Designer by double-clicking the Properties item in Solution Explorer or by clicking [project name] Properties on the Project menu. Then click the XNA Game Studio tab.

Selecting the Game Profile

The Game Profile selection specifies the hardware feature set for which the game will be built.

The available options are:

  • Use Reach to access a limited API set supported by Windows Phone, Xbox 360, and Windows.
  • Use HiDef to access the complete API (including features unavailable for Windows Phone).

The default setting will be the default profile for the target platform. If the platform does not support multiple profiles, this section is disabled.

For further information on game profiles, see the topic What Is a Profile?.

Setting a Game Thumbnail

The Game Thumbnail box enables you set the thumbnail image that appears beside your game on the game device (such as Xbox 360 or Windows Phone) when people are selecting games to play, and on Windows when people are selecting a game to unpack. This image is distinct from the Windows icon.

There are several things to keep in mind when you specify a thumbnail for your game.

File Requirements

  • The image must be saved as a .png file.
  • If the largest dimension of the image you provide is not exactly 64 pixels, the image will be scaled so that its aspect ratio remains the same and its largest dimension becomes exactly 64 pixels. Such scaling can produce results you might not expect. If you provide an image whose largest dimension is already exactly 64 pixels, you can avoid scaling.
  • If you do specify an image that needs to be scaled, it must be smaller than 2,048 pixels by 2,048 pixels in size, and the .png file that contains it must be smaller than 16 KB in size.

File Location

  • The thumbnail file must be specified in the game project. Files specified in the game content subproject will not be recognized as thumbnails.
  • The Game thumbnail drop-down menu lists all files with a .png extension that have been added to your project, regardless of each file's size or resolution.
  • You can also browse for any other .png files accessible from your machine by clicking the ... button beside the Game thumbnail drop-down menu. When you select a file from the browse dialog box, that file is added to your project and is set as the game thumbnail.

Setting Tile Properties

The tile properties define what is displayed when the Windows Phone application appears in the Start menu of the Windows Phone device. These are different from what it is displayed in the Windows Phone Game menu.

Note
These properties are only valid for a Windows Phone project. The property settings are not displayed for projects designated for other platforms.

Tile Title

Specifies the text that is displayed for the game when it appears in the Windows Phone Start menu.

The default string is the project name.

Tile Image

Specifies the image that is displayed for the game when it appears in the Windows Phone Start menu.

The image must be .png file, containing a graphic that is 173 pixels x 173 pixels.

The default image is "Background.png".

Setting the Game Startup Type

The Game Startup Type box specifies the initial type (object) for the game program that will be called when the game starts.

The default startup type is the Game1 object of the game's primary namespace (Microsoft.XNA.Framework.Game), as defined in the standard templates for an XNA Game Studio game.

If your game requires the use of a different startup type other than the default, you may select it in this property. For the startup type to appear in the drop-down list, it must be a public type derived from Microsoft.XNA.Framework.Game, and contain no private default constructor.

If no valid startup type exists, or if you select "Not Set" in this property when multiple valid startup types exist, you will get an error when you build the game.

Expand image See Also

Advanced Topics
Developing Xbox 360 Games
Developing Windows Phone Games


Content Build Page, Project Designer

Content Build Page, Project Designer

Describes how you can use the Content Build page of the Project Designer to specify the build configuration properties for the content project.

This page applies to XNA Game Studio projects only.

Content Build Compression

The following options enable you to configure settings for the build process of data in the content pipeline.

Compress content pipeline output files

Produce compressed output when processing content project data to reduce content size.

The defaults for this option vary according to the platform type and build configuration:

 | Windows | Xbox 360 | Windows Phone
Debug | Off | On | Unsupported
Release | On | On | Unsupported

Expand image See Also

Content Compression
XNA Game Studio Properties Page
Application Page, Project Designer (C#)
Developing Xbox 360 Games


Expert Settings

Expert Settings

This topic explains how to enable additional toolbars and menus disabled in the default installation of Microsoft Visual Studio 2010 Express.

Enabling Features

Editions of Microsoft Visual Studio Express install with different default settings than the fully featured editions of Visual Studio. These settings limit the immediate availability of menus and toolbars. Some useful features remain present in these editions, but they must be enabled to be viewed.

Note

This information applies only to editions of Microsoft Visual Studio 2010 Express, which includes Microsoft Visual Studio 2010 Express for Windows Phone that is installed as part of the Microsoft Windows Phone Developer Tools.

To enable Expert Settings

  • On the Tools menu, select Settings, and then Expert Settings.

Figure 1. Tools menu to select Expert Settings

After Expert Settings are enabled, the Build menu is visible. This menu offers options to Build, Rebuild, Publish, and Package your game.

It also makes visible the configuration drop-down list box.

Figure 2. Configuration drop-down list box

Adding Solution Platforms

The Solution Platforms drop-down list box can be useful when developing cross-platform games. This tool allows you to limit your build and deploy for a single platform within a solution that supports more than one.

To add the Solution Platforms drop-down list box

  1. Enable Expert Settings as described in the previous procedure.

  2. On the Tools menu, select Customize.

    The Customize property sheet opens.

  3. Click the Commands tab, click Toolbar, and then select Standard in the drop-down list box.

  4. Click Add Command.

    The Add Command dialog box is launched.

  5. In the Category pane, select Build, and then in the Commands pane select Solution Platforms at the bottom of the list.

  6. Click OK.

  7. If desired, use the Move Up and Move Down buttons to position the drop-down within the toolbar.
  8. Click Close.

Expand image See Also

Game Studio Features


Visual Studio Unsupported Features

Visual Studio Unsupported Features

Describes the features of Visual Studio that are not supported for XNA Game Studio.

The following Microsoft Visual Studio items are not supported for XNA Game Studio projects:

  • Creating or running Visual Studio Team System 2010 Test Edition unit tests for an Xbox 360 or Windows Phone Game project. For this reason, the Create Unit Tests… command is hidden in the Code Editor context menu.
  • Adding Windows Form, User Control, or Component classes to an Xbox 360 or Windows Phone Game project. For this reason, these options are not available from the Project context menu.
  • Adding service references to an XNA Game Studio project. For this reason, the Add Service Reference command is not available from the References context menu or the Project context menu.
  • Adding Web references to an XNA Game Studio project. For this reason, the Add Web Reference command is not available from the References context menu or the Project context menu.
  • Adding data sources. Data sources are not supported on the Xbox 360 or Windows Phone platforms. For this reason, the Data menu is hidden when an Xbox 360 or Windows Phone Game project is active.
  • Publishing the project using the Visual Studio Publish command. This command is available from the Build menu for Windows projects only, as described in the topic Distributing Your Finished Windows Game. This command is not available for projects on the Xbox 360 or Windows Phone platforms. You should use the Deploy command instead. For more information on deployment, see Deploying an Xbox 360 Game.

Expand image See Also

Visual Studio Differences Between Game Platforms
Advanced Topics
Developing Xbox 360 Games


Visual Studio Differences Between Game Platforms

Visual Studio Differences Between Game Platforms

Describes the differences in the appearance and behavior of the integrated development environment (IDE) of XNA Game Studio when developing for the Xbox 360 or Windows Phone.
  • Assembly Information Dialog Box
  • XNA Game Studio Device Management Toolbar
  • Add Reference Dialog Box
  • Add New Item Dialog Box
  • Project Properties

Assembly Information Dialog Box

You can open the Assembly Information dialog box from the Application page in the Project Designer.

To open the Project Designer

  1. Perform one of the following steps:

    • Under the project node in Solution Explorer, double-click the Properties folder.

      -or-

    • From the Project menu, select [project name] Properties.

  2. On the Application page, click Assembly Information.

Use this dialog box to change the assembly information for the current project. This information includes the game title, company name, copyright, and trademark, plus a brief description. When the game is installed on the target device (such as an Xbox 360 console or Windows Phone device), some of this information will be displayed in the game selection interface for that device.

The assembly information specified here only affects the values seen in the Xbox 360 Dashboard's Game Library if the project is a game project. Assembly information of library projects is not used when deploying or displaying information about a game.

Title

This field specifies a title for the assembly manifest, and is required to deploy a game to a game device. On most game devices, only the first 25 characters of this field are visible.

On the Xbox 360 console, the title appears in the Game Library.

On Windows Phone devices, the title appears in the Games list.

Description

This field specifies an optional description for the assembly manifest. Only the first 300 characters of this field are visible.

On the Xbox 360 console, the description appears in the Game Library.

On Windows Phone devices, the description appears after you select the game from the Games list.

Company
Specifies a company name for the assembly manifest.
Product
Specifies a product name for the assembly manifest.
Copyright
Specifies a copyright notice for the assembly manifest.
Trademark
Specifies a trademark for the assembly manifest.
Assembly Version
Specifies the version of the assembly.
File Version
Specifies a version number that instructs the compiler to use a specific version for the Win32 file version resource (Windows projects only).
GUID
Specifies a unique GUID that identifies the assembly. When you create a project, Visual Studio generates a GUID for the assembly.
Neutral Language
Specifies which culture the assembly supports.
Make Assembly COM-Visible
Specifies whether types within the assembly will be accessible to COM (Windows projects only).

Platform Differences Summary

These are the differences in operation of the Assembly Information dialog box for specific platforms:

Platforms Differences
Xbox 360, Windows Phone
  1. The File Version field is not available.
  2. The Make Assembly COM-Visible check box is not available.

XNA Game Studio Device Management Toolbar

You can use the XNA Game Studio Device Management toolbar to maintain a list of one or more external game devices (such as Xbox 360 consoles or Windows Phone devices) available for deployment. It is available when you load a game project or game library project in supported versions of Visual Studio tools.

For more information, see:

  • Using XNA Game Studio Device Center
  • "Managing Several Xbox 360 Consoles with XNA Game Studio Device Center" in Deploying an Xbox 360 Game

Platform Differences Summary

These are the differences in operation of the Assembly Information dialog box for specific platforms:

Platforms | Differences
Xbox 360, Windows Phone | The XNA Game Studio Device Management toolbar is available.

Add Reference Dialog Box

Use the Add Reference dialog box to add component references required by your project. Because the Xbox 360 and Windows Phone platforms do not have the same feature set as the Windows platform, the COM tab is hidden and the .NET tab contains only Xbox 360 or Windows Phone-specific assemblies. These assemblies include:

  • Microsoft.Xna.Framework
  • Microsoft.Xna.Framework.Game
  • mscorlib
  • system
  • system.core
  • system.xml
  • system.xml.linq

These assemblies are added automatically to an Xbox 360 or Windows Phone project.

To open the Add References dialog box, right-click the References item in Solution Explorer, and then click Add Reference.

Caution
The Projects tab lists all projects in the solution, regardless of platform. The assemblies in the Browse and Recent tabs may also include references to assemblies that are not for the project's platform. Projects must only reference assemblies that are intended for their platform. For example, Xbox 360 projects do not support references to assemblies that target platforms other than Xbox 360, nor do Windows Phone projects support assemblies that do not target Windows Phone.

Platform Differences Summary

These are the differences in operation of the Assembly Information dialog box for specific platforms:

Platforms Differences
Xbox 360, Windows Phone
  1. The COM tab is not available.
  2. The .NET tab contains only Xbox 360 or Windows Phone-specific assemblies.

Add New Item Dialog Box

You can open the Add New Item dialog box by right-clicking the solution in Solution Explorer, or by selecting it from the Project menu. Use this dialog box to add new Xbox 360 or Windows Phone–supported items. This list contains the following items.

  • C# Class
  • C# Interface
  • C# Code File
  • XML File
  • XML Schema
    Note
    This option is available only in Microsoft Visual Studio.
  • Text File
  • Assembly Information File

  • Resources File

    Caution
    The string resource type is the only built-in resource type supported by Xbox 360 or Windows Phone projects. Adding other resource types such as bitmaps or icons to a resource file may result in compilation errors.
  • Class Diagram
    Note
    This option is available only in Microsoft Visual Studio.
  • Game Component
  • Content Type Reader

The Assembly Information File template for Xbox 360 or Windows Phone projects excludes the AssemblyFileVersion attribute. Neither the Xbox 360 platform nor the Windows Phone platform support this attribute.

Project Properties

Project properties are grouped into pages in the Project Designer. You can access the Project Designer in the Project menu by clicking Properties, or by double-clicking the Properties item in Solution Explorer. The Project Designer property pages are located in the same middle pane used by the code editor.

  • On the Application page, the Target Framework drop-down list box is disabled for Xbox 360 and Windows Phone projects.
  • On the Build page:
    1. The Platform target drop-down menu has been disabled in supported versions of Microsoft Visual Studio tools.
    2. The Allow unsafe code property is disabled for Windows Phone.
  • On the Content Build page, the Compress content pipeline output files check box is disabled for Windows Phone projects.
  • The Debug page has been modified for Xbox 360 and Windows Phone game projects. The Start Action and Enable Debuggers options have been disabled. The Working Directory, Use Remote Machine, and Enable the Visual Studio hosting process controls have also been disabled.
  • The Settings project property page allows you to add a settings file to your Xbox 360 or Windows Phone project. However, note that the settings file is not supported for Xbox 360 or Windows Phone projects.
  • The Security and Publishing pages are hidden.

Expand image See Also

Visual Studio Unsupported Features
Advanced Topics
Developing Xbox 360 Games


Extending Game Studio

Extending Game Studio

Describes how XNA Game Studio can be customized to support special functions to aid development of games.

This section discusses extending the special features of the XNA Game Studio development environment.

In This Section

Registering Assemblies
Describes how to register new assemblies so they are displayed in the Add Reference dialog box.
Accessing Custom Item Templates
Describes how to access custom item templates.
Game Component Development
Describes how to use XNA Game Studio to develop custom game components for your game projects.
Game Studio Automation Extenders
Describes DTE extenders to support automation in XNA Game Studio.

Expand image See Also

Advanced Topics


Registering Assemblies

Registering Assemblies

If you created additional assemblies that can be used to develop XNA Game Studio games, you may wish to make them available to other developers. To display these assemblies as choices in the Add Reference dialog box, you must add additional information to the Windows registry.

To register assemblies

  1. Register a new subkey in the Windows registry. The subkey must be a unique name and registered under the the key that applies to the target platform for which the assembly is built.

    The following keys are registered on a Windows 32-bit operating system.

    Platform | Registry key
    Windows | HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\VersionMinimum\AssemblyFoldersEx
    Xbox 360 | HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\XNA\AssemblyFolders\v4.0\Xbox 360\AssemblyFoldersEx
    Windows Phone | HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\XNA\AssemblyFolders\v4.0\Windows Phone\AssemblyFoldersEx

    VersionMinimum is the earliest applicable .NET Framework version. For example, if VersionMinimum is v4.0, folders specified in AssemblyFoldersEx apply to projects that target .NET Framework 4.x.

    On a Windows 64-bit operating system, the following are the registry key paths.

    Platform | Registry key
    Windows | HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\VersionMinimum\AssemblyFoldersEx
    Xbox 360 | HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\XNA\AssemblyFolders\v4.0\Xbox 360\AssemblyFoldersEx
    Windows Phone | HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\XNA\AssemblyFolders\v4.0\Windows Phone\AssemblyFoldersEx
  2. The "Default" setting of the new subkey must be set to the full path location where the assemblies are stored. For example, C:\MyAssemblies\ or C:\MyAssemblies\Xbox360\.

Expand image See Also

Extending Game Studio


Accessing Custom Item Templates

Accessing Custom Item Templates
See Also Example
CollapseAll image

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."

Expand image 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> ...

Expand image See Also

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


Game Component Development

Game Component Development

Describes how to use XNA Game Studio to develop custom game components for your game projects. You derive the new component either from the GameComponent class, or, if the component loads and draws graphics content, from the DrawableGameComponent class.

Developing Custom Components

XNA Game Studio supports the development of custom game components for use in your game code. You can use the Add New Item dialog box to insert basic code for implementing a new component.

To insert a new custom game component

  1. Open an XNA Framework game or library project in XNA Game Studio.
  2. In Solution Explorer, right-click the game project node.
  3. Click Add, and then click New Item.
  4. In the Add New Item dialog box, in the Categories pane, select XNA Game Studio 4.0
  5. In the Templates pane, select the Game Component icon.
  6. Enter a name for the source file, and then click Add.

The new code is composed of three main methods.

Method | Purpose
GameComponent1 | The constructor for the game component. The name matches the name you specified when you inserted the new component. Add code that initializes the component here.
Initialize | Called by the Framework when the component starts. Add the component-specific starting code here.
Update | Called by the Framework when the component needs to be updated. Add the component-specific update code here.

After creating the new component, add your custom code to provide the necessary functionality.

Expand image See Also

Advanced Topics
Getting Started with XNA Game Studio Development


Game Studio Automation Extenders

Game Studio Automation Extenders

Describes DTE extenders to support automation in XNA Game Studio.

This section describes the special extenders that are provided by XNA Game Studio to aid automation within the structure of an XNA game project. These extenders provide mechanisms to retrieve project objects for content projects that are subordinate to code projects, and to retrieve the code project that is parent to a content project.

Retrieving Content Projects from a Code Project

The EnvDTE.Project objects for all content projects subordinate to a code project are retrieved through the EnvDTE.Project.Extender property for that code project. The object returned implements IEnumerable, so that it can be enumerated in a For Each clause. The enumerable items implement EnvDTE.Project.

The extender objects for subordinate content projects are referenced by the string:

"Microsoft.Xna.GameStudio.CodeProject.NestedContentProjectsExtender"

The following example outputs the name of all content projects within the current code project:

Visual Basic
  Sub ShowNestedContentProjects()
    Dim proj As Project
    proj = DTE.Solution.Projects.Item(1)

    MsgBox(proj.Name & " has extenders " & Strings.Join(proj.ExtenderNames, ", "))

    For Each nestedProj As Project In proj.Extender("Microsoft.Xna.GameStudio.CodeProject.NestedContentProjectsExtender")
      MsgBox(proj.Name & " has nested project " & nestedProj.Name)
      ShowParentCodeProjects(nestedProj)
    Next
  End Sub

Retrieving Code Projects from a Content Project

The EnvDTE.Project object that is parent to any content project is retrieved through the EnvDTE.Project.Extender property for the content project. The object returned implements IEnumerable, so that it can be enumerated in a For Each clause. The enumerable items implement EnvDTE.Project.

The extender objects for parent code projects are referenced by the string:

"Microsoft.Xna.GameStudio.ContentProject.ParentProjectsExtender"

The following example outputs the name of all of a content project's parent code projects:

Visual Basic
  Sub ShowParentCodeProjects(ByVal contentProj As Project)
    Dim parents = New System.Collections.Generic.List(Of String)

    For Each parentProj As Project In contentProj.Extender("Microsoft.Xna.GameStudio.ContentProject.ParentProjectsExtender")
      parents.Add(parentProj.Name)
    Next

    MsgBox(contentProj.Name & " has parent projects " & Strings.Join(parents.ToArray(), ", "))
  End Sub

A content project may have multiple parent code projects (as in a cross-platform solutions, where content is common to all platforms).

Expand image See Also

Advanced Topics


FuelCell Example Game

FuelCell Example Game

Discusses the FuelCell 3D game tutorial.

Figure 1. Complete FuelCell game

The purpose of this multipart topic is to educate you about various strategies and challenges encountered during the development of a simple 3D game. The FuelCell diary focuses on developing a basic 3D game with a simple goal: collecting objects scattered randomly around a playing field that is populated with randomly placed barriers. The components of FuelCell are deliberately limited to provide a clear picture of the structure and scope of the game.

Game development is hard—especially 3D game development. XNA Game Studio was developed specifically to make game development easier and more enjoyable. Unlike the solid content found in the Writing Game Code and Getting Started sections, the purpose of this diary is to provide a continuous discussion of the work required for developing a simple 3D game using XNA Game Studio. In addition to articles focused on implementing a specific technique, this diary also contains material on initial game design and how game design drives future development of that game. Also, since game development is not all candy and roses, the diary addresses problems encountered during development and how these problems were overcome.

FuelCell is designed around a central concept: a basic gameplay mechanism that is easily extensible. The initial version, discussed in the topics listed under "In This Section," draws a random playfield of barriers and collectable objects. The player, controlling a vehicle that can be driven around the playing field, searches for a collection of fuel cells. Because the game design is modular, future versions could easily add additional effects and game features.

The primary components of FuelCell (camera, avatar control, and collision detection) use existing topics found in the Writing Game Code. This diary ties together these disparate concepts into a complete (albeit, simple) 3D game.

Each step in the series contains a list of important topics that are covered in the body of the topic and a link to the completed sample code of that step.

In This Section

FuelCell: Game Design
Discusses the importance of designing a game using a feature-based approach.
FuelCell: Setting the Scene
Discusses the implementation of a playing field for the game and a simple, fixed camera.
FuelCell: Casting Call
Discusses the implementation of the remaining game elements, such as barriers, fuel cells, and an avatar model.
FuelCell: What's My Motivation
Discusses the implementation of user control for the avatar (known as the fuel carrier).
FuelCell: What's My Line?
Demonstrates a simple, random technique for placing barriers and fuel cells on the playing field.
FuelCell: "Ships" Passing in the Night
Discusses collision detection in a 3D game and demonstrates basic collision checking between the fuel carrier vehicle and the other game objects on the playing field.
FuelCell: Finishing Touches
Discusses the final steps in the development of the FuelCell game.


FuelCell: Game Design

FuelCell: Game Design

Discusses the importance of designing a game using a feature-based approach.

The main points of this topic are:

  • Importance of Game Design

The Purpose Behind Game Design

Before every good game, there was game design. Notice that part about "good games"? A common pitfall for game developers is that they might have great ideas in mind, but the translation to the screen turns out to be impossible. It's hard not to lose heart when the developer must focus on developing basic game and code structure before displaying the defense of a planet against hordes of 3D alien enemies. Game design can seem boring and needless when compared to getting the developer's vision onto the monitor.

Unfortunately, a poor game design can lead to the situation where a person sits down with the latest demo, plays it for ten minutes, and gets lost or frustrated.

Like computer games, books are another example of a product that requires a careful design. Every good book has a "hook" line: an opening sentence that immediately piques the reader's curiosity or interest. If the reader finishes the first page (or even the first paragraph) and does not have at least one story-related question rattling around in the brain, that reader probably will not finish the book.

Game design is a technique that creates the "hook" for the player. Your purpose is to capture the gamer's attention in the first couple of minutes. Otherwise, the player may walk away. A good set of game features enrolls your audience into the game's story. It convinces a player to finish the game. However, a good opening is not enough. You must have equally good content that continues to engage or challenge the gamer.

With that in mind, in addition to a good opening, games typically benefit from the following features:

  • A clear and achievable goal. But what about the cries of outrage from the 80's arcade crowd: "And what was the achievable goal of <insert favorite 80's arcade game here>?! There was no goal – you died no matter how good you were!" Okay, they may have a point there, but times have changed. Today's games no longer require a constant flow of quarters to survive; they require a consistent paycheck (or a consenting adult with a consistent paycheck).
  • Replayability. This can range from a randomly-generated dungeon level or treasure pile to an ending that depends on the actions of the player. It can be argued that replayability is not a requirement of a good game, but it helps to lengthen the span of interest in a game, and it provides more entertainment for the player without the need for extra content or expansion packs.
  • One or more obstacles to overcome. No one wants a game where the player just wanders over to the end level boss, it falls dead at your feet, and the end credits roll. A little challenge (or a lot) is necessary to keep the player engaged. This can be, and usually is, the main content of a game. Common challenges include collecting special items, defeating enemies to reach a specific place in the game, or solving a complex puzzle using simple in-game items collected (or taken by force) earlier.

If a game provides at least these features, it is probably a game worth playing at least once. This is the part where game design comes into play. When you design your game, keep these features in mind. Providing content for these features is difficult, but worth the effort when it all comes together.

FuelCell Features

To illustrate this point, the game design for FuelCell focused on fulfilling these three criteria:

Game Feature | FuelCell Feature
Clear Goal | Collect 12 fuel cells (green canisters of goo) before time runs out. Fuel cells are collected using a player-controlled model (the fuel carrier). The game is won when the player collects all fuel cells and time remains. The game is lost if less than 12 fuel cells are found and time runs out.
Replayability | The playing field is a basic, level grid with fuel cells scattered at random. In addition, a large amount of barriers are also scattered about the playing field. These barriers are opaque and (eventually) cannot be driven through. The replayability comes from the random placement of the fuel cells and barriers for each new game.
Challenges | The fuel carrier always starts in the middle of the field, but the fuel cells and barriers are scattered randomly. There are enough barriers to prevent the player from initially seeing all available fuel cells. The barriers have two purposes: slowing the player down and obscuring some of the fuel cells at all times. In some cases, a fair bit of hunting is required by the player to retrieve all fuel cells. In later versions of the game, existing factors could easily be tweaked to increase the difficulty and introduce new sub-goals (such as a power-up allowing a clearer view or a faster vehicle).

With the FuelCell feature set explained, let's move on to the actual coding of the game. The next step focuses on a critical part of any 3D game – the camera.

Expand image See Also

Conceptual

FuelCell Example Game


FuelCell: Setting the Scene

FuelCell: Setting the Scene

Discusses the implementation of a playing field for the game and a simple, fixed camera.

The main points of this topic are:

  • Drawing 3D Models
  • Adding 3D Content to the Application

The Complete Sample

The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

Download FuelCell_2_Sample.zip.

Note
You must download the above sample code in order to access the 3D models used in this tutorial step.

Overview

One of the largest hurdles a game developer faces when moving from 2D to 3D is that third 'D': depth. In the 2D world, game objects (called sprites) have two dimensions and are positioned using literal screen coordinates. There is a concept of depth, but this is used only to determine if a sprite is partially or fully obscured by another.

In a 3D game, what you see on your screen is a projection of a 3D environment onto a 2D surface (that is, your screen). This translation of 3D space into 2D space is accomplished using transformation matrices. Specifically, we refer to these three matrices as world, view, and projection matrices. Transformation is just a fancy word for changing the value of a coordinate by multiplication. Using these matrices, the XNA Framework transforms the coordinates of a 3D model to a set of new coordinate values (through rotation, scaling, or translation) used by the projection matrix. In a separate but related step, a view matrix simulates a viewpoint (often called the camera) in the same 3D space as the model; it looks in a certain direction. With these two matrices, a third matrix is brought into the "picture" to perform a final transformation into 2D screen coordinates. This creates a realistic 2D picture of the 3D scene on your computer screen.

Earlier, we mentioned a camera. Even though this isn't a real camera, it fulfills the same role in the 3D game. This camera observes the 3D world and renders whatever it sees into a 2D representation. This representation appears on the computer screen. In a game, the camera class usually is implemented as a stand-alone class. It is one of two varieties: a first-person camera (used in this game and first-person shooters) and a third person camera (often used in RPGs or platform games). First-person cameras are great for games that focus on a single player or are trying to immerse the player in the game world. Third-person cameras are better suited to viewing a large playing field or controlling numerous entities in the game. For this step, you will implement a first-person camera .

We use a first-person camera because the player controls a small vehicle that can move around and collect fuel cells. The difficulty of the game is finding these items before time runs out. It's difficult because the playing field has opaque barriers randomly scattered across it. Since we use a first-person camera, the player must drive around to view previously-hidden areas.

Objects in the Game

3D game development is all about position and the relation to other objects in the local coordinate system (that is, the game world). In addition to position, a 3D object usually has an associated model. Because this is a 3D game, the model has three dimensions. This means it can be viewed from all angles and has volume. In addition to these two properties, the 3D object should have a bounding sphere. The bounding sphere is a theoretical sphere that encapsulates the model volume. It is used for detecting collisions in the game world with other 3D objects. You can ignore this for now, but it becomes critical later in the development process.

A class is the obvious solution for storing and tracking all these variables. However, before we can add this class, you need to first create a new project for the FuelCell game.

  • Open XNA Game Studio and create a Windows Game 4.0 project called FuelCell.
  • In this project, create a new class called GameObject.

The GameObject class will contain all those properties mentioned earlier and a constructor that sets the various properties to known values. The file containing this new class only has a few references by default (located at the top). To grant easy access to the XNA Framework assemblies, you'll need to add some XNA-specific ones. At the top of the file, add the following references:

C#
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

These new references make it possible to use the short form of reference for XNA Framework-specific classes. For instance, instead of declaring a variable of type Vector2 by specifying Microsoft.Xna.Framework.Vector2, we can use Vector2 instead. That will save a lot of typing during the development of FuelCell!

You're ready to modify the default class declaration to better fit your needs. Replace the existing GameObject class declaration with the following:

C#
class GameObject
{
    public Model Model { get; set; }
    public Vector3 Position { get; set; }
    public bool IsActive { get; set; }
    public BoundingSphere BoundingSphere { get; set; }

    public GameObject()
    {
        Model = null;
        Position = Vector3.Zero;
        IsActive = false;
        BoundingSphere = new BoundingSphere();
    }
}

This new version now tracks the position, model, and bounding sphere of an object in the game using auto-implemented properties. The constructor is simple, and it initializes each property to a reasonable value – either null or Vector3.Zero.

The Camera

The GameObject.cs file will also contain the camera class declaration. As mentioned earlier, the main purpose behind this developer diary is to demonstrate how you (or any developer) can use various How To articles as stepping stones when developing an XNA Framework game. For this first usage, this concept is clearly illustrated by not changing any of the variable names or classes, whenever possible. This may cause a bit of confusion or head-scratching when you come across variable names like _avatarHeadOffset and avatarYaw, but it serves to tie the source How To more closely to the actual game code. This creates the ability to easily determine where the source code of a How To ends up in a typical game project by searching for the variable name used in the How To.

For example, in this step, some of the property names match the names used in the original sample code: _avatarHeadOffset is the camera's distance above the playing field and _targetOffset is the offset from the target. In this case, it is a fixed distance in front of the fuel carrier vehicle. These values are used when calculating the camera position from the current position of the fuel carrier vehicle (for example, position) in the world coordinate system.

The camera class is similar in structure to the GraphicObject class. It has a set of properties and a method. In this case, it is Update. For this game, the camera acts like a rigid chase camera. It follows behind, and slightly above, the actual vehicle and points in the same direction as the vehicle at all times.

All right, enough talk – let's start developing!

Add the following code after the existing GameObject class declaration:

C#
class Camera
{
    public Vector3 AvatarHeadOffset { get; set; }
    public Vector3 TargetOffset { get; set; }
    public Matrix ViewMatrix { get; set; }
    public Matrix ProjectionMatrix { get; set; }

    public Camera()
    {
        AvatarHeadOffset = new Vector3(0, 7, -15);
        TargetOffset = new Vector3(0, 5, 0);
        ViewMatrix = Matrix.Identity;
        ProjectionMatrix = Matrix.Identity;
    }

    public void Update(float avatarYaw, Vector3 position, float aspectRatio)
    {
        Matrix rotationMatrix = Matrix.CreateRotationY(avatarYaw);

        Vector3 transformedheadOffset =
            Vector3.Transform(AvatarHeadOffset, rotationMatrix);
        Vector3 transformedReference =
            Vector3.Transform(TargetOffset, rotationMatrix);

        Vector3 cameraPosition = position + transformedheadOffset;
        Vector3 cameraTarget = position + transformedReference;

        //Calculate the camera's view and projection
        //matrices based on current values.
        ViewMatrix =
            Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up);
        ProjectionMatrix =
            Matrix.CreatePerspectiveFieldOfView(
                MathHelper.ToRadians(GameConstants.ViewAngle), aspectRatio,
                GameConstants.NearClip, GameConstants.FarClip);
    }
}

This is the camera class declaration. The major difference between this declaration and its appearance in the original How To is that the camera's functionality has been internalized into a class. This means that previously global variables that tracked camera position, the transformation matrices, and other properties are now stored within the class. These properties can be divided into two parts: offset variables and transform matrices. The offset variables (AvatarHeadOffset and TargetOffset) force the camera to a specific position behind and above the vehicle's current position. Hence, the name chase camera.

Researching Transformation Matrices

The transformation matrices are used to rotate, move, or scale objects in a world coordinate system and then (along with the view matrix) to a perspective 2D coordinate system: your screen. The theory and application of this concept involves a truckload of math.

The Update method is where the main math for updating the camera takes place. This function takes the current rotation of the vehicle and creates a transformation matrix, which in turn is used to transform the camera's offset values. These values are then added to the current vehicle position, creating a point, in the world coordinate system, where the camera "sits." The final step generates the view and perspective matrices, used when rendering the 3D game world view onto your 2D monitor screen.

Game Constants

Did you notice that some of the method arguments were from a GameConstants class? Let's create this class and then I'll explain its purpose.

  • Add a new class to the project, called GameConstants.

  • Since you will also be using XNA Framework references in this file, add the following references to the beginning of the file:

    C#
    using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

  • Now add the following to the GameConstants class declaration:

    C#
    //camera constants
public const float NearClip = 1.0f;
public const float FarClip = 1000.0f;
public const float ViewAngle = 45.0f;

You'll use this class to gather common game variables into a single location. You can then easily and quickly alter the value of any game constant and have the new value affect the entire game, or at least those areas where the game constant was used. At this point, you have three candidates for game constants: the near and far clipping planes of the camera and the angle of view used by the camera. The camera's clipping planes determine the distance (in world coordinates) when objects approaching the screen or receding from it are no longer drawn.

It's a good idea to give them informative names so another person, looking at the code, easily understands their purpose.

Okay, that wraps up the camera class and constants implementation. Let's move on to the visually appealing stuff: drawing stuff on the screen!

Getting a Grip

Up until now, the new code has focused on setting up a viewpoint in the game world and added some additional infrastructure that is used by the game and various components. Game assets, in the form of models, are a large part of any 3D game. Even though this is a simple game, FuelCell includes many different types of game assets: models that represent game objects, textures that clothe the models, and a font to display game information such as the current score and goal status. For this step, let's add a very basic model and get it on the screen so we can begin to understand how our game world will look.

Every project template created by XNA Game Studio has a sub-project called Content. This project must contain all your game assets. Although it isn't required, it's a good idea to organize this content project such that similar assets are in the same folder. A common organization uses several folders: Models, Textures, Fonts, and Audio. These folders cover the main parts of a game. Let's add a Models folder, and a model, to our game.

Caution
This diary assumes you are using the game assets located in the FuelCell sample file downloaded earlier. These assets have been sized in relation to each other so that none are too small or too large. You can use other models, but their scale (the size in the world coordinate system) might be radically different from the FuelCell models. This can cause a model to be rendered as a massive or miniscule object in the game world. In some cases, the camera (due to its position) might not be able to see the model at all. Therefore, it is recommended that you use the included FuelCell models when following these steps. After gaining some experience working with the camera class and rendering a 3D scene, you can experiment by adding your own models.
  • Select the Content folder icon and select New Folder from the context menu.
  • Name this new folder Models.
  • Select the Models folder icon and from the context menu, select Add and then Existing Item....

  • Navigate to the folder containing the downloaded game assets and add the ground.x model.

You now have a working camera object, and a ground model, in your project. In the next step, you will add code declaring and initializing both these objects and use them to render a nice terrain in the game world. For the remainder of this step, you will be working exclusively in the Game1.cs file, which is the main file of an XNA Framework game.

  • Open the Game1.cs file using Solution Explorer.

  • Add the following code, after the existing declaration of the graphics member of Game1:

    C#
    GameObject ground;
Camera gameCamera;

  • In the existing Initalize method, initialize both game objects (using their default constructors) by adding the following code:

    C#
    ground = new GameObject();
gameCamera = new Camera();

  • Next, add the following code to the existing LoadContent method:

    C#
    ground.Model = Content.Load<Model>("Models/ground");

You've added code declaring and initializing your camera class and the terrain model. To see all this work on the screen, you must update the existing Draw method to render the terrain. This is also a good time to add code that updates, during each frame, the camera's position and orientation. Currently, this update code does nothing because the fuel carrier (the user-controlled avatar vehicle) isn't in the game yet. However, when the vehicle is added in a later step, the camera automatically updates, chasing the vehicle around as the player tries to find hidden fuel cells.

Opening Your "Eye"

Updating the camera occurs in the aptly-named Update method. At this time, the information passed to the Camera.Update method is faked because there is no vehicle to focus on. Specifically, the position and rotation for the camera are zeroed out. This means the camera is centered slightly above the terrain model and aligned with the z-axis. This is the axis that represents the depth of the game world. Once you add the vehicle, the Camera.Update method will be passed the position and rotation of the vehicle, instead of zeros.

This modification is very simple because you already implemented the Camera.Update method. Now, you just need to call it at the proper time and pass some valid values.

  • Add the following code to the Update method of the Game1.cs file:

    C#
    float rotation = 0.0f;
Vector3 position = Vector3.Zero;
gameCamera.Update(rotation, position,
    GraphicsDevice.Viewport.AspectRatio);

The final step modifies the existing Draw method.

  • Modify the body of the Draw method of the Game1.cs file to match the following:

    C#
    graphics.GraphicsDevice.Clear(Color.Black);

DrawTerrain(ground.Model);

    This code calls the non-exisitent DrawTerrain method.

  • Add the following method after the Draw method:

    C#
    private void DrawTerrain(Model model)
{
    foreach (ModelMesh mesh in model.Meshes)
    {
        foreach (BasicEffect effect in mesh.Effects)
        {
            effect.EnableDefaultLighting();
            effect.PreferPerPixelLighting = true;
            effect.World = Matrix.Identity;

            // Use the matrices provided by the game camera
            effect.View = gameCamera.ViewMatrix;
            effect.Projection = gameCamera.ProjectionMatrix;
        }
        mesh.Draw();
    }
}

The DrawTerrain method uses a rendering technique commonly used by XNA Framework games – iterative draw calls on child meshes of the parent model. In this rather simple case, the ground model only has one mesh. But for more complex models, this approach is required to properly render the model on the screen.

Go ahead and compile and build your project. You should be hovering over a gray and light-blue terrain under a black sky. It doesn't look like much now, but the next part adds the rest of the 3D models and displays them on the screen.

Expand image See Also

Conceptual

FuelCell Example Game


FuelCell: Casting Call

FuelCell: Casting Call

Discusses the implementation of the remaining game elements, such as barriers, fuel cells, and an avatar model.

The Complete Sample

The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

Download FuelCell_3_Sample.zip.

Note
You must download the above sample code in order to access the 3D models used in this tutorial step.

Supporting Cast

It's time to add the remaining models: the fuel cells and the fuel carrier. They represent the various barriers encountered in the game.

The fuel cell model (fuelcell.x) is a simple canister-like object with a single texture (fuelcell.png). Typically, you only need to add the model file and not the texture. The texture file is automatically used when the Content Pipeline processes the model file. The barrier models are similar to the fuel cell model. They each have a specific model and a single texture. Since the game has three barrier types, we will be adding three different models (cube10uR/cylinder10uR/pyramid10uR.x) and a set of textures (BarrierBlue/BarrierPurple/BarrierRed.png). Unlike the fuel cell model, the barrier textures are simple and can be used with any barrier model.

Note
The rather unique model names are the result of keeping the scale relatively uniform among all models. The naming convention begins with the model name and then the radius, measured in the units of the 3D modeling application used. Therefore, pyramid10uR is the name of the pyramid model whose radius is 10 units in length.
  • Right-click the Models directory icon of the Content project.
  • Click Add and then New Item....

  • Navigate to the Models sub-directory of the downloaded source, and add the following files:

    • fuelcell.x and fuelcell.png
    • fuelcarrier.x and carriertextures.png
    • cube10uR.x, cylinder10uR.x, and pyramid10uR.x
    • BarrierBlue.png, BarrierPurple.png, and BarrierRed.png
  • From Solution Explorer, select all .png files in the Models sub-directory.

  • Right-click and select Exclude From Project.

    This prevents the textures from being processed twice.

Implementing the FuelCell Class

Model implementation is similar to what you did in the last step. You'll add some member variables to store the models, load them with the LoadContent method, initialize them (placement, etc.), and then render them on the playing field.

First, the fuel cell class. After the GameObject class, add the following FuelCell class.

C#
class FuelCell : GameObject
{
    public bool Retrieved { get; set; }

    public FuelCell()
        : base()
    {
        Retrieved = false;
    }

    public void LoadContent(ContentManager content, string modelName)
    {
        Model = content.Load<Model>(modelName);
        Position = Vector3.Down;
    }
}

Compared to the GameObject base class, it contains a new member (Retrieved). This is a flag used by the game to determine if the fuel cell has been retrieved. The constructor uses the base constructor, setting Retrieved to false. You'll use this flag later to optimize your drawing code. If it has been found, it no longer needs to be drawn. The LoadContent loads the specified model and then sets the Y-component of the Position member to -1. That value is used as an indicator that the fuel cell has not been initialized.

This next bit of code declares a Draw method that takes a view and projection matrix and draws the fuel cell. There are two important aspects of this new code: the first is related to optimization and the second is related to future proofing. In terms of optimization, notice the check on the value of the Retrieved member. This is the optimization we discussed previously. If the fuel cell has been retrieved by the player, there is no need to draw the fuel cell. This may seem like a minor thing, but changes like this add up over the course of your game's development.

The second is a bit more complicated, but is required for correctly rendering most 3D models: bone transforms. Nearly every 3D model is comprised of a collection of bones. Basically, a model bone is a matrix representing the position of a mesh relative to other bones in the 3D model.

For our purposes, it's sufficient to know that a 3D model has a set of these matrices. To position them properly (and, in more complex cases, to animate them), you'll need to incorporate these transform matrices into the code that draws the fuel cell. You can accomplish this easily by copying the bone transforms of the model being drawn into a temporary set of matrices (using CopyAbsoluteBoneTransformsTo). Then you apply the proper transform matrix to the world matrix before you draw the current sub-mesh of the model. In the code you will add, this is done in the innermost nested foreach loop by multiplying the world matrix by the proper transform matrix.

You're probably wondering why this code is called future proofing. Ironically, the code related to applying bone transforms to the 3D model being rendered is unnecessary for FuelCell! One of the design rules used for FuelCell was to keep everything as simple as possible. This resulted in the rudimentary (and unmoving) models in the game. Each model has a set of bones, but these bones are always rendered statically and cannot be animated. However, this code is necessary to properly render any minimally complex model or one that has movable parts (like a tank rolling across a terrain map). This code makes it easier to be reused in future games without having to remember all this bone transform business. Now, when you copy the code into another 3D game, it just works. Even if the model is very complex!

Now that you understand the code better, add the following code to the FuelCell class.

C#
public void Draw(Matrix view, Matrix projection)
{
    Matrix[] transforms = new Matrix[Model.Bones.Count];
    Model.CopyAbsoluteBoneTransformsTo(transforms);
    Matrix translateMatrix = Matrix.CreateTranslation(Position);
    Matrix worldMatrix = translateMatrix;

    if (!Retrieved)
    {
        foreach (ModelMesh mesh in Model.Meshes)
        {
            foreach (BasicEffect effect in mesh.Effects)
            {
                effect.World =
                    worldMatrix * transforms[mesh.ParentBone.Index];
                effect.View = view;
                effect.Projection = projection;

                effect.EnableDefaultLighting();
                effect.PreferPerPixelLighting = true;
            }
            mesh.Draw();
        }
    }
}

  • You'll need to automatically scale the fuel cell model by selecting the newly-added model from Solution Explorer, and, on the property page of the model asset, setting the Scale property to .03. The Scale property is found by expanding the Processor field.

One of the cool features of XNA Game Studio (specifically, the content pipeline) are processor parameters. You can change common values for a processor by changing the related property of a selected game asset using the Properties window. If you didn't use this feature, you would need to use a scaling matrix to shrink the fuel cell model before rendering it on the screen.

Did you notice the Matrix declarations at the beginning of the Draw function? You need to transform the world coordinates of our object (in this case, the fuel cell) based on the fuel cell's position in the game. If the translation matrix wasn't used before drawing the fuel cell, it would always be in the center of the playing field.

That completes the implementation of the fuel class. Next stop, the barrier class.

Implementing the Barrier Class

The Barrier class implements the geometrical barriers that are randomly scattered across the playing field. They are an important part of the game because they provide a new experience for every game (since they are placed randomly) and they provide a challenge to the player who is trying to find fuel cells (also randomly placed) before time runs out. In a later step, when collision detection is added, these barriers become impassable and must be driven around.

  • Automatically scale the barrier models by selecting each barrier model from Solution Explorer and setting the Scale property to .3, located on the property page of the model asset. The Scale property is found by expanding the Processor field.

In GameObject.cs, add the following class declaration after the FuelCell class declaration:

C#
class Barrier : GameObject
{
    public string BarrierType { get; set; }

    public Barrier()
        : base()
    {
        BarrierType = null;
    }

    public void LoadContent(ContentManager content, string modelName)
    {
        Model = content.Load<Model>(modelName);
        BarrierType = modelName;
        Position = Vector3.Down;
    }
}

The Barrier class has a new member (BarrierType) that stores, oddly enough, the barrier type. In the FuelCell game, there are three possible barrier types: cubes, cylinders, and pyramids. Similar to the FuelCell class, the LoadContent method is overridden that loads the specified model, stores the barrier type, and sets the Y-component of the Position member to -1 (indicating that the barrier is not placed).

Since barrier objects behave in a similar fashion to fuel cells (that is, they stay in one place and do nothing), we'll use the same drawing code with one change. Add the following Draw method to the Barrier class:

C#
public void Draw(Matrix view, Matrix projection)
{
    Matrix[] transforms = new Matrix[Model.Bones.Count];
    Model.CopyAbsoluteBoneTransformsTo(transforms);
    Matrix translateMatrix = Matrix.CreateTranslation(Position);
    Matrix worldMatrix = translateMatrix;

    foreach (ModelMesh mesh in Model.Meshes)
    {
        foreach (BasicEffect effect in mesh.Effects)
        {
            effect.World =
                worldMatrix * transforms[mesh.ParentBone.Index];
            effect.View = view;
            effect.Projection = projection;

            effect.EnableDefaultLighting();
            effect.PreferPerPixelLighting = true;
        }
        mesh.Draw();
    }
}

Unlike fuel cells, barriers can't be retrieved and are always visible. Therefore, there is no need to determine if a barrier should be drawn; it is always drawn. This is reflected in the code.

Implementing the Fuel Carrier

In game development terms, the fuel carrier is the avatar of the player. It is the object that represents the player in the game world and is controlled by the player. The FuelCarrier class starts out very simple but, in later steps, you'll add more features like user control and collision detection. For now, it has a few basic methods that load the model and render it on the playing field.

The process for implementing the fuel carrier class is similar to the FuelCell and Barrier class implementations.

  • Automatically scale the fuel carrier model by selecting it from Solution Explorer and setting the Scale property to .1, located on the property page of the model asset. The Scale property is found by expanding the Processor field.

  • After the Barrier class declaration, add the FuelCarrier class declaration:

    C#
    class FuelCarrier : GameObject
{
    public float ForwardDirection { get; set; }
    public int MaxRange { get; set; }

    public FuelCarrier()
        : base()
    {
        ForwardDirection = 0.0f;
        MaxRange = GameConstants.MaxRange;
    }

    public void LoadContent(ContentManager content, string modelName)
    {
        Model = content.Load<Model>(modelName);
    }
}

  • Implement the Draw method by adding the following code to the FuelCarrier class declaration:

    C#
    public void Draw(Matrix view, Matrix projection)
{
    Matrix[] transforms = new Matrix[Model.Bones.Count];
    Model.CopyAbsoluteBoneTransformsTo(transforms);
    Matrix worldMatrix = Matrix.Identity;
    Matrix rotationYMatrix = Matrix.CreateRotationY(ForwardDirection);
    Matrix translateMatrix = Matrix.CreateTranslation(Position);

    worldMatrix = rotationYMatrix * translateMatrix;

    foreach (ModelMesh mesh in Model.Meshes)
    {
        foreach (BasicEffect effect in mesh.Effects)
        {
            effect.World =
                worldMatrix * transforms[mesh.ParentBone.Index]; ;
            effect.View = view;
            effect.Projection = projection;

            effect.EnableDefaultLighting();
            effect.PreferPerPixelLighting = true;
        }
        mesh.Draw();
    }
}

    This Draw method differs from the fuel cell and barrier Draw methods in one important aspect: the calculation of a rotation matrix. In the future, the fuel carrier is controlled by the player. This means that the fuel carrier's orientation is always changing as the player races around collecting fuel cells. You have to account for this in the rendering code so that any changes by the player (such as turning left or right) are reflected in the game world. If fuel carrier orientation is not taken into account, you would have some very weird behavior for your game! At this point, you will add the support for this, but it won't be used until the next step: FuelCell: What's My Motivation.

  • Add the fuel carrier constants to the end of the GameConstants class, located in GameConstants.cs:

    C#
    //ship constants
public const float Velocity = 0.75f;
public const float TurnSpeed = 0.025f;
public const int MaxRange = 98;

As usual, the Fuel Carrier data members are specific to the class. In this case, there is an orientation property, storing the current direction (in radians) that the fuel carrier is facing. This property is also used by the camera class to orientate along the same vector. The MaxRange member is used later to prevent the fuel carrier from driving off the playing field. This is something that would completely break the game play illusion.

As mentioned earlier, the methods are similar to the implementation code for the fuel cell and barrier classes. However, in the next part, you will add code that allows the player to drive the fuel carrier around the playing field. In fact, the fuel carrier has the singular honor of being the only moving part in the game!

Setting the Stage

It's time to shift our focus back to the main game class, Game1.cs. You're going to add member variables representing the new game objects you added: the fuel carrier, fuel cell, and various barriers. At this stage, we'll display a fuel cell, three barriers (each of a different type), and the fuel carrier on the playing field. Later in the development cycle, you'll add code that randomly generates and places the fuel cells and barriers.

However, before you start modifying this file, rename it FuelCellGame.cs. This follows the naming format of the other project files.

  • In FuelCellGame.cs, after the declaration of the camera and ground variables, add the following code:

    C#
    Random random;
FuelCarrier fuelCarrier;
FuelCell[] fuelCells;
Barrier[] barriers;

  • After the initialization of the camera and ground variables (located in the Initialize method), add the following code:

    C#
    //Initialize and place fuel cell
fuelCells = new FuelCell[1];
fuelCells[0] = new FuelCell();
fuelCells[0].LoadContent(Content, "Models/fuelcell");
fuelCells[0].Position = new Vector3(0, 0, 15);

//Initialize and place barriers
barriers = new Barrier[3];

barriers[0] = new Barrier();
barriers[0].LoadContent(Content, "Models/cube10uR");
barriers[0].Position = new Vector3(0, 0, 30);
barriers[1] = new Barrier();
barriers[1].LoadContent(Content, "Models/cylinder10uR");
barriers[1].Position = new Vector3(15, 0, 30);
barriers[2] = new Barrier();
barriers[2].LoadContent(Content, "Models/pyramid10uR");
barriers[2].Position = new Vector3(-15, 0, 30);

//Initialize and place fuel carrier
fuelCarrier = new FuelCarrier();
fuelCarrier.LoadContent(Content, "Models/fuelcarrier");

    This code initializes all our new models and places them in front of the camera. The fuel cell is in the front row and the barriers are in a line behind it.

  • Modify the existing Draw method by adding the following code after the DrawTerrain call:

    C#
    fuelCells[0].Draw(gameCamera.ViewMatrix,
    gameCamera.ProjectionMatrix);
foreach (Barrier barrier in barriers)
    barrier.Draw(gameCamera.ViewMatrix,
        gameCamera.ProjectionMatrix);
fuelCarrier.Draw(gameCamera.ViewMatrix,
    gameCamera.ProjectionMatrix);

Build and run the project and you will now see, in addition to the playing field, several cool things on the screen. You see some barriers, with a fuel cell slightly behind them, and a funny blue ovoid in the foreground. That is actually the fuel carrier. It's a (very) simple model, but it suits the purpose of the game. The next step implements user control of the game avatar.

Expand image See Also

Conceptual

FuelCell Example Game


FuelCell: What's My Motivation

FuelCell: What's My Motivation

Discusses the implementation of user control for the avatar (known as the fuel carrier).

The main points of this topic are:

  • Receiving Player Input (illustrated by the following How Tos)
    • detect a button press
    • Detecting an Xbox 360 Controller Button Press in the Current Frame (Xbox 360, Windows)
    • Detecting a Key Press (Windows, Windows Phone, Xbox 360)

The Complete Sample

The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

Download FuelCell_4_Sample.zip.

Note
You must download the above sample code in order to access the 3D models used in this tutorial step.

Overview

The goal for this part is the implementation of a control schema for the fuel carrier. With this schema, the player can use either the keyboard (A or D for left/right rotation and W and S for forward/backward movement) or a standard gamepad (using the left thumbstick for rotation and forward/backward movement). In addition, we'll check the _maxRange data member against the current position, and only allow movement that keeps the player on the playing field. This prevents the player from driving off the playing field.

GamePad States

In order to control the fuel carrier, you need input from a keyboard or gamepad. There are two approaches to getting input from the player: single-state and two-state. In a single-state approach, input is determined from a single snapshot of the controller, taken during execution of the Update method. Any actions that need to be taken by the game are initiated, thus enabling game play to move forward. This approach is demonstrated by detect a button press.

However, when discrete input is required, the single-state approach doesn't solve the problem. For instance, suppose a game is designed to fire one bullet for every press of a key or button. If you use the single-state approach, multiple bullets are fired per key or button press. This happens because human reflexes are slower than the standard update cycle of the game. Even a very quick player is going to have a key or button pressed for at least a few update cycles (unless the game uses a fixed-step approach). In order to fire a single bullet every time a key or button is pressed, you must look for a current state where a specific key or button is released and a previous state where that same key or button was pressed. This condition is only satisfied at the instant when the key or button transitions from pressed to released.

Hence, the two-state approach: tracking the current state of the controller and the previous state of the controller. This allows the game to determine single occurrences of player action, such as a key or button press. With this approach, it doesn't matter how slow (or fast) the player's reflexes are. The input is only valid at that moment when the previous and current input states match the criteria determined by the input code. This approach is demonstrated by Detecting an Xbox 360 Controller Button Press in the Current Frame (Xbox 360, Windows) and Detecting a Key Press (Windows, Windows Phone, Xbox 360).

It turns out that if you do any amount of XNA Game Studio game development, you often run into this controller update issue. The two-state approach is the best solution in most situations, and it is easy to implement. That same code also fulfills the needs of a single-state approach. In terms of keyboard and gamepad controls, FuelCell uses a two-state approach, but with a twist. The support for two-state input checking is in the code but FuelCell needs only check for current key and thumbstick states. Therefore, there is no need to check for a discrete event.

This code is an example of "future-proofing." If you were to add the capability to blow up a barrier with a missile, you would already have the necessary code to use the two-state approach.

Implementation begins in the FuelCellGame.cs file. Add the following code after the declaration of the graphics data member:

C#
KeyboardState lastKeyboardState = new KeyboardState();
KeyboardState currentKeyboardState = new KeyboardState();
GamePadState lastGamePadState = new GamePadState();
GamePadState currentGamePadState = new GamePadState();

Now, in the existing Update method, initialize the variables at the beginning of the method:

C#
lastKeyboardState = currentKeyboardState;
currentKeyboardState = Keyboard.GetState();
lastGamePadState = currentGamePadState;
currentGamePadState = GamePad.GetState(PlayerIndex.One);

You can now use either set of variables to determine exactly when a key or button is pressed or just use currentGamePadState if you only need the current position of the thumbstick. Your next step is to use this input to update the position and direction of the fuel carrier.

Updating the Fuel Carrier

Currently, the FuelCarrier class doesn't have a method for updating its position and heading. You'll add that method now and modify the main Update method to call it.

Staying within the FuelCellGame.Update function, replace this code:

C#
float rotation = 0.0f;
Vector3 position = Vector3.Zero;
gameCamera.Update(rotation, position,
    GraphicsDevice.Viewport.AspectRatio);

with the following:

C#
fuelCarrier.Update(currentGamePadState,
    currentKeyboardState, barriers);
float aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;
gameCamera.Update(fuelCarrier.ForwardDirection,
    fuelCarrier.Position, aspectRatio);

The only difference is a call to the new update method, FuelCarrier.Update. This method takes as input the current keyboard and gamepad states and the barriers array. The method determines if the ship can move based on the current input and barrier locations. Ignore the barriers parameter for now; it is used in a later step. At this point, the function only prevents the vehicle from driving off the playing field. If an attempt is made to go over the playing field edge, the input is ignored.

Replace the code that checks for a Back button press with the following:

C#
// Allows the game to exit
if ((currentKeyboardState.IsKeyDown(Keys.Escape)) ||
    (currentGamePadState.Buttons.Back == ButtonState.Pressed))
    this.Exit();

The game now checks for both keyboard (ESC key) and gamepad input (Back button) when the player wishes to exit the game.

In the GameObject.cs file, locate your FuelCarrier class, and add the new update method:

C#
public void Update(GamePadState gamepadState,
    KeyboardState keyboardState, Barrier[] barriers)
{
    Vector3 futurePosition = Position;
    float turnAmount = 0;

    if (keyboardState.IsKeyDown(Keys.A))
    {
        turnAmount = 1;
    }
    else if(keyboardState.IsKeyDown(Keys.D))
    {
        turnAmount = -1;
    }
    else if(gamepadState.ThumbSticks.Left.X != 0)
    {
        turnAmount = -gamepadState.ThumbSticks.Left.X;
    }
    ForwardDirection += turnAmount * GameConstants.TurnSpeed;
    Matrix orientationMatrix = Matrix.CreateRotationY(ForwardDirection);

    Vector3 movement = Vector3.Zero;
    if (keyboardState.IsKeyDown(Keys.W))
    {
        movement.Z = 1;
    }
    else if(keyboardState.IsKeyDown(Keys.S))
    {
        movement.Z = -1;
    }
    else if (gamepadState.ThumbSticks.Left.Y != 0)
    {
        movement.Z = gamepadState.ThumbSticks.Left.Y;
    }

    Vector3 speed = Vector3.Transform(movement, orientationMatrix);
    speed *= GameConstants.Velocity;
    futurePosition = Position + speed;

    if (ValidateMovement(futurePosition, barriers))
    {
        Position = futurePosition;
    }
}

This method is important, so let's go through it in detail. First, the future position is set to the current position and the turn amount is set to 0. The amount of vehicle rotation is calculated, based on the current state of the A and D keys or the X-axis of the left thumbstick, and a rotation matrix is created. This matrix is later used to rotate the vehicle the proper amount in world coordinates. The second chunk of code calculates how far the ship moved in either a forward or backward direction, based on the current state of the W and S keys or the Y-axis of the same thumbstick. This distance is then transformed using the rotational matrix created earlier, and this result is multiplied by a constant velocity (GameConstants.Velocity). The final result is then added to the current position, resulting in a projected future position. Finally, this result is passed to a private method called ValidateMovement. If it is valid, the _position member is updated and control returns to the main Game1.Update method.

Programming Tip

You might be wondering why you couldn't just test the current position for validity instead of calculating a future position and testing that. The answer is that if you only tested the current position, it's already too late to prevent illegal movement. When the test is made, the vehicle has already had its position updated. Suppose that new position is illegal (past the edge of a boundary case). This causes further tests to fail, resulting in the vehicle "sticking" to the current positon. Obviously, this is not optimal behavior for a player-controlled vehicle.

It is better to check the future position and prevent any illegal moves. This check allows the player to attempt something different (like backing up), and not get stuck because the player currently is in a legal position.

The remaining piece is the implementation of the ValidateMovement method. Add the following method after the FuelCarrier.Update method:

C#
private bool ValidateMovement(Vector3 futurePosition,
    Barrier[] barriers)
{
    //Don't allow off-terrain driving
    if ((Math.Abs(futurePosition.X) > MaxRange) ||
        (Math.Abs(futurePosition.Z) > MaxRange))
        return false;

    return true;
}

Currently, this method only checks for the edge of the playing field. Any attempt to drive off the playing field is ignored.

After the usual drill of rebuilding the project and running it, drive the fuel carrier freely around the map. Test out the boundary code by driving to the edge of the playing field. You'll notice that you stop moving until you choose a new direction. The control schema implementation was pretty easy but, coming up, the game really starts to come together... which requires a lot of coding!

Expand image See Also

Conceptual

FuelCell Example Game

Tasks

detect a button press
Detecting an Xbox 360 Controller Button Press in the Current Frame (Xbox 360, Windows)
Detecting a Key Press (Windows, Windows Phone, Xbox 360)


FuelCell: What's My Line?

FuelCell: What's My Line?
See Also
CollapseAll image

Demonstrates a simple, random technique for placing barriers and fuel cells on the playing field.

The main points of this topic are:

  • Randomly Populating a Playing Field
  • Designing Algorithms to Solve a Specific Problem

The Complete Sample

The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

Download FuelCell_5_Sample.zip.

Note
You must download the above sample code in order to access the 3D models used in this tutorial step.

Overview

The goal of this topic is the implementation of a good algorithm for placing a set number of barriers and fuel cells randomly throughout the playing field. The valid placement area (on a 100 x 100 unit playing field) is 90 x 90. A barrier centered on this limit does not overhang the playing field. In addition to an outer limit, you need an inner limit. This prevents a situation where the fuel carrier (always placed at the origin of the playing field: 0,0,0) is trapped by barriers. This still wouldn't be a problem at this stage because the game implements no collision detection, but in the finished product it would make for a frustrating game experience. Finally, another limit is used when placing a barrier. This is a minimum distance a new barrier must be from existing barriers. This prevents a collision with an existing barrier.

After testing with different values, 12 fuel cells and 40 barriers produced a challenging field. They are nicely cluttered with a good probability that many fuel cells are initially obscured by one or more barriers. You are encouraged to experiment with these numbers, but be warned that a higher total makes random placement of the barriers more difficult. The game could begin "thrashing," which means it is endlessly generating new random locations (to resolve a collision) only to find the new locations currently occupied.

A good example of unforeseen development problems was the coordinate system of the playing field. Because the playing field origin is at 0, 0, 0, the X and Z axes have both positive and negative values. This "automatically" divides the playing field into four quadrants because the sign can be either positive or negative values for the X and Z coordinates (the Y coordinate is clamped to 0). Therefore, randomly generating two positive numbers between the minimum and maximum distances populates only one quarter of the playing field. This is another bad gaming experience!

The solution used by FuelCell is to randomly assign positive and negative values to the randomly generated X and Z coordinates. This decently scatters the barriers around the playing field. However, due to the random nature of coordinate generation and limits imposed by a minimum and maximum, you'll notice that there is a bit of a "corridor" along the X and Z axes.

Pick Two: High Quality, Fast, and Cheap.

You might know (or at least heard) about the trilemma above. You're given three characteristics, but you can only choose two because of their interdependency. Any two of the characteristics negates the possibility of the third. For example, you can have something made cheaply and quickly, but it will be of poor quality.

Trilemmas can also be applied to software algorithms. A cheap, fast algorithm wastes a lot of resources compared to the result. On the other hand, a high quality algorithm that is fast is not cheap in terms of resources (in this case, development man hours).

The algorithm used by FuelCell is a fast, cheap algorithm. It took very little design time, and code, to implement, and it is as fast as other possible algorithms because the problem set is pretty small. However, the quality is very poor. It performs many unnecessary checks, it uses a brute-force approach when placing a new game object, and the randomness of the playing field is compromised in certain aspects (such as the axes corridors).

Initially, during early development of this game, a different algorithm was developed after observing the performance of the simple one used here. This algorithm was designed to prevent clustering and to generate an even spread of game objects throughout the playing field.

The solution was to treat the playing field as four separate 2D grids (or quadrants). This approach prevented the axes from fluctuating as the algorithm moved around the playing field grid. Each quadrant was populated individually using nested for loops: a loop for each axis. In addition, each quadrant was allocated a fourth of the total fuel cells and barriers. Once the buckets emptied, the algorithm moved onto the next quadrant. As the loops incremented, the algorithm automatically walked through each square in the quadrant (like iterating through a 2D array). As it walked through the possible placement areas, a random number was generated. If the random number matched a simple rule, it called another routine to place an object and zero out a weight counter. If there was no match, the algorithm placed nothing, incremented the weight counter, and moved on to the next grid location. If the weight counter reached a certain level, and pieces still remained for placement, it forced a piece placement. This ensured an even distribution throughout the quadrant.

The secondary function triggered when a piece needed to be placed. A random number (representing a percentile) was generated. Forty percent of the time a fuel cell was placed (if fuel cells remained in the quadrant allocation); otherwise, a barrier was placed (if barriers remained in the quadrant allocation). This matched the frequency of fuel cells to barriers and provided a general distribution. If the object being placed was a barrier, another random number determined the barrier type.

Finally, the algorithm verified that all game objects were placed before exiting the quadrant and that some type of object was placed, when required.

The end result was a consistently populated playing field that hardly ever had clusters or axes corridors. However, when this tutorial was written, the algorithm was overkill and introduced needless complexity to the main purpose: designing a 3D game. Therefore, the fast and cheap algorithm was used, making the code easier to understand.

Initializing the Random Number Generator

Since we are going to randomly populate the playing field with game objects, an obvious first step is to set up a random number generator. Let's keep it simple and declare a file-level random variable (in FuelCellGame.cs) that can be accessed by any FuelCellGame method.

After the gamepad state declarations, add the following:

C#
Random random;

Initialize the random number generator in the FuelCellGame constructor:

C#
random = new Random();

Modifying the LoadContent Method

In FuelCell: What's My Motivation, we added some temporary code that created the FuelCell models on the playing field. You'll remove that code now, and initialize the arrays properly.

Remove the following from the Initialize method:

C#
//Initialize and place fuel cell
fuelCells = new FuelCell[1];
fuelCells[0] = new FuelCell();
fuelCells[0].LoadContent(Content, "Models/fuelcell");
fuelCells[0].Position = new Vector3(0, 0, 15);

//Initialize and place barriers
barriers = new Barrier[3];

barriers[0] = new Barrier();
barriers[0].LoadContent(Content, "Models/cube10uR");
barriers[0].Position = new Vector3(0, 0, 30);
barriers[1] = new Barrier();
barriers[1].LoadContent(Content, "Models/cylinder10uR");
barriers[1].Position = new Vector3(15, 0, 30);
barriers[2] = new Barrier();
barriers[2].LoadContent(Content, "Models/pyramid10uR");
barriers[2].Position = new Vector3(-15, 0, 30);

//Initialize and place fuel carrier
fuelCarrier = new FuelCarrier();
fuelCarrier.LoadContent(Content, "Models/fuelcarrier");

Add this code to the LoadContent method, after the loading of the ground game asset:

C#
//Initialize fuel cells
fuelCells = new FuelCell[GameConstants.NumFuelCells];
for (int index = 0; index < fuelCells.Length; index++)
{
    fuelCells[index] = new FuelCell();
    fuelCells[index].LoadContent(Content, "Models/fuelcell");
}

//Initialize barriers
barriers = new Barrier[GameConstants.NumBarriers];
int randomBarrier = random.Next(3);
string barrierName = null;

for (int index = 0; index < barriers.Length; index++)
{

    switch (randomBarrier)
    {
        case 0:
            barrierName = "Models/cube10uR";
            break;
        case 1:
            barrierName = "Models/cylinder10uR";
            break;
        case 2:
            barrierName = "Models/pyramid10uR";
            break;
    }
    barriers[index] = new Barrier();
    barriers[index].LoadContent(Content, barrierName);
    randomBarrier = random.Next(3);
}
PlaceFuelCellsAndBarriers();

//Initialize fuel carrier
fuelCarrier = new FuelCarrier();
fuelCarrier.LoadContent(Content, "Models/fuelcarrier");

Let's examine this code before moving on.

The first block initializes the array of fuel cells, loading each with the model for the fuel cell.

Barrier initialization is next. This code is a bit more complicated because there are three available barrier models. This looks like a job for the random number variable! A random number is generated and the corresponding model is loaded into the current barrier element using a switch> statement. The rest of the barrier object is initialized and a new random number is generated before moving to the next array element. After barrier initialization, the fuel cells and barriers are placed on the playing field with a call to PlaceFuelCellsAndBarriers. We'll discuss this function in detail later.

The final bit of code initializes and loads the model for the fuel carrier.

Fuel Cell and Barrier Initialization, Part 2

Now it is time to take a closer look at the PlaceFuelCellsAndBarriers method and its helper method, GenerateRandomPosition. Add the following code to the game (after the LoadContent method), and then we'll walk through it.

C#
private void PlaceFuelCellsAndBarriers()
{
    int min = GameConstants.MinDistance;
    int max = GameConstants.MaxDistance;
    Vector3 tempCenter;

    //place fuel cells
    foreach (FuelCell cell in fuelCells)
    {
        cell.Position = GenerateRandomPosition(min, max);
        tempCenter = cell.BoundingSphere.Center;
        tempCenter.X = cell.Position.X;
        tempCenter.Z = cell.Position.Z;
        cell.BoundingSphere = new BoundingSphere(tempCenter,
            cell.BoundingSphere.Radius);
        cell.Retrieved = false;
    }

    //place barriers
    foreach (Barrier barrier in barriers)
    {
        barrier.Position = GenerateRandomPosition(min, max);
        tempCenter = barrier.BoundingSphere.Center;
        tempCenter.X = barrier.Position.X;
        tempCenter.Z = barrier.Position.Z;
        barrier.BoundingSphere = new BoundingSphere(tempCenter,
            barrier.BoundingSphere.Radius);
    }
}

private Vector3 GenerateRandomPosition(int min, int max)
{
    int xValue, zValue;
    do
    {
        xValue = random.Next(min, max);
        zValue = random.Next(min, max);
        if (random.Next(100) % 2 == 0)
            xValue *= -1;
        if (random.Next(100) % 2 == 0)
            zValue *= -1;

    } while (IsOccupied(xValue, zValue));

    return new Vector3(xValue, 0, zValue);
}

It's not complicated, but it is also one of the bigger functions in the game. First, a few variables are declared, making the code more reader-friendly. The next part is a foreach loop that places the fuel cells. The algorithm is as follows:

  1. Generate random values for the X and Z coordinates, verify that the new random location is not already occupied, and update the fuel cell position with this new position.

    Possible values are limited by the minimum and maximum placement values (defined in GameConstants.cs).

  2. Initialize the bounding sphere property to the current fuel cell location.

  3. Mark the fuel cell as unretrieved.

You follow the same process when you place the barriers.

The GenerateRandomPosition helper method makes up the remaining portion of newly added code. This method generates two random numbers. Another random number is generated and, depending on the result of the modulus operation (50% chance of negation), the X coordinate is negated. The same is done for the Z coordinate. The new position is then checked for existing occupants. If occupied, a new position is generated and the loop continues until a vacant location is found.

Let's add the new helper method, IsOccupied, to the project next.

Fuel Cell and Barrier Initialization, Part 3

Add this code after the PlaceFuelCellsAndBarriers method:

C#
private bool IsOccupied(int xValue, int zValue)
{
    foreach (GameObject currentObj in fuelCells)
    {
        if (((int)(MathHelper.Distance(
            xValue, currentObj.Position.X)) < 15) &&
            ((int)(MathHelper.Distance(
            zValue, currentObj.Position.Z)) < 15))
            return true;
    }

    foreach (GameObject currentObj in barriers)
    {
        if (((int)(MathHelper.Distance(
            xValue, currentObj.Position.X)) < 15) &&
            ((int)(MathHelper.Distance(
            zValue, currentObj.Position.Z)) < 15))
            return true;
    }
    return false;
}

This method uses the nifty Distance method when checking for collision with an existing game object (fuel cell or barrier). As you can see from the code, if the new object is closer than 15 units from an existing object, it is not placed. This can be modified, but keep in mind that the higher the distance, the more the placement method churns. It's that cheap, but fast effect again.

The final change to FuelCellGame.cs occurs in the Draw method. The new code draws all our wonderful fuel cells and barriers. Modify the contents of the Draw method to match the following:

C#
graphics.GraphicsDevice.Clear(Color.Black);

DrawTerrain(ground.Model);

foreach (FuelCell fuelCell in fuelCells)
    fuelCell.Draw(gameCamera.ViewMatrix,
        gameCamera.ProjectionMatrix);
foreach (Barrier barrier in barriers)
    barrier.Draw(gameCamera.ViewMatrix,
        gameCamera.ProjectionMatrix);
fuelCarrier.Draw(gameCamera.ViewMatrix,
    gameCamera.ProjectionMatrix);

base.Draw(gameTime);

New Game Constants

Before you can build and admire all your hard work, you need to add some constants to the GameConstants.cs file. Add the following code after any existing constants in the GameConstants class:

C#
//general
public const int MaxRangeTerrain = 98;
public const int NumBarriers = 40;
public const int NumFuelCells = 12;
public const int MinDistance = 10;
public const int MaxDistance = 90;

After a successful rebuild of the project, you now have fuel cells to find and barriers to avoid. Go ahead and take a spin around the new digs before moving on to adding a critical game feature: collision detection.

Expand image See Also

Conceptual

FuelCell Example Game


FuelCell: "Ships" Passing in the Night

FuelCell: "Ships" Passing in the Night

Discusses collision detection in a 3D game and demonstrates basic collision checking between the fuel carrier vehicle and the other game objects on the playing field.

The main points of this topic are:

  • Custom Debugging Strategies

The Complete Sample

The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

Download FuelCell_6_Sample.zip.

Note
You must download the above sample code in order to access the 3D models used in this tutorial step.

Out of My Way!

Currently, the game is not very challenging (and impossible to win). The player can drive through barriers and fuel cells without retrieving them. The only boundaries are the edges of the playing field, added in Step 4. It's time to implement the main feature of the game: collision detection.

Collision detection is a technique used in nearly all games, whether they are 2D or 3D. It simulates (to varying degrees) the interaction of real world objects. Without collision detection, objects in the game world could be seamlessly rendered within the space of the objects with which they collide. In most cases, this is unacceptable. The player expects to "collide" with objects in the game world and not merge with them. The desired behavior in FuelCell is to allow the player free motion around the playing field as long as he or she avoids the barriers. However, if the player attempts to drive through any part of a barrier, the player's current motion stops. Players must drive around the barriers, as they would in the real world. The behavior for fuel cells is a bit different. When a player "collides" with a fuel cell, the fuel cell object is marked as retrieved and no longer is drawn in the game world. This simulates the retrieval of the fuel cell. In the final step, the game display tracks these retrievals. The game ends when the player retrieves all the fuel cells.

FuelCell's implementation of collision detection is based on the BoundingSphere class. Collison detection with bounding spheres is a good approach for a variety of reasons:

  • Bounding spheres (in addition to bounding boxes and frustums) are already available (courtesy of the XNA Framework) for use in your code.
  • Bounding spheres do not have to be rotated if the enclosed object is rotated. This is not true when using bounding boxes or frustums. This saves some coding and reduces the complexity of the implementation.
  • Bounding spheres are automatically generated for sub-meshes by the XNA Framework. Each mesh has a related bounding sphere, accessible with the BoundingSphere property of the ModelMesh object.

It's time to dive back into the code and take advantage of some of these features as we implement the collision detection.

Adding the Bounding Sphere Model

During development, it's incredibly useful to render your bounding spheres along with its related model. This makes debugging the collision detection code much easier when things don't seem to be working properly. FuelCell represents the bounding sphere as a spherical wire-frame model, whose radius is 1 unit. When rendering the bounding sphere of a model, it is easily scaled (using the radius of the model's bounding sphere) and placed by setting the bounding sphere's center to the current position of the model.

For example, if the radius of the bounding sphere of a mesh is 4, the bounding sphere model is scaled by 4, which matches the size of the original bounding sphere.

In order to use this technique, you need to add and initialize a spherical model with a radius of 1 unit. Luckily, the sphere1uR.x model is the model you need.

  1. Add the sphere1uR.x and White.png files to the Models/Content directory of the FuelCell project.
  2. Exclude the White.png file from the project.
  3. In FuelCellGame.cs, declare a member variable (called boundingSphere) of type GameObject, after the declaration of the game camera.

  4. In the existing Initialize method, initialize the new variable after initializing the game camera:

    C#
    boundingSphere = new GameObject();

  5. In the existing LoadContent method, load the bounding sphere model after loading of the playing field model:

    C#
    boundingSphere.Model = Content.Load<Model>("Models/sphere1uR");

Once the model is loaded, you can use it to render the bounding spheres of your game objects. The only data you'll need to track is the size and position of each object's bounding sphere. For FuelCell, there are three types of bounding spheres: fuel carrier, fuel cell, and barrier. You can use the bounding sphere model for each type as long as you scale and position the model before rendering it. For simplicity's sake, the rendering code for a game object and its bounding sphere are kept together. Because the procedure for doing this is the same for both fuel cells and barriers, you will only walk through the fuel cell side of things. After that, we'll discuss the barrier implementation at a higher level.

Calculating the Boundary of the Fuel Cell Model

Do you remember the member variable you added previously to the GameObject class, BoundingSphere? This is the step that finally makes use of that variable, with the help of a bit of code. The first step involves calculating a decent approximation of the bounding sphere of the game object's model. We'll use the CreateMerged method. It's a quick and cheap way to calculate the bounding spheres of simple models. We'll start with the initial bounding sphere and, for every two spheres encountered in the model, we'll merge them. This continues until no more bounding spheres are left.

Note
For single mesh models, like those in FuelCell, this approach works perfectly. However, the approach begins to lose accuracy when applied to a complex model. This is why there are entire shelves of books devoted to solving this problem at your local bookstore.

Since we need the bounding sphere values from the model's sub-meshes, a good place for the initial calculation of this variable is in the LoadContent of the fuel cell model. Add the following code after any existing code:

C#
BoundingSphere = CalculateBoundingSphere();

This code makes a call to a helper function (CalculateBoundingSphere) that approximates the bounding sphere of the model, returning a new bounding sphere. The result is stored in the BoundingSphere variable. The Y-coordinate is set to 0. This causes the upper half of the bounding sphere to project out of the playing field. Since the widest part of the sphere is at the playing field level, it provides a good approximation when testing collision between fuel cells and the fuel carrier.

Add the helper method to the GameObject class, after any existing code:

C#
protected BoundingSphere CalculateBoundingSphere()
{
    BoundingSphere mergedSphere = new BoundingSphere();
    BoundingSphere[] boundingSpheres;
    int index = 0;
    int meshCount = Model.Meshes.Count;

    boundingSpheres = new BoundingSphere[meshCount];
    foreach (ModelMesh mesh in Model.Meshes)
    {
        boundingSpheres[index++] = mesh.BoundingSphere;
    }

    mergedSphere = boundingSpheres[0];
    if ((Model.Meshes.Count) > 1)
    {
        index = 1;
        do
        {
            mergedSphere = BoundingSphere.CreateMerged(mergedSphere,
                boundingSpheres[index]);
            index++;
        } while (index < Model.Meshes.Count);
    }
    mergedSphere.Center.Y = 0;
    return mergedSphere;
}

At this point, the bounding sphere has an approximate center (clamped to 0 on the Y axis) and radius. Remember the code you added in Step 5 that placed the fuel cells and barriers? After adding the bounding sphere calculation code, the approximated bounding sphere now has the proper coordinates of the related model. In the next step, you'll add code to render both fuel cells and their bounding spheres.

Drawing the Spheres

In the Draw function, replace the existing foreach loop that draws the fuel cells with the following:

C#
foreach (FuelCell fuelCell in fuelCells)
{
    if (!fuelCell.Retrieved)
    {
        fuelCell.Draw(gameCamera.ViewMatrix,
            gameCamera.ProjectionMatrix);
        RasterizerState rs = new RasterizerState();
        rs.FillMode = FillMode.WireFrame;
        GraphicsDevice.RasterizerState = rs;
        fuelCell.DrawBoundingSphere(gameCamera.ViewMatrix,
            gameCamera.ProjectionMatrix, boundingSphere);

        rs = new RasterizerState();
        rs.FillMode = FillMode.Solid;
        GraphicsDevice.RasterizerState = rs;
    }
}

What's new about this code? The most important changes are the graphics device state changes and the call to DrawBoundingSphere. The state changes are necessary to render the sphere model as a white wireframe model. We did this for two reasons: so the underlying model wouldn't be obscured, and the bounding sphere model would be easily visible. The switch to wireframe rendering is made by setting FillMode to FillMode.WireFrame. Once the sphere model is drawn, the fill mode is set back to the default, FillMode.Solid. The second change is the call to a new draw function of the GameObject class, DrawBoundingSphere. Add the following code after the CalculateBoundingSphere method:

C#
internal void DrawBoundingSphere(Matrix view, Matrix projection,
    GameObject boundingSphereModel)
{
    Matrix scaleMatrix = Matrix.CreateScale(BoundingSphere.Radius);
    Matrix translateMatrix =
        Matrix.CreateTranslation(BoundingSphere.Center);
    Matrix worldMatrix = scaleMatrix * translateMatrix;

    foreach (ModelMesh mesh in boundingSphereModel.Model.Meshes)
    {
        foreach (BasicEffect effect in mesh.Effects)
        {
            effect.World = worldMatrix;
            effect.View = view;
            effect.Projection = projection;
        }
        mesh.Draw();
    }
}

Even though the two methods are similar, there are some important differences. First, the bounding sphere model is scaled using the radius of the fuel cell's bounding sphere instead of a constant factor. Second, the nice default lighting is turned off. This makes the model "pop" a bit more amidst the other models rendered with default lighting.

At this point, rebuild the game and start it. You'll notice that the fuel cells now have wireframe spheres surrounding them. You'll also notice that the spheres are pretty bad approximations of the fuel cell's boundaries. We'll get to that eventually. For now, let's add the code that updates and renders the bounding spheres for the fuel carrier and barriers.

Implementing the Remaining Bounding Spheres

First, let's update the barrier-related code since the barriers don't move, which results in less code to write.

  • Modify the LoadContent method to calculate the initial bounding sphere.
  • In the Draw method, modify the foreach loop (that draws the barriers) to draw the related bounding sphere.

Next up, the fuel carrier. It's the same procedure except for some extra code at the end to handle vehicle movement and fuel cell collision.

  • Modify the LoadContent method to calculate the initial bounding sphere.
  • Modify the FuelCarrier.Update method to update the bounding sphere location with the future position of the fuel carrier.
  • In the Draw method, modify the fuel carrier draw code to also draw the related bounding sphere.

This completes the modifications to draw all the bounding spheres. If you rebuild and run the game, you'll now see lots of wire-frame spheres. But there is still more work (related to fuel carrier collision detection) to make these bounding spheres useful. At this point, the fuel carrier still ignores the fuel cell and barrier bounding spheres. Let's fix this now.

Collision Checking for the Fuel Carrier

There are two collision events that need implementation: collision with a fuel cell and collision with a barrier. If you remember, you already implemented the playing field edge collision code.

Fuel cell collision is important because that it is the only way the player can score points and win the game. You need to add code that checks for collisions between a fuel cell and the fuel carrier. If they collide, you need to mark the fuel cell as retrieved, update the retrieved fuel cells counter, and not draw the fuel cell in the future. This gives the impression that the fuel cell has been picked up by the fuel carrier.

Begin by modifying the FuelCellGame.Update method to check for collision between the fuel cell and the fuel carrier. Add the following code after the game camera update:

C#
foreach (FuelCell fuelCell in fuelCells)
    fuelCell.Update(fuelCarrier.BoundingSphere);

Add the FuelCell.Update method, called with the preceding code. Place it after the Draw method:

C#
internal void Update(BoundingSphere vehicleBoundingSphere)
{
    if (vehicleBoundingSphere.Intersects(this.BoundingSphere))
        this.Retrieved = true;
}

This checks for intersection between the bounding spheres of the carrier and the fuel cell.

Go ahead and remove the now-redundant check (located in FuelCell.Draw) to see if the fuel cell is retrieved before drawing. That check is now being made in the FuelCellGame.Draw method. This completes the code support for the first collision event.

The second event requires less code because, for the most part, the infrastructure already exists. The existing ValidateMovement method will be updated to check for barrier collision in addition to game field boundary collision.

Calculate the future position of the bounding sphere, based on the future position of the fuel carrier. Add the following code to the beginning of the FuelCarrier.ValidateMovement method:

C#
BoundingSphere futureBoundingSphere = BoundingSphere;
futureBoundingSphere.Center.X = futurePosition.X;
futureBoundingSphere.Center.Z = futurePosition.Z;

In the same method, add the following code to the end of the current code but before the last return call:

C#
//Don't allow driving through a barrier
if (CheckForBarrierCollision(futureBoundingSphere, barriers))
    return false;

Finally, add the new CheckForBarrierCollision method:

C#
private bool CheckForBarrierCollision(
    BoundingSphere vehicleBoundingSphere, Barrier[] barriers)
{
    for (int curBarrier = 0; curBarrier < barriers.Length; curBarrier++)
    {
        if (vehicleBoundingSphere.Intersects(
            barriers[curBarrier].BoundingSphere))
            return true;
    }
    return false;
}

Initial Bounding Sphere Results

Once you rebuild and run FuelCell, look at the size of the default bounding spheres. For each object, the bounding sphere is quite large. In some cases, the addition of bounding sphere volumes creates situations where the code prevents the vehicle from passing through barriers that are far enough apart for the vehicle itself. The collision detection, as it stands now, is pretty good considering that this is the result if you do nothing but use the default bounding sphere parameters. However, with a simple modification to the code we can improve the experience of the player. The modification involves applying another scaling factor to the bounding spheres of each game object. This allows realistic interaction between the vehicle and the game world.

The implementation requires scaling factors for each object type. A good place for these is in the GameConstants.cs file. Add the following declarations to the end of the GameConstants class:

C#
//bounding sphere scaling factors
public const float FuelCarrierBoundingSphereFactor = .8f;
public const float FuelCellBoundingSphereFactor = .5f;
public const float BarrierBoundingSphereFactor = .7f;

There are factors for the fuel carrier, fuel cells, and barriers.

The second modification is to the LoadContent methods of the fuel carrier, fuel cell, and barrier classes. After the bounding sphere is first calculated, the radius is then modified by the appropriate factor. This shrinks the radius of the bounding sphere, creating a tighter fit with the object's visible boundary.

Modify the FuelCell.LoadContent method by adding the following code after the bounding sphere calculation:

C#
BoundingSphere scaledSphere;
scaledSphere = BoundingSphere;
scaledSphere.Radius *= GameConstants.FuelCellBoundingSphereFactor;
BoundingSphere =
    new BoundingSphere(scaledSphere.Center, scaledSphere.Radius);

Modify the FuelCarrier.LoadContent method by adding the following code after the bounding sphere calculation:

C#
BoundingSphere scaledSphere;
scaledSphere = BoundingSphere;
scaledSphere.Radius *=
    GameConstants.FuelCarrierBoundingSphereFactor;
BoundingSphere =
    new BoundingSphere(scaledSphere.Center, scaledSphere.Radius);

Modify the Barrier.LoadContent method by adding the following code after the bounding sphere calculation:

C#
BoundingSphere scaledSphere;
scaledSphere = BoundingSphere;
scaledSphere.Radius *= GameConstants.BarrierBoundingSphereFactor;
BoundingSphere =
    new BoundingSphere(scaledSphere.Center, scaledSphere.Radius);

Rebuild and run the game. The bounding spheres are noticeably smaller, and they no longer enclose the game models. However, the important area (a band on the ground going around the game object) matches the outline of the model fairly accurately. At this point, the collision detection is good enough for our purposes. However, with a little effort, the placement and size of the bounding spheres could be modified even further to produce more accurate collision detection. Like most things in game development, the more time you spend on a feature, the better it gets (remember that trilemma we discussed earlier?). There's one more step before we can call it done. In the last step, we'll add some new screens (for example, start, win or lose), game state tracking and HUD elements, and a few other items.

Expand image See Also

Conceptual

FuelCell Example Game


FuelCell: Finishing Touches

FuelCell: Finishing Touches

Discusses the final steps in the development of the FuelCell game.

The main points of this topic are:

  • Displaying Game Status
  • Game State Management
  • Screen Transitioning Within a Game

The Complete Sample

The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.

Download FuelCell_7_Sample.zip.

Note
You must download the above sample code in order to access the 3D models used in this tutorial step.

Overview of Game State Management

As a game, FuelCell is nearly complete, but we are missing some important features. These features include:

  • Game state management
  • Start and win/loss screens
  • Game status display (such as the current score and time remaining)

Game state management is the management of different states of the game through displaying different screens and/or by logic code added to the existing code. Common states for a basic game include: starting, playing, win/loss, and pause. Each of these states could have one or more related screens, such as an options screen or a gameplay screen.

FuelCell manages three states (starting, playing, won/lost) and three different screens:

  • a starting screen with instructions on playing the game
  • a gameplay screen displaying the fuel carrier and the playing field—the screen we have been working on from the beginning
  • a screen that informs whether the player won or lost, and enables the player to start a new game or exit

The game state management code is confined to the FuelCellGame.cs file (with some constants defined in GameConstants.cs). Heavy modification of the Update and Draw methods is needed, and additional new code will be added in various areas of the file.

However, before we start that work, remove the code that renders the bounding spheres. It served its purpose and only gets in the way now. In the Draw method, comment out (or remove) all code that sets the wire frame rendering mode, and calls the DrawBoundingSphere method. Rebuild the game and run it. Without all the wireframe spheres, it looks like a real game.

Note

If this were a real game in development, you would either remove these calls completely or enclose them in DEBUG conditionals. In addition, you could remove or conditionalize the code around initializing and loading the bounding sphere model (boundingSphere). However, you still need the remaining code initializing and calculating the bounding spheres for the various game objects. Without it, our collision detection disappears.

For our purposes, a simple commenting out suffices.

Anybody Got the Time?

One of the goals of FuelCell is to collect 12 fuel cells. It's not a very difficult task if the player has all the time in the world. Let's fix that now by adding a time limit to the game. The player starts with a set amount of time. In this case, we'll use 30 seconds. If the player collects all 12 fuel cells before time runs out, the player wins the game. However, if time runs out and there are still fuel cells on the playing field, the player loses. The winning and losing conditions are handled by the game state management code that you'll add later. For now, let's implement the time limit feature.

In FuelCellGame.cs, declare three variables (of type TimeSpan) for the various times to be tracked. You'll also need a variable for tracking the number of retrieved fuel cells (of type int).

C#
int retrievedFuelCells;
TimeSpan startTime, roundTimer, roundTime;

In the FuelCellGame constructor, add initialization code for the starting and round times. This code sets the start and game time variables to 0. Zero indicates the game hasn't started. The round time variable is then set to 30.25 seconds. The .25 seconds is to give enough time to flash 30 on the screen before it begins counting down.

C#
roundTime = GameConstants.RoundTime;

While you are in here, add the following code to specify a resolution of 853x480. This resolution causes output from any Xbox console to look good, regardless of the widescreen capabilities of the output device.

C#
graphics.PreferredBackBufferWidth = 853;
graphics.PreferredBackBufferHeight = 480;

In the Update method, add code that sets the time variables to their proper values when the player presses the Start button on the gamepad. A good place for this code is after the code that checks for pressing of the Exit button:

      if (currentGamePadState.Buttons.Start == ButtonState.Pressed)
      {
      roundTimer = roundTime;
      }

This code sets the current and start times to the current total game time, and then calculates the end time. Now that the time is set, you'll need to track the amount of elapsed game time.

Staying in the same method, add the following code after the fuel cell update code:

      roundTimer -= gameTime.ElapsedGameTime;

Gimme a T!

Next, you'll implement a simple HUD that displays the remaining time and the number of retrieved fuel cells during gameplay.

The first item is a spritefont for the screen text. This is a new content type for the game, so add a new directory to the Content directory called Fonts, and then add a new Spritefont item to that directory called StatsFont.

In the GameConstants.cs file, add the following strings:

C#
public const string StrTimeRemaining = "Time Remaining: ";
public const string StrCellsFound = "Fuel Cells Retrieved: ";
public const string StrGameWon = "Game Won !";
public const string StrGameLost = "Game Lost !";
public const string StrPlayAgain =
    "Press Enter/Start to play again or Esc/Back to quit";
public const string StrInstructions1 =
    "Retrieve all Fuel Cells before time runs out.";
public const string StrInstructions2 =
    "Control ship using keyboard (A, D, W, S) or the left thumbstick.";

These strings are used in various screens to display information on how to play, the current time remaining, and other important stuff. You'll also need a sprite batch and a sprite font variable when drawing the game text. Add these in the FuelCellGame.cs file after the random variable declaration:

C#
SpriteBatch spriteBatch;
SpriteFont statsFont;

In the LoadContent method, initialize the sprite batch object, and load the new sprite font with the following code:

C#
spriteBatch = new SpriteBatch(GraphicsDevice);
statsFont = Content.Load<SpriteFont>("Fonts/StatsFont");

You'll use a single method, called from Draw, to draw all the game statistics on the gameplay screen. In the FuelCellGame.cs file, add the following method after the DrawTerrain method:

C#
private void DrawStats()
{
    float xOffsetText, yOffsetText;
    string str1 = GameConstants.StrTimeRemaining;
    string str2 =
        GameConstants.StrCellsFound + retrievedFuelCells.ToString() +
        " of " + GameConstants.NumFuelCells.ToString();
    Rectangle rectSafeArea;

    str1 += (roundTimer.Seconds).ToString();

    //Calculate str1 position
    rectSafeArea = GraphicsDevice.Viewport.TitleSafeArea;

    xOffsetText = rectSafeArea.X;
    yOffsetText = rectSafeArea.Y;

    Vector2 strSize = statsFont.MeasureString(str1);
    Vector2 strPosition =
        new Vector2((int)xOffsetText + 10, (int)yOffsetText);

    spriteBatch.Begin();
    spriteBatch.DrawString(statsFont, str1, strPosition, Color.White);
    strPosition.Y += strSize.Y;
    spriteBatch.DrawString(statsFont, str2, strPosition, Color.White);
    spriteBatch.End();

    //re-enable depth buffer after sprite batch disablement

    //GraphicsDevice.DepthStencilState.DepthBufferEnable = true;
    DepthStencilState dss = new DepthStencilState();
    dss.DepthBufferEnable = true;
    GraphicsDevice.DepthStencilState = dss;

    //GraphicsDevice.RenderState.AlphaBlendEnable = false;
    //GraphicsDevice.RenderState.AlphaTestEnable = false;

    //GraphicsDevice.SamplerStates[0].AddressU = TextureAddressMode.Wrap;
    //GraphicsDevice.SamplerStates[0].AddressV = TextureAddressMode.Wrap;
}

Let's look at this code block more closely as there's a fair bit of code here.

The first part sets up the locations where the game statistic strings are drawn. A major part of this is the retrieval of the title safe area of the viewport. This is later used to properly place the various text strings. A nice feature of the TitleSafeArea property is that, depending on the platform, it automatically adjusts the area returned. The area is smaller if the game targets the Xbox 360 platform. Rendering within this area prevents any sprite drawing in areas of the screen that could get cut off by a TV display. The next part composes the strings with the current game info, and then draws them on the gameplay screen. However, the last bit of code deserves more examination.

You must reset certain properties of the graphics device whenever you combine sprite drawing with 3D rendering, as FuelCell does. These properties, related to alpha blending and the depth buffer, are set to different values when a sprite batch is used. If the properties are not reset to the default settings, weird rendering issues could suddenly appear in your game. That is why the final code modifies some BlendState and SampleState properties of the graphics device.

You'll need to call the DrawStats method from the existing Draw method. Add the following code after the call to FuelCarrier.Draw.

DrawStats();

After a rebuild, the time and remaining number of fuel cells are displayed in the upper-left corner. Of course, the values are completely wrong, but we'll be fixing those next.

The State of Things

The remaining code you will add implements the game state management of FuelCell. As mentioned previously, one of the main duties of game state management is to determine the correct game screen to display. In addition, game state management can also monitor the player's progress toward his or her goals. For FuelCell, the goals are to retrieve all fuel cells before time runs out. If the player succeeds, we need to display a Game Won screen or, conversely, a Game Lost screen. In addition, we'll display a splash screen on startup of the game containing instructions for starting a new game and playing it.

The state of the game changes depending on player input and events in the game. This makes the Update method an ideal place to monitor and control the varying states. In addition, the Draw method will be modified to properly reflect the current stage the game is in by drawing the proper screen.

Let's begin by declaring a new enumeration in the FuelCellGame.cs file that lists the different game states being tracked. Add the following code before the FuelCellGame class declaration declaration:

C#
public enum GameState { Loading, Running, Won, Lost }

Now add a variable (of type GameState) after the declaration of the SpriteBatch and SpriteFont variables.

C#
GameState currentGameState = GameState.Loading;

We're going to implement the game state component in stages, with the first stage being the Loading state. The first part, setting the current game state to Loading, is already done.

Implementing the Loading Game State

Before the player starts a new game of FuelCell, the player will need some basic instructions for controlling the vehicle and the win conditions. We'll deliver these instructions in a splash screen, which will display when the FuelCell application begins. This screen is only displayed when the game state is in the Loading stage.

Modify the following code:

        if ((lastKeyboardState.IsKeyDown(Keys.Enter) && (lastKeyboardState.IsKeyUp(Keys.Enter))) ||
        currentGamePadState.Buttons.Start == ButtonState.Pressed)
        {
          roundTimer = roundTime;
        }

to match the following:

C#
if (currentGameState == GameState.Loading)
{
    if ((lastKeyboardState.IsKeyDown(Keys.Enter) &&
        (currentKeyboardState.IsKeyUp(Keys.Enter))) ||
        currentGamePadState.Buttons.Start == ButtonState.Pressed)
    {
        roundTimer = roundTime;
        currentGameState = GameState.Running;
    }
}

The modifications now check the game state when the player presses the Enter key or Start button, and advances the game state if the current state is GameState.Loading.

Display of the splash screen is handled in the Draw method. Since the game state is based on the current value of an enumeration, we'll draw the proper screen based on the current value of currentGameState.

In the Draw method, replace the existing code between the Clear call and the base Draw call with the following code:

        switch (currentGameState)
        {
          case GameState.Loading:
            DrawSplashScreen();
            break;
        };

Before the player starts the game, the only thing displayed should be the splash screen. The helper method, DrawSplashScreen, clears the screen to steel blue, and then displays some informational text. Add that method after the existing DrawTerrain method:

C#
private void DrawSplashScreen()
{
    float xOffsetText, yOffsetText;
    Vector2 viewportSize = new Vector2(GraphicsDevice.Viewport.Width,
        GraphicsDevice.Viewport.Height);
    Vector2 strCenter;

    graphics.GraphicsDevice.Clear(Color.SteelBlue);

    xOffsetText = yOffsetText = 0;
    Vector2 strInstructionsSize =
        statsFont.MeasureString(GameConstants.StrInstructions1);
    Vector2 strPosition;
    strCenter = new Vector2(strInstructionsSize.X / 2,
        strInstructionsSize.Y / 2);

    yOffsetText = (viewportSize.Y / 2 - strCenter.Y);
    xOffsetText = (viewportSize.X / 2 - strCenter.X);
    strPosition = new Vector2((int)xOffsetText, (int)yOffsetText);

    spriteBatch.Begin();
    spriteBatch.DrawString(statsFont, GameConstants.StrInstructions1,
        strPosition, Color.White);

    strInstructionsSize =
        statsFont.MeasureString(GameConstants.StrInstructions2);
    strCenter = new Vector2(strInstructionsSize.X / 2,
        strInstructionsSize.Y / 2);
    yOffsetText =
        (viewportSize.Y / 2 - strCenter.Y) + statsFont.LineSpacing;
    xOffsetText = (viewportSize.X / 2 - strCenter.X);
    strPosition = new Vector2((int)xOffsetText, (int)yOffsetText);

    spriteBatch.DrawString(statsFont, GameConstants.StrInstructions2,
        strPosition, Color.LightGray);
    spriteBatch.End();

    //re-enable depth buffer after sprite batch disablement

    //GraphicsDevice.DepthStencilState.DepthBufferEnable = true;
    DepthStencilState dss = new DepthStencilState();
    dss.DepthBufferEnable = true;
    GraphicsDevice.DepthStencilState = dss;

    //GraphicsDevice.RenderState.AlphaBlendEnable = false;
    //GraphicsDevice.RenderState.AlphaTestEnable = false;

    //GraphicsDevice.SamplerStates[0].AddressU = TextureAddressMode.Wrap;
    //GraphicsDevice.SamplerStates[0].AddressV = TextureAddressMode.Wrap;
}

That completes the splash screen implementation.

Figure 1. Splash Screen for FuelCell

Implementing the Running (Gameplay) Screen

The next game state you'll implement is the gameplay screen (the screen that you developed in Steps 3-6). This screen is reached after the player presses the Enter key or the Start button from the splash screen. You'll add code to the Update and Draw methods to draw this screen at the appropriate time.

In the Update method, replace the following code:

          fuelCarrier.Update(currentGamePadState, currentKeyboardState, barriers);
          float aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;
          gameCamera.Update(fuelCarrier.ForwardDirection, fuelCarrier.Position, aspectRatio);

          foreach (FuelCell fuelCell in fuelCells)
          fuelCell.Update(fuelCarrier.BoundingSphere);
          roundTimer -= gameTime.ElapsedGameTime;

with the following code:

C#
if ((currentGameState == GameState.Running))
{
    fuelCarrier.Update(currentGamePadState,
        currentKeyboardState, barriers);
    gameCamera.Update(fuelCarrier.ForwardDirection,
        fuelCarrier.Position, aspectRatio);
    retrievedFuelCells = 0;
    foreach (FuelCell fuelCell in fuelCells)
    {
        fuelCell.Update(fuelCarrier.BoundingSphere);
        if (fuelCell.Retrieved)
        {
            retrievedFuelCells++;
        }
    }
    if (retrievedFuelCells == GameConstants.NumFuelCells)
    {
        currentGameState = GameState.Won;
    }
    roundTimer -= gameTime.ElapsedGameTime;
    if ((roundTimer < TimeSpan.Zero) &&
        (retrievedFuelCells != GameConstants.NumFuelCells))
    {
        currentGameState = GameState.Lost;
    }
}

In the Draw method, add the following code after the existing game state check:

C#
case GameState.Running:
    DrawGameplayScreen();
    break;

And then, after the DrawSplashScreen method, add the follwoing code:

C#
private void DrawGameplayScreen()
{
    DrawTerrain(ground.Model);
    foreach (FuelCell fuelCell in fuelCells)
    {
        if (!fuelCell.Retrieved)
        {
            fuelCell.Draw(gameCamera.ViewMatrix,
                gameCamera.ProjectionMatrix);
        }
    }
    foreach (Barrier barrier in barriers)
    {
        barrier.Draw(gameCamera.ViewMatrix,
            gameCamera.ProjectionMatrix);
    }

    fuelCarrier.Draw(gameCamera.ViewMatrix,
        gameCamera.ProjectionMatrix);
    DrawStats();
}

At this point, the game displays both the splash and gameplay screens. Only the win/loss screen remains.

Figure 2. Ganeplay Screen for FuelCell

Implementing the Game Won/Game Lost Screens

The win/loss screens are similar, differing only in the initial text. From either screen, the player can choose to play another game or exit FuelCell. For this reason, you'll implement both screens using a single function. That function, DrawWinOrLoss, accepts a string parameter with the appropriate message.

First, let's modify the Update method to check for player input after a game. Add the following code after the check for GameState.Running:

C#
if ((currentGameState == GameState.Won) ||
    (currentGameState == GameState.Lost))
{
    // Reset the world for a new game
    if ((lastKeyboardState.IsKeyDown(Keys.Enter) &&
        (currentKeyboardState.IsKeyUp(Keys.Enter))) ||
        currentGamePadState.Buttons.Start == ButtonState.Pressed)
        ResetGame(gameTime, aspectRatio);
}

There's nothing of note in this code except for the call to the Reset method. It "resets" the world, allowing a new game to be played. Let's add that method now.

In FuelCellGame.cs, add the following method:

C#
private void ResetGame(GameTime gameTime, float aspectRatio)
{
    fuelCarrier.Reset();
    gameCamera.Update(fuelCarrier.ForwardDirection,
        fuelCarrier.Position, aspectRatio);
    InitializeGameField();

    retrievedFuelCells = 0;
    startTime = gameTime.TotalGameTime;
    roundTimer = roundTime;
    currentGameState = GameState.Running;
}

In the GameObject.cs file, after the LoadContent method, add the following method to the FuelCarrier class:

C#
internal void Reset()
{
    Position = Vector3.Zero;
    ForwardDirection = 0f;
}

This returns the fuel carrier to its original position and orientation.

The final code you'll add is InitializeGameField. PLace this code after the ResetGame method (located in FuelCellGame.cs):

C#
private void InitializeGameField()
{
    //Initialize barriers
    barriers = new Barrier[GameConstants.NumBarriers];
    int randomBarrier = random.Next(3);
    string barrierName = null;

    for (int index = 0; index < GameConstants.NumBarriers; index++)
    {
        switch (randomBarrier)
        {
            case 0:
                barrierName = "Models/cube10uR";
                break;
            case 1:
                barrierName = "Models/cylinder10uR";
                break;
            case 2:
                barrierName = "Models/pyramid10uR";
                break;
        }
        barriers[index] = new Barrier();
        barriers[index].LoadContent(Content, barrierName);
        randomBarrier = random.Next(3);
    }
    PlaceFuelCellsAndBarriers();
}

This method completes the remaining tasks for a new game:

  • Generates new positions for all fuel cells and barriers.
  • Sets all fuel cells to a non-retrieved state and zeros out the number of retrieved fuel cells.

The final bit of code updates the Draw method to draw the winning or losing screen. Add the following code after the check for the Running game state in Draw:

C#
case GameState.Won:
    DrawWinOrLossScreen(GameConstants.StrGameWon);
    break;
case GameState.Lost:
    DrawWinOrLossScreen(GameConstants.StrGameLost);
    break;

Now implement the DrawWinOrLossScreen method, after the existing DrawSplashScreen method:

C#
private void DrawWinOrLossScreen(string gameResult)
{
    float xOffsetText, yOffsetText;
    Vector2 viewportSize = new Vector2(GraphicsDevice.Viewport.Width,
        GraphicsDevice.Viewport.Height);
    Vector2 strCenter;

    xOffsetText = yOffsetText = 0;
    Vector2 strResult = statsFont.MeasureString(gameResult);
    Vector2 strPlayAgainSize =
        statsFont.MeasureString(GameConstants.StrPlayAgain);
    Vector2 strPosition;
    strCenter = new Vector2(strResult.X / 2, strResult.Y / 2);

    yOffsetText = (viewportSize.Y / 2 - strCenter.Y);
    xOffsetText = (viewportSize.X / 2 - strCenter.X);
    strPosition = new Vector2((int)xOffsetText, (int)yOffsetText);

    spriteBatch.Begin();
    spriteBatch.DrawString(statsFont, gameResult,
        strPosition, Color.Red);

    strCenter =
        new Vector2(strPlayAgainSize.X / 2, strPlayAgainSize.Y / 2);
    yOffsetText = (viewportSize.Y / 2 - strCenter.Y) +
        (float)statsFont.LineSpacing;
    xOffsetText = (viewportSize.X / 2 - strCenter.X);
    strPosition = new Vector2((int)xOffsetText, (int)yOffsetText);
    spriteBatch.DrawString(statsFont, GameConstants.StrPlayAgain,
        strPosition, Color.AntiqueWhite);

    spriteBatch.End();

    //re-enable depth buffer after sprite batch disablement

    //GraphicsDevice.DepthStencilState.DepthBufferEnable = true;
    DepthStencilState dss = new DepthStencilState();
    dss.DepthBufferEnable = true;
    GraphicsDevice.DepthStencilState = dss;

    //GraphicsDevice.RenderState.AlphaBlendEnable = false;
    //GraphicsDevice.RenderState.AlphaTestEnable = false;

    //GraphicsDevice.SamplerStates[0].AddressU = TextureAddressMode.Wrap;
    //GraphicsDevice.SamplerStates[0].AddressV = TextureAddressMode.Wrap;
}

Since the Win and Loss screens differ only in the message, we can cheat a bit and just use the same function, passing in the game result.

Figure 3. FuelCell Congratulatory Screen

That's a Wrap!

After the (now) traditional rebuild and play session, you can now enjoy the introductory splash screen, a challenging game of retrieve the fuel cells, and (hopefully) a congratulatory winning screen.

At this point, the FuelCell game is complete. Even though you wrote a large amount of code, the possibilities for expansion are endless. For example:

  • Multiplayer - invite a competitor and whomever collects the most fuel cells wins!
  • Powerups - Add another object, or two, that gives the player a boost of speed for 5 seconds or a "ghost" ability that ignores those pesky barriers!
  • Advanced lighting and effects - improve the default lighting with a glow effect or motion blur.
  • Sound - add the Whoosh! of fuel carrier acceleration or the Bonk! of barrier collision.

If you need more ideas for expanding FuelCell or want to interact with a like-minded community of fellow game developers, check out XNA Creators Club Online Web site. It's an excellent community-driven site that has active forums and helpful people who are designing new and exciting games.

Good luck in your game development future and, above all, have fun!

Expand image See Also

Conceptual

FuelCell Example Game


XNA Framework Class Library

XNA Framework Class Library

The XNA Framework class library is a library of classes, interfaces, and value types that are included in XNA Game Studio. This library provides access to XNA Framework functionality and is designed to be the foundation on which XNA Game Studio applications, components, and controls are built.

Expand image Namespaces

Microsoft.Xna.Framework
Provides commonly needed game classes such as timers and game loops.
Microsoft.Xna.Framework.Audio
Contains low-level application programming interface (API) methods that can load and manipulate XACT-created project and content files to play audio.
Microsoft.Xna.Framework.Content
Contains the run-time components of the Content Pipeline.
Microsoft.Xna.Framework.Design
Provides a unified way of converting types of values to other types.
Microsoft.Xna.Framework.GamerServices
Contains classes that implement various services related to gamers. These services communicate directly with the gamer, the gamer's data, or otherwise reflect choices the gamer makes. Gamer services include input device and profile data APIs.
Microsoft.Xna.Framework.Graphics
Contains low-level application programming interface (API) methods that take advantage of hardware acceleration capabilities to display 3D objects.
Microsoft.Xna.Framework.Graphics.PackedVector
Represents data types with components that are not multiples of 8 bits.
Microsoft.Xna.Framework.Input
Contains classes to receive input from keyboard, mouse, and Xbox 360 Controller devices.
Microsoft.Xna.Framework.Input.Touch
Contains classes that enable access to touch-based input on devices that support it.
Microsoft.Xna.Framework.Media
Contains classes to enumerate, play, and view songs, albums, playlists, and pictures.
Microsoft.Xna.Framework.Net
Contains classes that implement support for Xbox LIVE, multiplayer, and networking for XNA Framework games.
Microsoft.Xna.Framework.Storage
Contains classes that allow reading and writing of files.


Microsoft.Xna.Framework Namespace

Microsoft.Xna.Framework Namespace

Provides commonly needed game classes such as timers and game loops.

Expand image Classes

 | Name | Description
Public Class | BoundingFrustum | Defines a frustum and helps determine whether forms intersect with it.
Public Class | Curve | Stores an arbitrary collection of 2D CurveKey points, and provides methods for evaluating features of the curve they define.
Public Class | CurveKey | Represents a point in a multi-point curve.
Public Class | CurveKeyCollection | Contains the CurveKeys making up a Curve.
Public Class | DrawableGameComponent | A game component that is notified when it needs to draw itself.
Public Class | FrameworkDispatcher | Implements the Windows-specific portion of a FrameworkDispatcher class.
Public Class | Game | Provides basic graphics device initialization, game logic, and rendering code.
Public Class | GameComponent | Base class for all XNA Framework game components.
Public Class | GameComponentCollection | A collection of game components.
Public Class | GameComponentCollectionEventArgs | Arguments used with events from the GameComponentCollection.
Public Class | GameServiceContainer | A collection of game services.
Public Class | GameTime | Snapshot of the game timing state expressed in values that can be used by variable-step (real time) or fixed-step (game time) games.
Public Class | GameWindow | The system window associated with a Game.
Public Class | GraphicsDeviceInformation | Holds the settings for creating a graphics device on Windows.
Public Class | GraphicsDeviceManager | Handles the configuration and management of the graphics device.
Public Class | LaunchParameters | The start up parameters for launching a Windows Phone or Windows game.
Public Class | MathHelper | Contains commonly used precalculated values.
Public Class | PreparingDeviceSettingsEventArgs | Arguments for the GraphicsDeviceManager.PreparingDeviceSettings event.
Public Class | TitleContainer | Provides file stream access to the title's default storage location.

Expand image Interfaces

 | Name | Description
Public Interface | IDrawable | Defines the interface for a drawable game component.
Public Interface | IGameComponent | Defines an interface for game components.
Public Interface | IGraphicsDeviceManager | Defines the interface for an object that manages a GraphicsDevice.
Public Interface | IUpdateable | Defines an interface for a game component that should be updated in Game.Update.

Expand image Structures

 | Name | Description
Public Structure | BoundingBox | Defines an axis-aligned box-shaped 3D volume.
Public Structure | BoundingSphere | Defines a sphere.
Public Structure | Color | Represents a four-component color using red, green, blue, and alpha data.
Public Structure | Matrix | Defines a matrix.
Public Structure | Plane | Defines a plane.
Public Structure | Point | Defines a point in 2D space.
Public Structure | Quaternion | Defines a four-dimensional vector (x,y,z,w), which is used to efficiently rotate an object about the (x, y, z) vector by the angle theta, where w = cos(theta/2).
Public Structure | Ray | Defines a ray.
Public Structure | Rectangle | Defines a rectangle.
Public Structure | Vector2 | Defines a vector with two components.
Public Structure | Vector3 | Defines a vector with three components.
Public Structure | Vector4 | Defines a vector with four components.

Expand image Enumerations

 | Name | Description
Public Enumeration | ContainmentType | Indicates the extent to which bounding volumes intersect or contain one another.
Public Enumeration | CurveContinuity | Defines the continuity of CurveKeys on a Curve.
Public Enumeration | CurveLoopType | Defines how the value of a Curve will be determined for positions before the first point on the Curve or after the last point on the Curve.
Public Enumeration | CurveTangent | Specifies different tangent types to be calculated for CurveKey points in a Curve.
Public Enumeration | DisplayOrientation | Defines the display orientation.
Public Enumeration | PlaneIntersectionType | Describes the intersection between a plane and a bounding volume.
Public Enumeration | PlayerIndex | Specifies the game controller associated with a player.

Expand image See Also

Concepts

Math Content Catalog at XNA Creators Club Online


BoundingBox Structure

BoundingBox Structure

Defines an axis-aligned box-shaped 3D volume.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.BoundingBoxConverter)")]
[SerializableAttribute]
public struct BoundingBox : IEquatable<BoundingBox>

Expand image See Also

Reference

BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox Members

BoundingBox Members
See Also Constructors Fields Methods
CollapseAll image

The following tables list the members exposed by the BoundingBox type.

Expand image Public Constructors

 | Name | Description
Public Method | BoundingBox | Creates an instance of BoundingBox.

Expand image Public Fields

 | Name | Description
Public Field | CornerCount | Specifies the total number of corners (8) in the BoundingBox.
Public Field | Max | The maximum point the BoundingBox contains.
Public Field | Min | The minimum point the BoundingBox contains.

Expand image Public Methods

 | Name | Description
Public Method | Contains | Overloaded. Tests whether the BoundingBox overlaps another bounding volume.
 | CreateFromPoints | Creates the smallest BoundingBox that will contain a group of points.
 | CreateFromSphere | Overloaded. Creates the smallest BoundingBox that will contain the specified BoundingSphere.
 | CreateMerged | Overloaded. Creates the smallest BoundingBox that contains the two specified BoundingBox instances.
Public Method | Equals | Overloaded. Determines whether two instances of BoundingBox are equal.
Public Method | GetCorners | Overloaded. Gets an array of points that make up the corners of the BoundingBox.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
Public Method | Intersects | Overloaded. Checks whether the current BoundingBox intersects with another bounding volume.
 | op_Equality | Determines whether two instances of BoundingBox are equal.
 | op_Inequality | Determines whether two instances of BoundingBox are not equal.
Public Method | ToString | Returns a String that represents the current BoundingBox.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BoundingBox Structure
Microsoft.Xna.Framework Namespace


BoundingBox Fields

BoundingBox Fields

Expand image Public Fields

 | Name | Description
Public Field | CornerCount | Specifies the total number of corners (8) in the BoundingBox.
Public Field | Max | The maximum point the BoundingBox contains.
Public Field | Min | The minimum point the BoundingBox contains.

Expand image See Also

Reference

BoundingBox Structure
Microsoft.Xna.Framework Namespace


BoundingBox.CornerCount Field

BoundingBox.CornerCount Field

Specifies the total number of corners (8) in the BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public const int CornerCount

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Max Field

BoundingBox.Max Field

The maximum point the BoundingBox contains.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Max

Expand image Remarks

The maximum point is the point with components that are greater than or equal to the components of every other point within the BoundingBox. Since a BoundingBox is axis aligned the maximum point is the upper-right corner of the front face of the BoundingBox when looking at it from the positive z direction.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Min Field

BoundingBox.Min Field

The minimum point the BoundingBox contains.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Min

Expand image Remarks

The minimum point is the point with components that are less than or equal to the components of every other point within the BoundingBox. Since a BoundingBox is axis aligned the minimum point is the lower-left corner of the back face of the BoundingBox when looking at it from the positive z direction.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox Constructor

BoundingBox Constructor

Creates an instance of BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public BoundingBox (
         Vector3 min,
         Vector3 max
)

Parameters

min
The minimum point the BoundingBox includes.
max
The maximum point the BoundingBox includes.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox Methods

BoundingBox Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | Overloaded. Tests whether the BoundingBox overlaps another bounding volume.
 | CreateFromPoints | Creates the smallest BoundingBox that will contain a group of points.
 | CreateFromSphere | Overloaded. Creates the smallest BoundingBox that will contain the specified BoundingSphere.
 | CreateMerged | Overloaded. Creates the smallest BoundingBox that contains the two specified BoundingBox instances.
Public Method | Equals | Overloaded. Determines whether two instances of BoundingBox are equal.
Public Method | GetCorners | Overloaded. Gets an array of points that make up the corners of the BoundingBox.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
Public Method | Intersects | Overloaded. Checks whether the current BoundingBox intersects with another bounding volume.
 | op_Equality | Determines whether two instances of BoundingBox are equal.
 | op_Inequality | Determines whether two instances of BoundingBox are not equal.
Public Method | ToString | Returns a String that represents the current BoundingBox.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BoundingBox Structure
Microsoft.Xna.Framework Namespace


BoundingBox.Contains Method

BoundingBox.Contains Method

Tests whether the BoundingBox overlaps another bounding volume.

Expand image Overload List

Name | Description
BoundingBox.Contains (BoundingBox) | Tests whether the BoundingBox contains another BoundingBox.
BoundingBox.Contains (BoundingBox, ContainmentType) | Tests whether the BoundingBox contains a BoundingBox.
BoundingBox.Contains (BoundingFrustum) | Tests whether the BoundingBox contains a BoundingFrustum.
BoundingBox.Contains (BoundingSphere) | Tests whether the BoundingBox contains a BoundingSphere.
BoundingBox.Contains (BoundingSphere, ContainmentType) | Tests whether the BoundingBox contains a BoundingSphere.
BoundingBox.Contains (Vector3) | Tests whether the BoundingBox contains a point.
BoundingBox.Contains (Vector3, ContainmentType) | Tests whether the BoundingBox contains a point.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace


BoundingBox.Contains Method (BoundingBox)

BoundingBox.Contains Method (BoundingBox)
See Also
CollapseAll image

Tests whether the BoundingBox contains another BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         BoundingBox box
)

Parameters

box
The BoundingBox to test for overlap.

Return Value

Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Contains Method (BoundingBox, ContainmentType)

BoundingBox.Contains Method (BoundingBox, ContainmentType)
See Also
CollapseAll image

Tests whether the BoundingBox contains a BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref BoundingBox box,
         out ContainmentType result
)

Parameters

box
The BoundingBox to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Contains Method (BoundingFrustum)

BoundingBox.Contains Method (BoundingFrustum)
See Also
CollapseAll image

Tests whether the BoundingBox contains a BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         BoundingFrustum frustum
)

Parameters

frustum
The BoundingFrustum to test for overlap.

Return Value

Enumeration indicating the extent of overlap.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | frustum is null.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Contains Method (BoundingSphere)

BoundingBox.Contains Method (BoundingSphere)
See Also
CollapseAll image

Tests whether the BoundingBox contains a BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         BoundingSphere sphere
)

Parameters

sphere
The BoundingSphere to test for overlap.

Return Value

Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Contains Method (BoundingSphere, ContainmentType)

BoundingBox.Contains Method (BoundingSphere, ContainmentType)
See Also
CollapseAll image

Tests whether the BoundingBox contains a BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref BoundingSphere sphere,
         out ContainmentType result
)

Parameters

sphere
The BoundingSphere to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Contains Method (Vector3)

BoundingBox.Contains Method (Vector3)
See Also
CollapseAll image

Tests whether the BoundingBox contains a point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         Vector3 point
)

Parameters

point
The point to test for overlap.

Return Value

Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Contains Method (Vector3, ContainmentType)

BoundingBox.Contains Method (Vector3, ContainmentType)
See Also
CollapseAll image

Tests whether the BoundingBox contains a point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref Vector3 point,
         out ContainmentType result
)

Parameters

point
The point to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.CreateFromPoints Method

BoundingBox.CreateFromPoints Method

Creates the smallest BoundingBox that will contain a group of points.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static BoundingBox CreateFromPoints (
         IEnumerable<Vector3> points
)

Parameters

points
A list of points the BoundingBox should contain.

Return Value

The created BoundingBox.

Expand image Exceptions

Exception type | Condition
ArgumentException | There are no points in points.
ArgumentNullException | points is null.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.CreateFromSphere Method

BoundingBox.CreateFromSphere Method

Creates the smallest BoundingBox that will contain the specified BoundingSphere.

Expand image Overload List

Name | Description
BoundingBox.CreateFromSphere (BoundingSphere) | Creates the smallest BoundingBox that will contain the specified BoundingSphere.
BoundingBox.CreateFromSphere (BoundingSphere, BoundingBox) | Creates the smallest BoundingBox that will contain the specified BoundingSphere.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace


BoundingBox.CreateFromSphere Method (BoundingSphere)

BoundingBox.CreateFromSphere Method (BoundingSphere)
See Also
CollapseAll image

Creates the smallest BoundingBox that will contain the specified BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static BoundingBox CreateFromSphere (
         BoundingSphere sphere
)

Parameters

sphere
The BoundingSphere to contain.

Return Value

The created BoundingBox.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.CreateFromSphere Method (BoundingSphere, BoundingBox)

BoundingBox.CreateFromSphere Method (BoundingSphere, BoundingBox)
See Also
CollapseAll image

Creates the smallest BoundingBox that will contain the specified BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateFromSphere (
         ref BoundingSphere sphere,
         out BoundingBox result
)

Parameters

sphere
The BoundingSphere to contain.
result
[OutAttribute] The created BoundingBox.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.CreateMerged Method

BoundingBox.CreateMerged Method

Creates the smallest BoundingBox that contains the two specified BoundingBox instances.

Expand image Overload List

Name | Description
BoundingBox.CreateMerged (BoundingBox, BoundingBox) | Creates the smallest BoundingBox that contains the two specified BoundingBox instances.
BoundingBox.CreateMerged (BoundingBox, BoundingBox, BoundingBox) | Creates the smallest BoundingBox that contains the two specified BoundingBox instances.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace


BoundingBox.CreateMerged Method (BoundingBox, BoundingBox)

BoundingBox.CreateMerged Method (BoundingBox, BoundingBox)
See Also
CollapseAll image

Creates the smallest BoundingBox that contains the two specified BoundingBox instances.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static BoundingBox CreateMerged (
         BoundingBox original,
         BoundingBox additional
)

Parameters

original
One of the BoundingBoxs to contain.
additional
One of the BoundingBoxs to contain.

Return Value

The created BoundingBox.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.CreateMerged Method (BoundingBox, BoundingBox, BoundingBox)

BoundingBox.CreateMerged Method (BoundingBox, BoundingBox, BoundingBox)
See Also
CollapseAll image

Creates the smallest BoundingBox that contains the two specified BoundingBox instances.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateMerged (
         ref BoundingBox original,
         ref BoundingBox additional,
         out BoundingBox result
)

Parameters

original
One of the BoundingBox instances to contain.
additional
One of the BoundingBox instances to contain.
result
[OutAttribute] The created BoundingBox.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Equals Method

BoundingBox.Equals Method

Determines whether two instances of BoundingBox are equal.

Expand image Overload List

Name | Description
BoundingBox.Equals (BoundingBox) | Determines whether two instances of BoundingBox are equal.
BoundingBox.Equals (Object) | Determines whether two instances of BoundingBox are equal.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace


BoundingBox.Equals Method (BoundingBox)

BoundingBox.Equals Method (BoundingBox)
See Also
CollapseAll image

Determines whether two instances of BoundingBox are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         BoundingBox other
)

Parameters

other
The BoundingBox to compare with the current BoundingBox.

Return Value

true if the specified BoundingBox is equal to the current BoundingBox; false otherwise.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Equals Method (Object)

BoundingBox.Equals Method (Object)
See Also
CollapseAll image

Determines whether two instances of BoundingBox are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current BoundingBox.

Return Value

true if the specified Object is equal to the current BoundingBox; false otherwise.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.GetCorners Method

BoundingBox.GetCorners Method

Gets an array of points that make up the corners of the BoundingBox.

Expand image Overload List

Name | Description
BoundingBox.GetCorners () | Gets an array of points that make up the corners of the BoundingBox.
BoundingBox.GetCorners (Vector3[]) | Gets the array of points that make up the corners of the BoundingBox.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace


BoundingBox.GetCorners Method ()

BoundingBox.GetCorners Method ()
See Also
CollapseAll image

Gets an array of points that make up the corners of the BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3[] GetCorners ()

Return Value

An array of Vector3 points that represent the corners of the BoundingBox.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | You have to have at least 8 elements to copy corners.

Expand image Remarks

The points returned correspond to the corners of the BoundingBox faces that are perpendicular to the z-axis. The near face is the face with the larger z value, and the far face is the face with the smaller z value. Points 0 to 3 correspond to the near face in a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction. Points 4 to 7 correspond to the far face in a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.GetCorners Method (Vector3[])

BoundingBox.GetCorners Method (Vector3[])
See Also
CollapseAll image

Gets the array of points that make up the corners of the BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void GetCorners (
         Vector3[] corners
)

Parameters

corners
An existing array of at least 8 Vector3 points where the corners of the BoundingBox are written.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | corners is null.
ArgumentOutOfRangeException | You have to have at least 8 elements to copy corners.

Expand image Remarks

The points returned correspond to the corners of the BoundingBox faces that are perpendicular to the z-axis. The near face is the face with the larger z value, and the far face is the face with the smaller z value. Points 0 to 3 correspond to the near face in a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction. Points 4 to 7 correspond to the far face in a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.GetHashCode Method

BoundingBox.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

A hash code for the current BoundingBox.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Intersects Method

BoundingBox.Intersects Method

Checks whether the current BoundingBox intersects with another bounding volume.

Expand image Overload List

Name | Description
BoundingBox.Intersects (BoundingBox) | Checks whether the current BoundingBox intersects another BoundingBox.
BoundingBox.Intersects (BoundingBox, Boolean) | Checks whether the current BoundingBox intersects another BoundingBox.
BoundingBox.Intersects (BoundingFrustum) | Checks whether the current BoundingBox intersects a BoundingFrustum.
BoundingBox.Intersects (BoundingSphere) | Checks whether the current BoundingBox intersects a BoundingSphere.
BoundingBox.Intersects (BoundingSphere, Boolean) | Checks whether the current BoundingBox intersects a BoundingSphere.
BoundingBox.Intersects (Plane) | Checks whether the current BoundingBox intersects a Plane.
BoundingBox.Intersects (Plane, PlaneIntersectionType) | Checks whether the current BoundingBox intersects a Plane.
BoundingBox.Intersects (Ray) | Checks whether the current BoundingBox intersects a Ray.
BoundingBox.Intersects (Ray, Nullable<Single>) | Checks whether the current BoundingBox intersects a Ray.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace


BoundingBox.Intersects Method (BoundingBox)

BoundingBox.Intersects Method (BoundingBox)
See Also
CollapseAll image

Checks whether the current BoundingBox intersects another BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Intersects (
         BoundingBox box
)

Parameters

box
The BoundingBox to check for intersection with.

Return Value

true if the BoundingBoxs intersect; false otherwise.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Intersects Method (BoundingBox, Boolean)

BoundingBox.Intersects Method (BoundingBox, Boolean)
See Also
CollapseAll image

Checks whether the current BoundingBox intersects another BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref BoundingBox box,
         out bool result
)

Parameters

box
The BoundingBox to check for intersection with.
result
[OutAttribute] true if the BoundingBox instances intersect; false otherwise.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Intersects Method (BoundingFrustum)

BoundingBox.Intersects Method (BoundingFrustum)
See Also
CollapseAll image

Checks whether the current BoundingBox intersects a BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Intersects (
         BoundingFrustum frustum
)

Parameters

frustum
The BoundingFrustum to check for intersection with.

Return Value

true if the BoundingBox and BoundingFrustum intersect; false otherwise.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | frustum is null.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Intersects Method (BoundingSphere)

BoundingBox.Intersects Method (BoundingSphere)
See Also
CollapseAll image

Checks whether the current BoundingBox intersects a BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Intersects (
         BoundingSphere sphere
)

Parameters

sphere
The BoundingSphere to check for intersection with.

Return Value

true if the BoundingBox and BoundingSphere intersect; false otherwise.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Intersects Method (BoundingSphere, Boolean)

BoundingBox.Intersects Method (BoundingSphere, Boolean)
See Also
CollapseAll image

Checks whether the current BoundingBox intersects a BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref BoundingSphere sphere,
         out bool result
)

Parameters

sphere
The BoundingSphere to check for intersection with.
result
[OutAttribute] true if the BoundingBox and BoundingSphere intersect; false otherwise.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Intersects Method (Plane)

BoundingBox.Intersects Method (Plane)
See Also
CollapseAll image

Checks whether the current BoundingBox intersects a Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PlaneIntersectionType Intersects (
         Plane plane
)

Parameters

plane
The Plane to check for intersection with.

Return Value

An enumeration indicating whether the BoundingBox intersects the Plane.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Intersects Method (Plane, PlaneIntersectionType)

BoundingBox.Intersects Method (Plane, PlaneIntersectionType)
See Also
CollapseAll image

Checks whether the current BoundingBox intersects a Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref Plane plane,
         out PlaneIntersectionType result
)

Parameters

plane
The Plane to check for intersection with.
result
[OutAttribute] An enumeration indicating whether the BoundingBox intersects the Plane.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Intersects Method (Ray)

BoundingBox.Intersects Method (Ray)
See Also
CollapseAll image

Checks whether the current BoundingBox intersects a Ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Nullable<float> Intersects (
         Ray ray
)

Parameters

ray
The Ray to check for intersection with.

Return Value

Distance at which the ray intersects the BoundingBox, or null if there is no intersection.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.Intersects Method (Ray, Nullable<Single>)

BoundingBox.Intersects Method (Ray, Nullable<Single>)
See Also
CollapseAll image

Checks whether the current BoundingBox intersects a Ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref Ray ray,
         out Nullable<float> result
)

Parameters

ray
The Ray to check for intersection with.
result
[OutAttribute] Distance at which the ray intersects the BoundingBox, or null if there is no intersection.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.op_Equality Method

BoundingBox.op_Equality Method

Determines whether two instances of BoundingBox are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         BoundingBox a,
         BoundingBox b
)

Parameters

a
BoundingBox to compare.
b
BoundingBox to compare.

Return Value

true if the two BoundingBoxs are equal; false otherwise.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.op_Inequality Method

BoundingBox.op_Inequality Method

Determines whether two instances of BoundingBox are not equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         BoundingBox a,
         BoundingBox b
)

Parameters

a
The object to the left of the inequality operator.
b
The object to the right of the inequality operator.

Return Value

true if left is not equal to right; false otherwise.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingBox.ToString Method

BoundingBox.ToString Method

Returns a String that represents the current BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of the current BoundingBox.

Expand image See Also

Reference

BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum Class

BoundingFrustum Class
See Also Members
CollapseAll image

Defines a frustum and helps determine whether forms intersect with it.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)]
[SerializableAttribute]
public class BoundingFrustum : IEquatable<BoundingFrustum>

Expand image Remarks

A frustum in computer graphics is generally a volume of 3D space, defined as the part of a rectangular pyramid that lies between two planes perpendicular to its center line. A frustum is often used to represent what a "camera" sees in your 3D space—for example:

The BoundingFrustum class allows you to define a bounding frustum using a combined matrix that is generally the product of a view matrix and a projection matrix.

You can query a BoundingFrustum object for any one of its bounding planes, for its corners, and for whether it intersects with a given object. Since objects that don't intersect with your view frustrum generally don't need to be rendered, culling them quickly can save you a lot of rendering time.

Expand image See Also

Reference

BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum Members

BoundingFrustum Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the BoundingFrustum type.

Expand image Public Constructors

 | Name | Description
Public Method | BoundingFrustum | Creates a new instance of BoundingFrustum.

Expand image Public Fields

 | Name | Description
Public Field | CornerCount | Specifies the total number of corners (8) in the BoundingFrustum.

Expand image Public Properties

 | Name | Description
Public Property | Bottom | Gets the bottom plane of the BoundingFrustum.
Public Property | Far | Gets the far plane of the BoundingFrustum.
Public Property | Left | Gets the left plane of the BoundingFrustum.
Public Property | Matrix | Gets or sets the Matrix that describes this bounding frustum.
Public Property | Near | Gets the near plane of the BoundingFrustum.
Public Property | Right | Gets the right plane of the BoundingFrustum.
Public Property | Top | Gets the top plane of the BoundingFrustum.

Expand image Public Methods

 | Name | Description
Public Method | Contains | Overloaded. Checks whether the current BoundingFrustum contains a specified bounding volume.
Public Method | Equals | Overloaded. Determines whether two instances of BoundingFrustum are equal.
Public Method | GetCorners | Overloaded. Gets an array of points that make up the corners of the BoundingFrustum.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
Public Method | Intersects | Overloaded. Checks whether the current BoundingFrustum intersects a specified volume.
 | op_Equality | Determines whether two instances of BoundingFrustum are equal.
 | op_Inequality | Determines whether two instances of BoundingFrustum are not equal.
Public Method | ToString | Returns a String that represents the current BoundingFrustum.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BoundingFrustum Class
Microsoft.Xna.Framework Namespace


BoundingFrustum Fields

BoundingFrustum Fields

Expand image Public Fields

 | Name | Description
Public Field | CornerCount | Specifies the total number of corners (8) in the BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
Microsoft.Xna.Framework Namespace


BoundingFrustum.CornerCount Field

BoundingFrustum.CornerCount Field

Specifies the total number of corners (8) in the BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public const int CornerCount

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum Constructor

BoundingFrustum Constructor

Creates a new instance of BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public BoundingFrustum (
         Matrix value
)

Parameters

value
Combined matrix that usually takes view × projection matrix.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum Methods

BoundingFrustum Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | Overloaded. Checks whether the current BoundingFrustum contains a specified bounding volume.
Public Method | Equals | Overloaded. Determines whether two instances of BoundingFrustum are equal.
Public Method | GetCorners | Overloaded. Gets an array of points that make up the corners of the BoundingFrustum.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
Public Method | Intersects | Overloaded. Checks whether the current BoundingFrustum intersects a specified volume.
 | op_Equality | Determines whether two instances of BoundingFrustum are equal.
 | op_Inequality | Determines whether two instances of BoundingFrustum are not equal.
Public Method | ToString | Returns a String that represents the current BoundingFrustum.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BoundingFrustum Class
Microsoft.Xna.Framework Namespace


BoundingFrustum.Contains Method

BoundingFrustum.Contains Method

Checks whether the current BoundingFrustum contains a specified bounding volume.

Expand image Overload List

Name | Description
BoundingFrustum.Contains (BoundingBox) | Checks whether the current BoundingFrustum contains the specified BoundingBox.
BoundingFrustum.Contains (BoundingBox, ContainmentType) | Checks whether the current BoundingFrustum contains the specified BoundingBox.
BoundingFrustum.Contains (BoundingFrustum) | Checks whether the current BoundingFrustum contains the specified BoundingFrustum.
BoundingFrustum.Contains (BoundingSphere) | Checks whether the current BoundingFrustum contains the specified BoundingSphere.
BoundingFrustum.Contains (BoundingSphere, ContainmentType) | Checks whether the current BoundingFrustum contains the specified BoundingSphere.
BoundingFrustum.Contains (Vector3) | Checks whether the current BoundingFrustum contains the specified point.
BoundingFrustum.Contains (Vector3, ContainmentType) | Checks whether the current BoundingFrustum contains the specified point.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace


BoundingFrustum.Contains Method (BoundingBox)

BoundingFrustum.Contains Method (BoundingBox)
See Also
CollapseAll image

Checks whether the current BoundingFrustum contains the specified BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         BoundingBox box
)

Parameters

box
The BoundingBox to check against the current BoundingFrustum.

Return Value

Enumeration indicating the relationship of the current BoundingFrustum to the specified BoundingBox.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Contains Method (BoundingBox, ContainmentType)

BoundingFrustum.Contains Method (BoundingBox, ContainmentType)
See Also
CollapseAll image

Checks whether the current BoundingFrustum contains the specified BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref BoundingBox box,
         out ContainmentType result
)

Parameters

box
The BoundingBox to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Contains Method (BoundingFrustum)

BoundingFrustum.Contains Method (BoundingFrustum)
See Also
CollapseAll image

Checks whether the current BoundingFrustum contains the specified BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         BoundingFrustum frustum
)

Parameters

frustum
The BoundingFrustum to check against the current BoundingFrustum.

Return Value

Enumeration indicating the relationship of the current BoundingFrustum to the specified BoundingFrustum.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | frustum is null.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Contains Method (BoundingSphere)

BoundingFrustum.Contains Method (BoundingSphere)
See Also
CollapseAll image

Checks whether the current BoundingFrustum contains the specified BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         BoundingSphere sphere
)

Parameters

sphere
The BoundingSphere to check against the current BoundingFrustum.

Return Value

Enumeration indicating the relationship of the current BoundingFrustum to the specified BoundingSphere.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Contains Method (BoundingSphere, ContainmentType)

BoundingFrustum.Contains Method (BoundingSphere, ContainmentType)
See Also
CollapseAll image

Checks whether the current BoundingFrustum contains the specified BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref BoundingSphere sphere,
         out ContainmentType result
)

Parameters

sphere
The BoundingSphere to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Contains Method (Vector3)

BoundingFrustum.Contains Method (Vector3)
See Also
CollapseAll image

Checks whether the current BoundingFrustum contains the specified point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         Vector3 point
)

Parameters

point
The point to check against the current BoundingFrustum.

Return Value

Enumeration indicating the relationship of the current BoundingFrustum to the specified point.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Contains Method (Vector3, ContainmentType)

BoundingFrustum.Contains Method (Vector3, ContainmentType)
See Also
CollapseAll image

Checks whether the current BoundingFrustum contains the specified point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref Vector3 point,
         out ContainmentType result
)

Parameters

point
The point to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Equals Method

BoundingFrustum.Equals Method

Determines whether two instances of BoundingFrustum are equal.

Expand image Overload List

Name | Description
BoundingFrustum.Equals (BoundingFrustum) | Determines whether the specified BoundingFrustum is equal to the current BoundingFrustum.
BoundingFrustum.Equals (Object) | Determines whether the specified Object is equal to the BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace


BoundingFrustum.Equals Method (BoundingFrustum)

BoundingFrustum.Equals Method (BoundingFrustum)
See Also
CollapseAll image

Determines whether the specified BoundingFrustum is equal to the current BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         BoundingFrustum other
)

Parameters

other
The BoundingFrustum to compare with the current BoundingFrustum.

Return Value

true if the specified BoundingFrustum is equal to the current BoundingFrustum; false otherwise.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Equals Method (Object)

BoundingFrustum.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to the BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current BoundingFrustum.

Return Value

true if the specified Object is equal to the current BoundingFrustum; false otherwise.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.GetCorners Method

BoundingFrustum.GetCorners Method

Gets an array of points that make up the corners of the BoundingFrustum.

Expand image Overload List

Name | Description
BoundingFrustum.GetCorners () | Gets an array of points that make up the corners of the BoundingFrustum.
BoundingFrustum.GetCorners (Vector3[]) | Gets an array of points that make up the corners of the BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace


BoundingFrustum.GetCorners Method ()

BoundingFrustum.GetCorners Method ()
See Also
CollapseAll image

Gets an array of points that make up the corners of the BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3[] GetCorners ()

Return Value

Array of Vector3 points that make up the corners of the BoundingFrustum.

Expand image Remarks

The points returned correspond to the corners of the BoundingFrustum faces that are perpendicular to the z-axis. The near face is the face with the larger z value, and the far face is the face with the smaller z value. Points 0 to 3 correspond to the near face in a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction. Points 4 to 7 correspond to the far face in a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.GetCorners Method (Vector3[])

BoundingFrustum.GetCorners Method (Vector3[])
See Also
CollapseAll image

Gets an array of points that make up the corners of the BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void GetCorners (
         Vector3[] corners
)

Parameters

corners
An existing array of at least 8 Vector3 points where the corners of the BoundingFrustum are written.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | corners is null.
ArgumentOutOfRangeException | You have to have at least 8 elements to copy corners.

Expand image Remarks

The points returned correspond to the corners of the BoundingFrustum faces that are perpendicular to the z-axis. The near face is the face with the larger z value, and the far face is the face with the smaller z value. Points 0 to 3 correspond to the near face in a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction. Points 4 to 7 correspond to the far face in a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.GetHashCode Method

BoundingFrustum.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

A hash code for the current BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Intersects Method

BoundingFrustum.Intersects Method

Checks whether the current BoundingFrustum intersects a specified volume.

Expand image Overload List

Name | Description
BoundingFrustum.Intersects (BoundingBox) | Checks whether the current BoundingFrustum intersects the specified BoundingBox.
BoundingFrustum.Intersects (BoundingBox, Boolean) | Checks whether the current BoundingFrustum intersects a BoundingBox.
BoundingFrustum.Intersects (BoundingFrustum) | Checks whether the current BoundingFrustum intersects the specified BoundingFrustum.
BoundingFrustum.Intersects (BoundingSphere) | Checks whether the current BoundingFrustum intersects the specified BoundingSphere.
BoundingFrustum.Intersects (BoundingSphere, Boolean) | Checks whether the current BoundingFrustum intersects a BoundingSphere.
BoundingFrustum.Intersects (Plane) | Checks whether the current BoundingFrustum intersects the specified Plane.
BoundingFrustum.Intersects (Plane, PlaneIntersectionType) | Checks whether the current BoundingFrustum intersects a Plane.
BoundingFrustum.Intersects (Ray) | Checks whether the current BoundingFrustum intersects the specified Ray.
BoundingFrustum.Intersects (Ray, Nullable<Single>) | Checks whether the current BoundingFrustum intersects a Ray.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace


BoundingFrustum.Intersects Method (BoundingBox)

BoundingFrustum.Intersects Method (BoundingBox)
See Also
CollapseAll image

Checks whether the current BoundingFrustum intersects the specified BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Intersects (
         BoundingBox box
)

Parameters

box
The BoundingBox to check for intersection.

Return Value

true if the BoundingFrustum intersects the BoundingBox; false otherwise.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Intersects Method (BoundingBox, Boolean)

BoundingFrustum.Intersects Method (BoundingBox, Boolean)
See Also
CollapseAll image

Checks whether the current BoundingFrustum intersects a BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref BoundingBox box,
         out bool result
)

Parameters

box
The BoundingBox to check for intersection with.
result
[OutAttribute] true if the BoundingFrustum and BoundingBox intersect; false otherwise.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Intersects Method (BoundingFrustum)

BoundingFrustum.Intersects Method (BoundingFrustum)
See Also
CollapseAll image

Checks whether the current BoundingFrustum intersects the specified BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Intersects (
         BoundingFrustum frustum
)

Parameters

frustum
The BoundingFrustum to check for intersection.

Return Value

true if the current BoundingFrustum intersects the specified BoundingFrustum; false otherwise.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | frustum is null.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Intersects Method (BoundingSphere)

BoundingFrustum.Intersects Method (BoundingSphere)
See Also
CollapseAll image

Checks whether the current BoundingFrustum intersects the specified BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Intersects (
         BoundingSphere sphere
)

Parameters

sphere
The BoundingSphere to check for intersection.

Return Value

true if the BoundingFrustum intersects the BoundingSphere; false otherwise.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Intersects Method (BoundingSphere, Boolean)

BoundingFrustum.Intersects Method (BoundingSphere, Boolean)
See Also
CollapseAll image

Checks whether the current BoundingFrustum intersects a BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref BoundingSphere sphere,
         out bool result
)

Parameters

sphere
The BoundingSphere to check for intersection with.
result
[OutAttribute] true if the BoundingFrustum and BoundingSphere intersect; false otherwise.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Intersects Method (Plane)

BoundingFrustum.Intersects Method (Plane)
See Also
CollapseAll image

Checks whether the current BoundingFrustum intersects the specified Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PlaneIntersectionType Intersects (
         Plane plane
)

Parameters

plane
The Plane to check for intersection.

Return Value

An enumeration indicating whether BoundingFrustum intersects the specified Plane.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Intersects Method (Plane, PlaneIntersectionType)

BoundingFrustum.Intersects Method (Plane, PlaneIntersectionType)
See Also
CollapseAll image

Checks whether the current BoundingFrustum intersects a Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref Plane plane,
         out PlaneIntersectionType result
)

Parameters

plane
The Plane to check for intersection with.
result
[OutAttribute] An enumeration indicating whether the BoundingFrustum intersects the Plane.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Intersects Method (Ray)

BoundingFrustum.Intersects Method (Ray)
See Also
CollapseAll image

Checks whether the current BoundingFrustum intersects the specified Ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Nullable<float> Intersects (
         Ray ray
)

Parameters

ray
The Ray to check for intersection.

Return Value

Distance at which the ray intersects the BoundingFrustum or null if there is no intersection.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Intersects Method (Ray, Nullable<Single>)

BoundingFrustum.Intersects Method (Ray, Nullable<Single>)
See Also
CollapseAll image

Checks whether the current BoundingFrustum intersects a Ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref Ray ray,
         out Nullable<float> result
)

Parameters

ray
The Ray to check for intersection with.
result
[OutAttribute] Distance at which the ray intersects the BoundingFrustum or null if there is no intersection.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.op_Equality Method

BoundingFrustum.op_Equality Method

Determines whether two instances of BoundingFrustum are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         BoundingFrustum a,
         BoundingFrustum b
)

Parameters

a
The BoundingFrustum to the left of the equality operator.
b
The BoundingFrustum to the right of the equality operator.

Return Value

true if left is equal to right; false otherwise.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.op_Inequality Method

BoundingFrustum.op_Inequality Method

Determines whether two instances of BoundingFrustum are not equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         BoundingFrustum a,
         BoundingFrustum b
)

Parameters

a
The BoundingFrustum to the left of the inequality operator.
b
The BoundingFrustum to the right of the inequality operator.

Return Value

true if left is not equal to right; false otherwise.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.ToString Method

BoundingFrustum.ToString Method

Returns a String that represents the current BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of the current BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum Properties

BoundingFrustum Properties

Expand image Public Properties

 | Name | Description
Public Property | Bottom | Gets the bottom plane of the BoundingFrustum.
Public Property | Far | Gets the far plane of the BoundingFrustum.
Public Property | Left | Gets the left plane of the BoundingFrustum.
Public Property | Matrix | Gets or sets the Matrix that describes this bounding frustum.
Public Property | Near | Gets the near plane of the BoundingFrustum.
Public Property | Right | Gets the right plane of the BoundingFrustum.
Public Property | Top | Gets the top plane of the BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
Microsoft.Xna.Framework Namespace


BoundingFrustum.Bottom Property

BoundingFrustum.Bottom Property

Gets the bottom plane of the BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Plane Bottom { get; }

Property Value

Returns the bottom plane of the BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Far Property

BoundingFrustum.Far Property

Gets the far plane of the BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Plane Far { get; }

Property Value

Returns the far plane of the BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Left Property

BoundingFrustum.Left Property

Gets the left plane of the BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Plane Left { get; }

Property Value

Returns the left plane of the BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Matrix Property

BoundingFrustum.Matrix Property

Gets or sets the Matrix that describes this bounding frustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Matrix Matrix { get; set; }

Property Value

The Matrix that describes this bounding frustum.

Expand image Remarks

This property can be used to reset an existing BoundingFrustum to new values, instead of creating a new one.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Near Property

BoundingFrustum.Near Property

Gets the near plane of the BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Plane Near { get; }

Property Value

Returns the near plane of the BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Right Property

BoundingFrustum.Right Property

Gets the right plane of the BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Plane Right { get; }

Property Value

Returns the right plane of the BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingFrustum.Top Property

BoundingFrustum.Top Property

Gets the top plane of the BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Plane Top { get; }

Property Value

Returns the top plane of the BoundingFrustum.

Expand image See Also

Reference

BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere Structure

BoundingSphere Structure

Defines a sphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.BoundingSphereConverter)")]
[SerializableAttribute]
public struct BoundingSphere : IEquatable<BoundingSphere>

Expand image See Also

Reference

BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere Members

BoundingSphere Members
See Also Constructors Fields Methods
CollapseAll image

The following tables list the members exposed by the BoundingSphere type.

Expand image Public Constructors

 | Name | Description
Public Method | BoundingSphere | Creates a new instance of BoundingSphere.

Expand image Public Fields

 | Name | Description
Public Field | Center | The center point of the sphere.
Public Field | Radius | The radius of the sphere.

Expand image Public Methods

 | Name | Description
Public Method | Contains | Overloaded. Checks whether the current BoundingSphere contains a specified bounding volume.
 | CreateFromBoundingBox | Overloaded. Creates the smallest BoundingSphere that can contain a specified BoundingBox.
 | CreateFromFrustum | Creates the smallest BoundingSphere that can contain a specified BoundingFrustum.
 | CreateFromPoints | Creates a BoundingSphere that can contain a specified list of points.
 | CreateMerged | Overloaded. Creates a BoundingSphere that contains the two specified BoundingSphere instances.
Public Method | Equals | Overloaded. Determines whether two instances of BoundingSphere are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
Public Method | Intersects | Overloaded. Checks whether the current BoundingSphere intersects another bounding volume.
 | op_Equality | Determines whether two instances of BoundingSphere are equal.
 | op_Inequality | Determines whether two instances of BoundingSphere are not equal.
Public Method | ToString | Returns a String that represents the current BoundingSphere.
Public Method | Transform | Overloaded. Translates and scales the BoundingSphere using a given Matrix.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BoundingSphere Structure
Microsoft.Xna.Framework Namespace


BoundingSphere Fields

BoundingSphere Fields

Expand image Public Fields

 | Name | Description
Public Field | Center | The center point of the sphere.
Public Field | Radius | The radius of the sphere.

Expand image See Also

Reference

BoundingSphere Structure
Microsoft.Xna.Framework Namespace


BoundingSphere.Center Field

BoundingSphere.Center Field

The center point of the sphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Center

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Radius Field

BoundingSphere.Radius Field

The radius of the sphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Radius

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere Constructor

BoundingSphere Constructor

Creates a new instance of BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public BoundingSphere (
         Vector3 center,
         float radius
)

Parameters

center
Center point of the sphere.
radius
Radius of the sphere.

Expand image Exceptions

Exception type | Condition
ArgumentException | radius is less than zero. radius must be greater than or equal to zero.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere Methods

BoundingSphere Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | Overloaded. Checks whether the current BoundingSphere contains a specified bounding volume.
 | CreateFromBoundingBox | Overloaded. Creates the smallest BoundingSphere that can contain a specified BoundingBox.
 | CreateFromFrustum | Creates the smallest BoundingSphere that can contain a specified BoundingFrustum.
 | CreateFromPoints | Creates a BoundingSphere that can contain a specified list of points.
 | CreateMerged | Overloaded. Creates a BoundingSphere that contains the two specified BoundingSphere instances.
Public Method | Equals | Overloaded. Determines whether two instances of BoundingSphere are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
Public Method | Intersects | Overloaded. Checks whether the current BoundingSphere intersects another bounding volume.
 | op_Equality | Determines whether two instances of BoundingSphere are equal.
 | op_Inequality | Determines whether two instances of BoundingSphere are not equal.
Public Method | ToString | Returns a String that represents the current BoundingSphere.
Public Method | Transform | Overloaded. Translates and scales the BoundingSphere using a given Matrix.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BoundingSphere Structure
Microsoft.Xna.Framework Namespace


BoundingSphere.Contains Method

BoundingSphere.Contains Method

Checks whether the current BoundingSphere contains a specified bounding volume.

Expand image Overload List

Name | Description
BoundingSphere.Contains (BoundingBox) | Checks whether the current BoundingSphere contains the specified BoundingBox.
BoundingSphere.Contains (BoundingBox, ContainmentType) | Checks whether the current BoundingSphere contains the specified BoundingBox.
BoundingSphere.Contains (BoundingFrustum) | Checks whether the current BoundingSphere contains the specified BoundingFrustum.
BoundingSphere.Contains (BoundingSphere) | Checks whether the current BoundingSphere contains the specified BoundingSphere.
BoundingSphere.Contains (BoundingSphere, ContainmentType) | Checks whether the current BoundingSphere contains the specified BoundingSphere.
BoundingSphere.Contains (Vector3) | Checks whether the current BoundingSphere contains the specified point.
BoundingSphere.Contains (Vector3, ContainmentType) | Checks whether the current BoundingSphere contains the specified point.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace


BoundingSphere.Contains Method (BoundingBox)

BoundingSphere.Contains Method (BoundingBox)
See Also
CollapseAll image

Checks whether the current BoundingSphere contains the specified BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         BoundingBox box
)

Parameters

box
The BoundingBox to check against the current BoundingSphere.

Return Value

An enumeration indicating the relationship of the specified BoundingBox to the current BoundingSphere.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Contains Method (BoundingBox, ContainmentType)

BoundingSphere.Contains Method (BoundingBox, ContainmentType)
See Also
CollapseAll image

Checks whether the current BoundingSphere contains the specified BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref BoundingBox box,
         out ContainmentType result
)

Parameters

box
The BoundingBox to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Contains Method (BoundingFrustum)

BoundingSphere.Contains Method (BoundingFrustum)
See Also
CollapseAll image

Checks whether the current BoundingSphere contains the specified BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         BoundingFrustum frustum
)

Parameters

frustum
The BoundingFrustum to check against the current BoundingSphere.

Return Value

An enumeration indicating the relationship of the specified BoundingFrustum to the current BoundingSphere.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | frustum is null.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Contains Method (BoundingSphere)

BoundingSphere.Contains Method (BoundingSphere)
See Also
CollapseAll image

Checks whether the current BoundingSphere contains the specified BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         BoundingSphere sphere
)

Parameters

sphere
The BoundingSphere to check against the current BoundingSphere.

Return Value

An enumeration indicating the relationship of the BoundingSpheres.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Contains Method (BoundingSphere, ContainmentType)

BoundingSphere.Contains Method (BoundingSphere, ContainmentType)
See Also
CollapseAll image

Checks whether the current BoundingSphere contains the specified BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref BoundingSphere sphere,
         out ContainmentType result
)

Parameters

sphere
The BoundingSphere to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Contains Method (Vector3)

BoundingSphere.Contains Method (Vector3)
See Also
CollapseAll image

Checks whether the current BoundingSphere contains the specified point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContainmentType Contains (
         Vector3 point
)

Parameters

point
The point to check against the current BoundingSphere.

Return Value

An enumeration indicating the relationship of the specified point to the current BoundingSphere.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Contains Method (Vector3, ContainmentType)

BoundingSphere.Contains Method (Vector3, ContainmentType)
See Also
CollapseAll image

Checks whether the current BoundingSphere contains the specified point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref Vector3 point,
         out ContainmentType result
)

Parameters

point
The point to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.CreateFromBoundingBox Method

BoundingSphere.CreateFromBoundingBox Method

Creates the smallest BoundingSphere that can contain a specified BoundingBox.

Expand image Overload List

Name | Description
BoundingSphere.CreateFromBoundingBox (BoundingBox) | Creates the smallest BoundingSphere that can contain a specified BoundingBox.
BoundingSphere.CreateFromBoundingBox (BoundingBox, BoundingSphere) | Creates the smallest BoundingSphere that can contain a specified BoundingBox.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace


BoundingSphere.CreateFromBoundingBox Method (BoundingBox)

BoundingSphere.CreateFromBoundingBox Method (BoundingBox)
See Also
CollapseAll image

Creates the smallest BoundingSphere that can contain a specified BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static BoundingSphere CreateFromBoundingBox (
         BoundingBox box
)

Parameters

box
The BoundingBox to create the BoundingSphere from.

Return Value

The created BoundingSphere.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.CreateFromBoundingBox Method (BoundingBox, BoundingSphere)

BoundingSphere.CreateFromBoundingBox Method (BoundingBox, BoundingSphere)
See Also
CollapseAll image

Creates the smallest BoundingSphere that can contain a specified BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateFromBoundingBox (
         ref BoundingBox box,
         out BoundingSphere result
)

Parameters

box
The BoundingBox to create the BoundingSphere from.
result
[OutAttribute] The created BoundingSphere.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.CreateFromFrustum Method

BoundingSphere.CreateFromFrustum Method

Creates the smallest BoundingSphere that can contain a specified BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static BoundingSphere CreateFromFrustum (
         BoundingFrustum frustum
)

Parameters

frustum
The BoundingFrustum to create the BoundingSphere with.

Return Value

The created BoundingSphere.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | frustum is null.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.CreateFromPoints Method

BoundingSphere.CreateFromPoints Method

Creates a BoundingSphere that can contain a specified list of points.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static BoundingSphere CreateFromPoints (
         IEnumerable<Vector3> points
)

Parameters

points
List of points the BoundingSphere must contain.

Return Value

The created BoundingSphere.

Expand image Exceptions

Exception type | Condition
ArgumentException | There are no points in points.
ArgumentNullException | points is null.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.CreateMerged Method

BoundingSphere.CreateMerged Method

Creates a BoundingSphere that contains the two specified BoundingSphere instances.

Expand image Overload List

Name | Description
BoundingSphere.CreateMerged (BoundingSphere, BoundingSphere) | Creates a BoundingSphere that contains the two specified BoundingSphere instances.
BoundingSphere.CreateMerged (BoundingSphere, BoundingSphere, BoundingSphere) | Creates a BoundingSphere that contains the two specified BoundingSphere instances.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace


BoundingSphere.CreateMerged Method (BoundingSphere, BoundingSphere)

BoundingSphere.CreateMerged Method (BoundingSphere, BoundingSphere)
See Also
CollapseAll image

Creates a BoundingSphere that contains the two specified BoundingSphere instances.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static BoundingSphere CreateMerged (
         BoundingSphere original,
         BoundingSphere additional
)

Parameters

original
BoundingSphere to be merged.
additional
BoundingSphere to be merged.

Return Value

The created BoundingSphere.

Expand image Remarks

This method is used in the FuelCell game, a game developed by following a series of focused articles that discuss basic 3D game development. For more information, see FuelCell: "Ships" Passing in the Night.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.CreateMerged Method (BoundingSphere, BoundingSphere, BoundingSphere)

BoundingSphere.CreateMerged Method (BoundingSphere, BoundingSphere, BoundingSphere)
See Also
CollapseAll image

Creates a BoundingSphere that contains the two specified BoundingSphere instances.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateMerged (
         ref BoundingSphere original,
         ref BoundingSphere additional,
         out BoundingSphere result
)

Parameters

original
BoundingSphere to be merged.
additional
BoundingSphere to be merged.
result
[OutAttribute] The created BoundingSphere.

Expand image Remarks

This method is used in the FuelCell game, a game developed by following a series of focused articles that discuss basic 3D game development. For more information, see FuelCell: "Ships" Passing in the Night.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Equals Method

BoundingSphere.Equals Method

Determines whether two instances of BoundingSphere are equal.

Expand image Overload List

Name | Description
BoundingSphere.Equals (BoundingSphere) | Determines whether the specified BoundingSphere is equal to the current BoundingSphere.
BoundingSphere.Equals (Object) | Determines whether the specified Object is equal to the BoundingSphere.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace


BoundingSphere.Equals Method (BoundingSphere)

BoundingSphere.Equals Method (BoundingSphere)
See Also
CollapseAll image

Determines whether the specified BoundingSphere is equal to the current BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         BoundingSphere other
)

Parameters

other
The BoundingSphere to compare with the current BoundingSphere.

Return Value

true if the specified BoundingSphere is equal to the current BoundingSphere; false otherwise.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Equals Method (Object)

BoundingSphere.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to the BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current BoundingSphere.

Return Value

true if the specified Object is equal to the current BoundingSphere; false otherwise.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.GetHashCode Method

BoundingSphere.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

A hash code for the current BoundingSphere.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Intersects Method

BoundingSphere.Intersects Method

Checks whether the current BoundingSphere intersects another bounding volume.

Expand image Overload List

Name | Description
BoundingSphere.Intersects (BoundingBox) | Checks whether the current BoundingSphere intersects with a specified BoundingBox.
BoundingSphere.Intersects (BoundingBox, Boolean) | Checks whether the current BoundingSphere intersects a BoundingBox.
BoundingSphere.Intersects (BoundingFrustum) | Checks whether the current BoundingSphere intersects with a specified BoundingFrustum.
BoundingSphere.Intersects (BoundingSphere) | Checks whether the current BoundingSphere intersects with a specified BoundingSphere.
BoundingSphere.Intersects (BoundingSphere, Boolean) | Checks whether the current BoundingSphere intersects another BoundingSphere.
BoundingSphere.Intersects (Plane) | Checks whether the current BoundingSphere intersects with a specified Plane.
BoundingSphere.Intersects (Plane, PlaneIntersectionType) | Checks whether the current BoundingSphere intersects a Plane.
BoundingSphere.Intersects (Ray) | Checks whether the current BoundingSphere intersects with a specified Ray.
BoundingSphere.Intersects (Ray, Nullable<Single>) | Checks whether the current BoundingSphere intersects a Ray.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace


BoundingSphere.Intersects Method (BoundingBox)

BoundingSphere.Intersects Method (BoundingBox)
See Also
CollapseAll image

Checks whether the current BoundingSphere intersects with a specified BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Intersects (
         BoundingBox box
)

Parameters

box
The BoundingBox to check for intersection with the current BoundingSphere.

Return Value

true if the BoundingBox and BoundingSphere intersect; false otherwise.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Intersects Method (BoundingBox, Boolean)

BoundingSphere.Intersects Method (BoundingBox, Boolean)
See Also
CollapseAll image

Checks whether the current BoundingSphere intersects a BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref BoundingBox box,
         out bool result
)

Parameters

box
The BoundingBox to check for intersection with.
result
[OutAttribute] true if the BoundingSphere and BoundingBox intersect; false otherwise.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Intersects Method (BoundingFrustum)

BoundingSphere.Intersects Method (BoundingFrustum)
See Also
CollapseAll image

Checks whether the current BoundingSphere intersects with a specified BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Intersects (
         BoundingFrustum frustum
)

Parameters

frustum
The BoundingFrustum to check for intersection with the current BoundingSphere.

Return Value

true if the BoundingFrustum and BoundingSphere intersect; false otherwise.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | frustum is null.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Intersects Method (BoundingSphere)

BoundingSphere.Intersects Method (BoundingSphere)
See Also
CollapseAll image

Checks whether the current BoundingSphere intersects with a specified BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Intersects (
         BoundingSphere sphere
)

Parameters

sphere
The BoundingSphere to check for intersection with the current BoundingSphere.

Return Value

true if the BoundingSpheres intersect; false otherwise.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Intersects Method (BoundingSphere, Boolean)

BoundingSphere.Intersects Method (BoundingSphere, Boolean)
See Also
CollapseAll image

Checks whether the current BoundingSphere intersects another BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref BoundingSphere sphere,
         out bool result
)

Parameters

sphere
The BoundingSphere to check for intersection with.
result
[OutAttribute] true if the BoundingSphere instances intersect; false otherwise.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Intersects Method (Plane)

BoundingSphere.Intersects Method (Plane)
See Also
CollapseAll image

Checks whether the current BoundingSphere intersects with a specified Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PlaneIntersectionType Intersects (
         Plane plane
)

Parameters

plane
The Plane to check for intersection with the current BoundingSphere.

Return Value

An enumeration indicating the relationship between the BoundingSphere and the Plane.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Intersects Method (Plane, PlaneIntersectionType)

BoundingSphere.Intersects Method (Plane, PlaneIntersectionType)
See Also
CollapseAll image

Checks whether the current BoundingSphere intersects a Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref Plane plane,
         out PlaneIntersectionType result
)

Parameters

plane
The Plane to check for intersection with.
result
[OutAttribute] An enumeration indicating whether the BoundingSphere intersects the Plane.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Intersects Method (Ray)

BoundingSphere.Intersects Method (Ray)
See Also
CollapseAll image

Checks whether the current BoundingSphere intersects with a specified Ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Nullable<float> Intersects (
         Ray ray
)

Parameters

ray
The Ray to check for intersection with the current BoundingSphere.

Return Value

Distance at which the ray intersects the BoundingSphere or null if there is no intersection.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Intersects Method (Ray, Nullable<Single>)

BoundingSphere.Intersects Method (Ray, Nullable<Single>)
See Also
CollapseAll image

Checks whether the current BoundingSphere intersects a Ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref Ray ray,
         out Nullable<float> result
)

Parameters

ray
The Ray to check for intersection with.
result
[OutAttribute] Distance at which the ray intersects the BoundingSphere or null if there is no intersection.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.op_Equality Method

BoundingSphere.op_Equality Method

Determines whether two instances of BoundingSphere are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         BoundingSphere a,
         BoundingSphere b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if left is equal to right; false otherwise.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.op_Inequality Method

BoundingSphere.op_Inequality Method

Determines whether two instances of BoundingSphere are not equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         BoundingSphere a,
         BoundingSphere b
)

Parameters

a
The BoundingSphere to the left of the inequality operator.
b
The BoundingSphere to the right of the inequality operator.

Return Value

true if left is not equal to right; false otherwise.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.ToString Method

BoundingSphere.ToString Method

Returns a String that represents the current BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of the current BoundingSphere.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Transform Method

BoundingSphere.Transform Method

Translates and scales the BoundingSphere using a given Matrix.

Expand image Overload List

Name | Description
BoundingSphere.Transform (Matrix) | Translates and scales the BoundingSphere using a given Matrix.
BoundingSphere.Transform (Matrix, BoundingSphere) | Translates and scales the BoundingSphere using a given Matrix.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace


BoundingSphere.Transform Method (Matrix)

BoundingSphere.Transform Method (Matrix)
See Also
CollapseAll image

Translates and scales the BoundingSphere using a given Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public BoundingSphere Transform (
         Matrix matrix
)

Parameters

matrix
A transformation matrix that might include translation, rotation, or uniform scaling. Note that BoundingSphere.Transform will not return correct results if there are non-uniform scaling, shears, or other unusual transforms in this transformation matrix. This is because there is no way to shear or non-uniformly scale a sphere. Such an operation would cause the sphere to lose its shape as a sphere.

Return Value

The transformed BoundingSphere.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
CreateScale
CreateTranslation
CreateWorld
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BoundingSphere.Transform Method (Matrix, BoundingSphere)

BoundingSphere.Transform Method (Matrix, BoundingSphere)
See Also
CollapseAll image

Translates and scales the BoundingSphere using a given Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Transform (
         ref Matrix matrix,
         out BoundingSphere result
)

Parameters

matrix
A transformation matrix that might include translation, rotation, or uniform scaling. Note that BoundingSphere.Transform will not return correct results if there are non-uniform scaling, shears, or other unusual transforms in this transformation matrix. This is because there is no way to shear or non-uniformly scale a sphere. Such an operation would cause the sphere to lose its shape as a sphere.
result
[OutAttribute] The transformed BoundingSphere.

Expand image See Also

Reference

BoundingSphere Structure
BoundingSphere Members
CreateScale
CreateTranslation
CreateWorld
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color Structure

Color Structure

Represents a four-component color using red, green, blue, and alpha data.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute(Microsoft.Xna.Framework.Design.ColorConverter, Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=f48fa5f25d27e8ff)]
[SerializableAttribute]
public struct Color : IPackedVector<uint>, IPackedVector, IEquatable<Color>

Expand image See Also

Reference

Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color Members

Color Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Color type.

Expand image Public Constructors

 | Name | Description
Public Method | Color | Overloaded. Creates a new instance of the class.

Expand image Public Properties

 | Name | Description
Public Property | A | Gets or sets the alpha component value.
 | AliceBlue | Gets a system-defined color with the value R:240 G:248 B:255 A:255.
 | AntiqueWhite | Gets a system-defined color with the value R:250 G:235 B:215 A:255.
 | Aqua | Gets a system-defined color with the value R:0 G:255 B:255 A:255.
 | Aquamarine | Gets a system-defined color with the value R:127 G:255 B:212 A:255.
 | Azure | Gets a system-defined color with the value R:240 G:255 B:255 A:255.
Public Property | B | Gets or sets the blue component value of this Color.
 | Beige | Gets a system-defined color with the value R:245 G:245 B:220 A:255.
 | Bisque | Gets a system-defined color with the value R:255 G:228 B:196 A:255.
 | Black | Gets a system-defined color with the value R:0 G:0 B:0 A:255.
 | BlanchedAlmond | Gets a system-defined color with the value R:255 G:235 B:205 A:255.
 | Blue | Gets a system-defined color with the value R:0 G:0 B:255 A:255.
 | BlueViolet | Gets a system-defined color with the value R:138 G:43 B:226 A:255.
 | Brown | Gets a system-defined color with the value R:165 G:42 B:42 A:255.
 | BurlyWood | Gets a system-defined color with the value R:222 G:184 B:135 A:255.
 | CadetBlue | Gets a system-defined color with the value R:95 G:158 B:160 A:255.
 | Chartreuse | Gets a system-defined color with the value R:127 G:255 B:0 A:255.
 | Chocolate | Gets a system-defined color with the value R:210 G:105 B:30 A:255.
 | Coral | Gets a system-defined color with the value R:255 G:127 B:80 A:255.
 | CornflowerBlue | Gets a system-defined color with the value R:100 G:149 B:237 A:255.
 | Cornsilk | Gets a system-defined color with the value R:255 G:248 B:220 A:255.
 | Crimson | Gets a system-defined color with the value R:220 G:20 B:60 A:255.
 | Cyan | Gets a system-defined color with the value R:0 G:255 B:255 A:255.
 | DarkBlue | Gets a system-defined color with the value R:0 G:0 B:139 A:255.
 | DarkCyan | Gets a system-defined color with the value R:0 G:139 B:139 A:255.
 | DarkGoldenrod | Gets a system-defined color with the value R:184 G:134 B:11 A:255.
 | DarkGray | Gets a system-defined color with the value R:169 G:169 B:169 A:255.
 | DarkGreen | Gets a system-defined color with the value R:0 G:100 B:0 A:255.
 | DarkKhaki | Gets a system-defined color with the value R:189 G:183 B:107 A:255.
 | DarkMagenta | Gets a system-defined color with the value R:139 G:0 B:139 A:255.
 | DarkOliveGreen | Gets a system-defined color with the value R:85 G:107 B:47 A:255.
 | DarkOrange | Gets a system-defined color with the value R:255 G:140 B:0 A:255.
 | DarkOrchid | Gets a system-defined color with the value R:153 G:50 B:204 A:255.
 | DarkRed | Gets a system-defined color with the value R:139 G:0 B:0 A:255.
 | DarkSalmon | Gets a system-defined color with the value R:233 G:150 B:122 A:255.
 | DarkSeaGreen | Gets a system-defined color with the value R:143 G:188 B:139 A:255.
 | DarkSlateBlue | Gets a system-defined color with the value R:72 G:61 B:139 A:255.
 | DarkSlateGray | Gets a system-defined color with the value R:47 G:79 B:79 A:255.
 | DarkTurquoise | Gets a system-defined color with the value R:0 G:206 B:209 A:255.
 | DarkViolet | Gets a system-defined color with the value R:148 G:0 B:211 A:255.
 | DeepPink | Gets a system-defined color with the value R:255 G:20 B:147 A:255.
 | DeepSkyBlue | Gets a system-defined color with the value R:0 G:191 B:255 A:255.
 | DimGray | Gets a system-defined color with the value R:105 G:105 B:105 A:255.
 | DodgerBlue | Gets a system-defined color with the value R:30 G:144 B:255 A:255.
 | Firebrick | Gets a system-defined color with the value R:178 G:34 B:34 A:255.
 | FloralWhite | Gets a system-defined color with the value R:255 G:250 B:240 A:255.
 | ForestGreen | Gets a system-defined color with the value R:34 G:139 B:34 A:255.
 | Fuchsia | Gets a system-defined color with the value R:255 G:0 B:255 A:255.
Public Property | G | Gets or sets the green component value of this Color.
 | Gainsboro | Gets a system-defined color with the value R:220 G:220 B:220 A:255.
 | GhostWhite | Gets a system-defined color with the value R:248 G:248 B:255 A:255.
 | Gold | Gets a system-defined color with the value R:255 G:215 B:0 A:255.
 | Goldenrod | Gets a system-defined color with the value R:218 G:165 B:32 A:255.
 | Gray | Gets a system-defined color with the value R:128 G:128 B:128 A:255.
 | Green | Gets a system-defined color with the value R:0 G:128 B:0 A:255.
 | GreenYellow | Gets a system-defined color with the value R:173 G:255 B:47 A:255.
 | Honeydew | Gets a system-defined color with the value R:240 G:255 B:240 A:255.
 | HotPink | Gets a system-defined color with the value R:255 G:105 B:180 A:255.
 | IndianRed | Gets a system-defined color with the value R:205 G:92 B:92 A:255.
 | Indigo | Gets a system-defined color with the value R:75 G:0 B:130 A:255.
 | Ivory | Gets a system-defined color with the value R:255 G:255 B:240 A:255.
 | Khaki | Gets a system-defined color with the value R:240 G:230 B:140 A:255.
 | Lavender | Gets a system-defined color with the value R:230 G:230 B:250 A:255.
 | LavenderBlush | Gets a system-defined color with the value R:255 G:240 B:245 A:255.
 | LawnGreen | Gets a system-defined color with the value R:124 G:252 B:0 A:255.
 | LemonChiffon | Gets a system-defined color with the value R:255 G:250 B:205 A:255.
 | LightBlue | Gets a system-defined color with the value R:173 G:216 B:230 A:255.
 | LightCoral | Gets a system-defined color with the value R:240 G:128 B:128 A:255.
 | LightCyan | Gets a system-defined color with the value R:224 G:255 B:255 A:255.
 | LightGoldenrodYellow | Gets a system-defined color with the value R:250 G:250 B:210 A:255.
 | LightGray | Gets a system-defined color with the value R:211 G:211 B:211 A:255.
 | LightGreen | Gets a system-defined color with the value R:144 G:238 B:144 A:255.
 | LightPink | Gets a system-defined color with the value R:255 G:182 B:193 A:255.
 | LightSalmon | Gets a system-defined color with the value R:255 G:160 B:122 A:255.
 | LightSeaGreen | Gets a system-defined color with the value R:32 G:178 B:170 A:255.
 | LightSkyBlue | Gets a system-defined color with the value R:135 G:206 B:250 A:255.
 | LightSlateGray | Gets a system-defined color with the value R:119 G:136 B:153 A:255.
 | LightSteelBlue | Gets a system-defined color with the value R:176 G:196 B:222 A:255.
 | LightYellow | Gets a system-defined color with the value R:255 G:255 B:224 A:255.
 | Lime | Gets a system-defined color with the value R:0 G:255 B:0 A:255.
 | LimeGreen | Gets a system-defined color with the value R:50 G:205 B:50 A:255.
 | Linen | Gets a system-defined color with the value R:250 G:240 B:230 A:255.
 | Magenta | Gets a system-defined color with the value R:255 G:0 B:255 A:255.
 | Maroon | Gets a system-defined color with the value R:128 G:0 B:0 A:255.
 | MediumAquamarine | Gets a system-defined color with the value R:102 G:205 B:170 A:255.
 | MediumBlue | Gets a system-defined color with the value R:0 G:0 B:205 A:255.
 | MediumOrchid | Gets a system-defined color with the value R:186 G:85 B:211 A:255.
 | MediumPurple | Gets a system-defined color with the value R:147 G:112 B:219 A:255.
 | MediumSeaGreen | Gets a system-defined color with the value R:60 G:179 B:113 A:255.
 | MediumSlateBlue | Gets a system-defined color with the value R:123 G:104 B:238 A:255.
 | MediumSpringGreen | Gets a system-defined color with the value R:0 G:250 B:154 A:255.
 | MediumTurquoise | Gets a system-defined color with the value R:72 G:209 B:204 A:255.
 | MediumVioletRed | Gets a system-defined color with the value R:199 G:21 B:133 A:255.
 | MidnightBlue | Gets a system-defined color with the value R:25 G:25 B:112 A:255.
 | MintCream | Gets a system-defined color with the value R:245 G:255 B:250 A:255.
 | MistyRose | Gets a system-defined color with the value R:255 G:228 B:225 A:255.
 | Moccasin | Gets a system-defined color with the value R:255 G:228 B:181 A:255.
 | NavajoWhite | Gets a system-defined color with the value R:255 G:222 B:173 A:255.
 | Navy | Gets a system-defined color R:0 G:0 B:128 A:255.
 | OldLace | Gets a system-defined color with the value R:253 G:245 B:230 A:255.
 | Olive | Gets a system-defined color with the value R:128 G:128 B:0 A:255.
 | OliveDrab | Gets a system-defined color with the value R:107 G:142 B:35 A:255.
 | Orange | Gets a system-defined color with the value R:255 G:165 B:0 A:255.
 | OrangeRed | Gets a system-defined color with the value R:255 G:69 B:0 A:255.
 | Orchid | Gets a system-defined color with the value R:218 G:112 B:214 A:255.
Public Property | PackedValue | Gets the current color as a packed value.
 | PaleGoldenrod | Gets a system-defined color with the value R:238 G:232 B:170 A:255.
 | PaleGreen | Gets a system-defined color with the value R:152 G:251 B:152 A:255.
 | PaleTurquoise | Gets a system-defined color with the value R:175 G:238 B:238 A:255.
 | PaleVioletRed | Gets a system-defined color with the value R:219 G:112 B:147 A:255.
 | PapayaWhip | Gets a system-defined color with the value R:255 G:239 B:213 A:255.
 | PeachPuff | Gets a system-defined color with the value R:255 G:218 B:185 A:255.
 | Peru | Gets a system-defined color with the value R:205 G:133 B:63 A:255.
 | Pink | Gets a system-defined color with the value R:255 G:192 B:203 A:255.
 | Plum | Gets a system-defined color with the value R:221 G:160 B:221 A:255.
 | PowderBlue | Gets a system-defined color with the value R:176 G:224 B:230 A:255.
 | Purple | Gets a system-defined color with the value R:128 G:0 B:128 A:255.
Public Property | R | Gets or sets the red component value of this Color.
 | Red | Gets a system-defined color with the value R:255 G:0 B:0 A:255.
 | RosyBrown | Gets a system-defined color with the value R:188 G:143 B:143 A:255.
 | RoyalBlue | Gets a system-defined color with the value R:65 G:105 B:225 A:255.
 | SaddleBrown | Gets a system-defined color with the value R:139 G:69 B:19 A:255.
 | Salmon | Gets a system-defined color with the value R:250 G:128 B:114 A:255.
 | SandyBrown | Gets a system-defined color with the value R:244 G:164 B:96 A:255.
 | SeaGreen | Gets a system-defined color with the value R:46 G:139 B:87 A:255.
 | SeaShell | Gets a system-defined color with the value R:255 G:245 B:238 A:255.
 | Sienna | Gets a system-defined color with the value R:160 G:82 B:45 A:255.
 | Silver | Gets a system-defined color with the value R:192 G:192 B:192 A:255.
 | SkyBlue | Gets a system-defined color with the value R:135 G:206 B:235 A:255.
 | SlateBlue | Gets a system-defined color with the value R:106 G:90 B:205 A:255.
 | SlateGray | Gets a system-defined color with the value R:112 G:128 B:144 A:255.
 | Snow | Gets a system-defined color with the value R:255 G:250 B:250 A:255.
 | SpringGreen | Gets a system-defined color with the value R:0 G:255 B:127 A:255.
 | SteelBlue | Gets a system-defined color with the value R:70 G:130 B:180 A:255.
 | Tan | Gets a system-defined color with the value R:210 G:180 B:140 A:255.
 | Teal | Gets a system-defined color with the value R:0 G:128 B:128 A:255.
 | Thistle | Gets a system-defined color with the value R:216 G:191 B:216 A:255.
 | Tomato | Gets a system-defined color with the value R:255 G:99 B:71 A:255.
 | Transparent | Gets a system-defined color with the value R:0 G:0 B:0 A:0.
 | Turquoise | Gets a system-defined color with the value R:64 G:224 B:208 A:255.
 | Violet | Gets a system-defined color with the value R:238 G:130 B:238 A:255.
 | Wheat | Gets a system-defined color with the value R:245 G:222 B:179 A:255.
 | White | Gets a system-defined color with the value R:255 G:255 B:255 A:255.
 | WhiteSmoke | Gets a system-defined color with the value R:245 G:245 B:245 A:255.
 | Yellow | Gets a system-defined color with the value R:255 G:255 B:0 A:255.
 | YellowGreen | Gets a system-defined color with the value R:154 G:205 B:50 A:255.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Tests two colors to see if they are the same.
 | FromNonPremultiplied | Overloaded. Converts a non-premultipled alpha color to a color that contains premultiplied alpha.
Public Method | GetHashCode | Serves as a hash function for a particular type.
Public Method | GetType | (Inherited from Object.)
 | Lerp | Linearly interpolate a color.
 | Multiply | Multiply each color component by the scale factor.
 | op_Equality | Equality operator.
 | op_Inequality | Equality operator for Testing two color objects to see if they are equal.
 | op_Multiply | Multiply operator.
Public Method | ToString | Gets a string representation of this object.
Public Method | ToVector3 | Gets a three-component vector representation for this object.
Public Method | ToVector4 | Gets a four-component vector representation for this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Pack a four-component color from a vector format into the format of a color object.

Expand image See Also

Reference

Color Structure
Microsoft.Xna.Framework Namespace


Color Constructor

Color Constructor

Creates a new instance of the class.

Expand image Overload List

Name | Description
Color (Int32, Int32, Int32) | Creates a new instance of the class.
Color (Int32, Int32, Int32, Int32) | Creates a new instance of the class.
Color (Single, Single, Single) | Creates a new instance of the class.
Color (Single, Single, Single, Single) | Creates a new instance of the class.
Color (Vector3) | Creates a new instance of the class.
Color (Vector4) | Creates a new instance of the class.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace


Color Constructor (Int32, Int32, Int32)

Color Constructor (Int32, Int32, Int32)
See Also
CollapseAll image

Creates a new instance of the class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Color (
         int r,
         int g,
         int b
)

Parameters

r
Red component.
g
Green component.
b
Blue component.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color Constructor (Int32, Int32, Int32, Int32)

Color Constructor (Int32, Int32, Int32, Int32)
See Also
CollapseAll image

Creates a new instance of the class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Color (
         int r,
         int g,
         int b,
         int a
)

Parameters

r
Red component.
g
Green component.
b
Blue component.
a
Alpha component.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color Constructor (Single, Single, Single)

Color Constructor (Single, Single, Single)
See Also
CollapseAll image

Creates a new instance of the class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Color (
         float r,
         float g,
         float b
)

Parameters

r
Red component.
g
Green component.
b
Blue component.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color Constructor (Single, Single, Single, Single)

Color Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Creates a new instance of the class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Color (
         float r,
         float g,
         float b,
         float a
)

Parameters

r
Red component.
g
Green component.
b
Blue component.
a
Alpha component.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color Constructor (Vector3)

Color Constructor (Vector3)
See Also
CollapseAll image

Creates a new instance of the class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Color (
         Vector3 vector
)

Parameters

vector
A three-component color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color Constructor (Vector4)

Color Constructor (Vector4)
See Also
CollapseAll image

Creates a new instance of the class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Color (
         Vector4 vector
)

Parameters

vector
A four-component color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color Methods

Color Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Tests two colors to see if they are the same.
 | FromNonPremultiplied | Overloaded. Converts a non-premultipled alpha color to a color that contains premultiplied alpha.
Public Method | GetHashCode | Serves as a hash function for a particular type.
Public Method | GetType | (Inherited from Object.)
 | Lerp | Linearly interpolate a color.
 | Multiply | Multiply each color component by the scale factor.
 | op_Equality | Equality operator.
 | op_Inequality | Equality operator for Testing two color objects to see if they are equal.
 | op_Multiply | Multiply operator.
Public Method | ToString | Gets a string representation of this object.
Public Method | ToVector3 | Gets a three-component vector representation for this object.
Public Method | ToVector4 | Gets a four-component vector representation for this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Pack a four-component color from a vector format into the format of a color object.

Expand image See Also

Reference

Color Structure
Microsoft.Xna.Framework Namespace


Color.Equals Method

Color.Equals Method

Tests two colors to see if they are the same.

Expand image Overload List

Name | Description
Color.Equals (Color) | Test a color to see if it is equal to the color in this instance.
Color.Equals (Object) | Test an instance of a color object to see if it is equal to this object.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace


Color.Equals Method (Color)

Color.Equals Method (Color)
See Also
CollapseAll image

Test a color to see if it is equal to the color in this instance.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Color other
)

Parameters

other
A four-component color.

Return Value

True if they are equal; false otherwise.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Equals Method (Object)

Color.Equals Method (Object)
See Also
CollapseAll image

Test an instance of a color object to see if it is equal to this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
A color object.

Return Value

True if they are equal; otherwise false.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.FromNonPremultiplied Method

Color.FromNonPremultiplied Method

Converts a non-premultipled alpha color to a color that contains premultiplied alpha.

Expand image Overload List

Name | Description
Color.FromNonPremultiplied (Int32, Int32, Int32, Int32) | Converts a non-premultipled alpha color to a color that contains premultiplied alpha.
Color.FromNonPremultiplied (Vector4) | Convert a non premultipled color into color data that contains alpha.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace


Color.FromNonPremultiplied Method (Int32, Int32, Int32, Int32)

Color.FromNonPremultiplied Method (Int32, Int32, Int32, Int32)
See Also
CollapseAll image

Converts a non-premultipled alpha color to a color that contains premultiplied alpha.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color FromNonPremultiplied (
         int r,
         int g,
         int b,
         int a
)

Parameters

r
Red component.
g
Green component.
b
Blue component.
a
Alpha component.

Return Value

A four-component color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.FromNonPremultiplied Method (Vector4)

Color.FromNonPremultiplied Method (Vector4)
See Also
CollapseAll image

Convert a non premultipled color into color data that contains alpha.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color FromNonPremultiplied (
         Vector4 vector
)

Parameters

vector
A four-component color.

Return Value

A four-component color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.GetHashCode Method

Color.GetHashCode Method

Serves as a hash function for a particular type.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

A hash code.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Lerp Method

Color.Lerp Method

Linearly interpolate a color.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Lerp (
         Color value1,
         Color value2,
         float amount
)

Parameters

value1
A four-component color.
value2
A four-component color.
amount
Interpolation factor.

Return Value

A four-component color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Pack a four-component color from a vector format into the format of a color object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
A four-component color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Multiply Method

Color.Multiply Method

Multiply each color component by the scale factor.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Multiply (
         Color value,
         float scale
)

Parameters

value
The source, four-component color.
scale
The scale factor.

Return Value

A four-component color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.op_Equality Method

Color.op_Equality Method

Equality operator.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Color a,
         Color b
)

Parameters

a
A four-component color.
b
A four-component color.

Return Value

True if the colors are equal; false otherwise.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.op_Inequality Method

Color.op_Inequality Method

Equality operator for Testing two color objects to see if they are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Color a,
         Color b
)

Parameters

a
A four-component color.
b
A four-component color.

Return Value

True if they are equal; false otherwise.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.op_Multiply Method

Color.op_Multiply Method

Multiply operator.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color op_Multiply (
         Color value,
         float scale
)

Parameters

value
A four-component color
scale
Scale factor.

Return Value

A four-component color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.ToString Method

Color.ToString Method

Gets a string representation of this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.ToVector3 Method

Color.ToVector3 Method

Gets a three-component vector representation for this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 ToVector3 ()

Return Value

A three-component vector representation for this object.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.ToVector4 Method

Color.ToVector4 Method

Gets a four-component vector representation for this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

A four-component vector representation for this object.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color Properties

Color Properties

Expand image Public Properties

 | Name | Description
Public Property | A | Gets or sets the alpha component value.
 | AliceBlue | Gets a system-defined color with the value R:240 G:248 B:255 A:255.
 | AntiqueWhite | Gets a system-defined color with the value R:250 G:235 B:215 A:255.
 | Aqua | Gets a system-defined color with the value R:0 G:255 B:255 A:255.
 | Aquamarine | Gets a system-defined color with the value R:127 G:255 B:212 A:255.
 | Azure | Gets a system-defined color with the value R:240 G:255 B:255 A:255.
Public Property | B | Gets or sets the blue component value of this Color.
 | Beige | Gets a system-defined color with the value R:245 G:245 B:220 A:255.
 | Bisque | Gets a system-defined color with the value R:255 G:228 B:196 A:255.
 | Black | Gets a system-defined color with the value R:0 G:0 B:0 A:255.
 | BlanchedAlmond | Gets a system-defined color with the value R:255 G:235 B:205 A:255.
 | Blue | Gets a system-defined color with the value R:0 G:0 B:255 A:255.
 | BlueViolet | Gets a system-defined color with the value R:138 G:43 B:226 A:255.
 | Brown | Gets a system-defined color with the value R:165 G:42 B:42 A:255.
 | BurlyWood | Gets a system-defined color with the value R:222 G:184 B:135 A:255.
 | CadetBlue | Gets a system-defined color with the value R:95 G:158 B:160 A:255.
 | Chartreuse | Gets a system-defined color with the value R:127 G:255 B:0 A:255.
 | Chocolate | Gets a system-defined color with the value R:210 G:105 B:30 A:255.
 | Coral | Gets a system-defined color with the value R:255 G:127 B:80 A:255.
 | CornflowerBlue | Gets a system-defined color with the value R:100 G:149 B:237 A:255.
 | Cornsilk | Gets a system-defined color with the value R:255 G:248 B:220 A:255.
 | Crimson | Gets a system-defined color with the value R:220 G:20 B:60 A:255.
 | Cyan | Gets a system-defined color with the value R:0 G:255 B:255 A:255.
 | DarkBlue | Gets a system-defined color with the value R:0 G:0 B:139 A:255.
 | DarkCyan | Gets a system-defined color with the value R:0 G:139 B:139 A:255.
 | DarkGoldenrod | Gets a system-defined color with the value R:184 G:134 B:11 A:255.
 | DarkGray | Gets a system-defined color with the value R:169 G:169 B:169 A:255.
 | DarkGreen | Gets a system-defined color with the value R:0 G:100 B:0 A:255.
 | DarkKhaki | Gets a system-defined color with the value R:189 G:183 B:107 A:255.
 | DarkMagenta | Gets a system-defined color with the value R:139 G:0 B:139 A:255.
 | DarkOliveGreen | Gets a system-defined color with the value R:85 G:107 B:47 A:255.
 | DarkOrange | Gets a system-defined color with the value R:255 G:140 B:0 A:255.
 | DarkOrchid | Gets a system-defined color with the value R:153 G:50 B:204 A:255.
 | DarkRed | Gets a system-defined color with the value R:139 G:0 B:0 A:255.
 | DarkSalmon | Gets a system-defined color with the value R:233 G:150 B:122 A:255.
 | DarkSeaGreen | Gets a system-defined color with the value R:143 G:188 B:139 A:255.
 | DarkSlateBlue | Gets a system-defined color with the value R:72 G:61 B:139 A:255.
 | DarkSlateGray | Gets a system-defined color with the value R:47 G:79 B:79 A:255.
 | DarkTurquoise | Gets a system-defined color with the value R:0 G:206 B:209 A:255.
 | DarkViolet | Gets a system-defined color with the value R:148 G:0 B:211 A:255.
 | DeepPink | Gets a system-defined color with the value R:255 G:20 B:147 A:255.
 | DeepSkyBlue | Gets a system-defined color with the value R:0 G:191 B:255 A:255.
 | DimGray | Gets a system-defined color with the value R:105 G:105 B:105 A:255.
 | DodgerBlue | Gets a system-defined color with the value R:30 G:144 B:255 A:255.
 | Firebrick | Gets a system-defined color with the value R:178 G:34 B:34 A:255.
 | FloralWhite | Gets a system-defined color with the value R:255 G:250 B:240 A:255.
 | ForestGreen | Gets a system-defined color with the value R:34 G:139 B:34 A:255.
 | Fuchsia | Gets a system-defined color with the value R:255 G:0 B:255 A:255.
Public Property | G | Gets or sets the green component value of this Color.
 | Gainsboro | Gets a system-defined color with the value R:220 G:220 B:220 A:255.
 | GhostWhite | Gets a system-defined color with the value R:248 G:248 B:255 A:255.
 | Gold | Gets a system-defined color with the value R:255 G:215 B:0 A:255.
 | Goldenrod | Gets a system-defined color with the value R:218 G:165 B:32 A:255.
 | Gray | Gets a system-defined color with the value R:128 G:128 B:128 A:255.
 | Green | Gets a system-defined color with the value R:0 G:128 B:0 A:255.
 | GreenYellow | Gets a system-defined color with the value R:173 G:255 B:47 A:255.
 | Honeydew | Gets a system-defined color with the value R:240 G:255 B:240 A:255.
 | HotPink | Gets a system-defined color with the value R:255 G:105 B:180 A:255.
 | IndianRed | Gets a system-defined color with the value R:205 G:92 B:92 A:255.
 | Indigo | Gets a system-defined color with the value R:75 G:0 B:130 A:255.
 | Ivory | Gets a system-defined color with the value R:255 G:255 B:240 A:255.
 | Khaki | Gets a system-defined color with the value R:240 G:230 B:140 A:255.
 | Lavender | Gets a system-defined color with the value R:230 G:230 B:250 A:255.
 | LavenderBlush | Gets a system-defined color with the value R:255 G:240 B:245 A:255.
 | LawnGreen | Gets a system-defined color with the value R:124 G:252 B:0 A:255.
 | LemonChiffon | Gets a system-defined color with the value R:255 G:250 B:205 A:255.
 | LightBlue | Gets a system-defined color with the value R:173 G:216 B:230 A:255.
 | LightCoral | Gets a system-defined color with the value R:240 G:128 B:128 A:255.
 | LightCyan | Gets a system-defined color with the value R:224 G:255 B:255 A:255.
 | LightGoldenrodYellow | Gets a system-defined color with the value R:250 G:250 B:210 A:255.
 | LightGray | Gets a system-defined color with the value R:211 G:211 B:211 A:255.
 | LightGreen | Gets a system-defined color with the value R:144 G:238 B:144 A:255.
 | LightPink | Gets a system-defined color with the value R:255 G:182 B:193 A:255.
 | LightSalmon | Gets a system-defined color with the value R:255 G:160 B:122 A:255.
 | LightSeaGreen | Gets a system-defined color with the value R:32 G:178 B:170 A:255.
 | LightSkyBlue | Gets a system-defined color with the value R:135 G:206 B:250 A:255.
 | LightSlateGray | Gets a system-defined color with the value R:119 G:136 B:153 A:255.
 | LightSteelBlue | Gets a system-defined color with the value R:176 G:196 B:222 A:255.
 | LightYellow | Gets a system-defined color with the value R:255 G:255 B:224 A:255.
 | Lime | Gets a system-defined color with the value R:0 G:255 B:0 A:255.
 | LimeGreen | Gets a system-defined color with the value R:50 G:205 B:50 A:255.
 | Linen | Gets a system-defined color with the value R:250 G:240 B:230 A:255.
 | Magenta | Gets a system-defined color with the value R:255 G:0 B:255 A:255.
 | Maroon | Gets a system-defined color with the value R:128 G:0 B:0 A:255.
 | MediumAquamarine | Gets a system-defined color with the value R:102 G:205 B:170 A:255.
 | MediumBlue | Gets a system-defined color with the value R:0 G:0 B:205 A:255.
 | MediumOrchid | Gets a system-defined color with the value R:186 G:85 B:211 A:255.
 | MediumPurple | Gets a system-defined color with the value R:147 G:112 B:219 A:255.
 | MediumSeaGreen | Gets a system-defined color with the value R:60 G:179 B:113 A:255.
 | MediumSlateBlue | Gets a system-defined color with the value R:123 G:104 B:238 A:255.
 | MediumSpringGreen | Gets a system-defined color with the value R:0 G:250 B:154 A:255.
 | MediumTurquoise | Gets a system-defined color with the value R:72 G:209 B:204 A:255.
 | MediumVioletRed | Gets a system-defined color with the value R:199 G:21 B:133 A:255.
 | MidnightBlue | Gets a system-defined color with the value R:25 G:25 B:112 A:255.
 | MintCream | Gets a system-defined color with the value R:245 G:255 B:250 A:255.
 | MistyRose | Gets a system-defined color with the value R:255 G:228 B:225 A:255.
 | Moccasin | Gets a system-defined color with the value R:255 G:228 B:181 A:255.
 | NavajoWhite | Gets a system-defined color with the value R:255 G:222 B:173 A:255.
 | Navy | Gets a system-defined color R:0 G:0 B:128 A:255.
 | OldLace | Gets a system-defined color with the value R:253 G:245 B:230 A:255.
 | Olive | Gets a system-defined color with the value R:128 G:128 B:0 A:255.
 | OliveDrab | Gets a system-defined color with the value R:107 G:142 B:35 A:255.
 | Orange | Gets a system-defined color with the value R:255 G:165 B:0 A:255.
 | OrangeRed | Gets a system-defined color with the value R:255 G:69 B:0 A:255.
 | Orchid | Gets a system-defined color with the value R:218 G:112 B:214 A:255.
Public Property | PackedValue | Gets the current color as a packed value.
 | PaleGoldenrod | Gets a system-defined color with the value R:238 G:232 B:170 A:255.
 | PaleGreen | Gets a system-defined color with the value R:152 G:251 B:152 A:255.
 | PaleTurquoise | Gets a system-defined color with the value R:175 G:238 B:238 A:255.
 | PaleVioletRed | Gets a system-defined color with the value R:219 G:112 B:147 A:255.
 | PapayaWhip | Gets a system-defined color with the value R:255 G:239 B:213 A:255.
 | PeachPuff | Gets a system-defined color with the value R:255 G:218 B:185 A:255.
 | Peru | Gets a system-defined color with the value R:205 G:133 B:63 A:255.
 | Pink | Gets a system-defined color with the value R:255 G:192 B:203 A:255.
 | Plum | Gets a system-defined color with the value R:221 G:160 B:221 A:255.
 | PowderBlue | Gets a system-defined color with the value R:176 G:224 B:230 A:255.
 | Purple | Gets a system-defined color with the value R:128 G:0 B:128 A:255.
Public Property | R | Gets or sets the red component value of this Color.
 | Red | Gets a system-defined color with the value R:255 G:0 B:0 A:255.
 | RosyBrown | Gets a system-defined color with the value R:188 G:143 B:143 A:255.
 | RoyalBlue | Gets a system-defined color with the value R:65 G:105 B:225 A:255.
 | SaddleBrown | Gets a system-defined color with the value R:139 G:69 B:19 A:255.
 | Salmon | Gets a system-defined color with the value R:250 G:128 B:114 A:255.
 | SandyBrown | Gets a system-defined color with the value R:244 G:164 B:96 A:255.
 | SeaGreen | Gets a system-defined color with the value R:46 G:139 B:87 A:255.
 | SeaShell | Gets a system-defined color with the value R:255 G:245 B:238 A:255.
 | Sienna | Gets a system-defined color with the value R:160 G:82 B:45 A:255.
 | Silver | Gets a system-defined color with the value R:192 G:192 B:192 A:255.
 | SkyBlue | Gets a system-defined color with the value R:135 G:206 B:235 A:255.
 | SlateBlue | Gets a system-defined color with the value R:106 G:90 B:205 A:255.
 | SlateGray | Gets a system-defined color with the value R:112 G:128 B:144 A:255.
 | Snow | Gets a system-defined color with the value R:255 G:250 B:250 A:255.
 | SpringGreen | Gets a system-defined color with the value R:0 G:255 B:127 A:255.
 | SteelBlue | Gets a system-defined color with the value R:70 G:130 B:180 A:255.
 | Tan | Gets a system-defined color with the value R:210 G:180 B:140 A:255.
 | Teal | Gets a system-defined color with the value R:0 G:128 B:128 A:255.
 | Thistle | Gets a system-defined color with the value R:216 G:191 B:216 A:255.
 | Tomato | Gets a system-defined color with the value R:255 G:99 B:71 A:255.
 | Transparent | Gets a system-defined color with the value R:0 G:0 B:0 A:0.
 | Turquoise | Gets a system-defined color with the value R:64 G:224 B:208 A:255.
 | Violet | Gets a system-defined color with the value R:238 G:130 B:238 A:255.
 | Wheat | Gets a system-defined color with the value R:245 G:222 B:179 A:255.
 | White | Gets a system-defined color with the value R:255 G:255 B:255 A:255.
 | WhiteSmoke | Gets a system-defined color with the value R:245 G:245 B:245 A:255.
 | Yellow | Gets a system-defined color with the value R:255 G:255 B:0 A:255.
 | YellowGreen | Gets a system-defined color with the value R:154 G:205 B:50 A:255.

Expand image See Also

Reference

Color Structure
Microsoft.Xna.Framework Namespace


Color.A Property

Color.A Property

Gets or sets the alpha component value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public byte A { get; set; }

Property Value

The alpha component value of this Color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.AliceBlue Property

Color.AliceBlue Property

Gets a system-defined color with the value R:240 G:248 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color AliceBlue { get; }

Property Value

A system-defined color with the value R:240 G:248 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.AntiqueWhite Property

Color.AntiqueWhite Property

Gets a system-defined color with the value R:250 G:235 B:215 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color AntiqueWhite { get; }

Property Value

A system-defined color with the value R:250 G:235 B:215 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Aqua Property

Color.Aqua Property

Gets a system-defined color with the value R:0 G:255 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Aqua { get; }

Property Value

A system-defined color with the value R:0 G:255 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Aquamarine Property

Color.Aquamarine Property

Gets a system-defined color with the value R:127 G:255 B:212 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Aquamarine { get; }

Property Value

A system-defined color with the value R:127 G:255 B:212 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Azure Property

Color.Azure Property

Gets a system-defined color with the value R:240 G:255 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Azure { get; }

Property Value

A system-defined color with the value R:240 G:255 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.B Property

Color.B Property

Gets or sets the blue component value of this Color.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public byte B { get; set; }

Property Value

The blue component value of this Color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Beige Property

Color.Beige Property

Gets a system-defined color with the value R:245 G:245 B:220 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Beige { get; }

Property Value

A system-defined color with the value R:245 G:245 B:220 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Bisque Property

Color.Bisque Property

Gets a system-defined color with the value R:255 G:228 B:196 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Bisque { get; }

Property Value

A system-defined color with the value R:255 G:228 B:196 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Black Property

Color.Black Property

Gets a system-defined color with the value R:0 G:0 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Black { get; }

Property Value

A system-defined color with the value R:0 G:0 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.BlanchedAlmond Property

Color.BlanchedAlmond Property

Gets a system-defined color with the value R:255 G:235 B:205 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color BlanchedAlmond { get; }

Property Value

A system-defined color with the value R:255 G:235 B:205 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Blue Property

Color.Blue Property

Gets a system-defined color with the value R:0 G:0 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Blue { get; }

Property Value

A system-defined color with the value R:0 G:0 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.BlueViolet Property

Color.BlueViolet Property

Gets a system-defined color with the value R:138 G:43 B:226 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color BlueViolet { get; }

Property Value

A system-defined color with the value R:138 G:43 B:226 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Brown Property

Color.Brown Property

Gets a system-defined color with the value R:165 G:42 B:42 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Brown { get; }

Property Value

A system-defined color with the value R:165 G:42 B:42 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.BurlyWood Property

Color.BurlyWood Property

Gets a system-defined color with the value R:222 G:184 B:135 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color BurlyWood { get; }

Property Value

A system-defined color with the value R:222 G:184 B:135 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.CadetBlue Property

Color.CadetBlue Property

Gets a system-defined color with the value R:95 G:158 B:160 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color CadetBlue { get; }

Property Value

A system-defined color with the value R:95 G:158 B:160 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Chartreuse Property

Color.Chartreuse Property

Gets a system-defined color with the value R:127 G:255 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Chartreuse { get; }

Property Value

A system-defined color with the value R:127 G:255 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Chocolate Property

Color.Chocolate Property

Gets a system-defined color with the value R:210 G:105 B:30 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Chocolate { get; }

Property Value

A system-defined color with the value R:210 G:105 B:30 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Coral Property

Color.Coral Property

Gets a system-defined color with the value R:255 G:127 B:80 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Coral { get; }

Property Value

A system-defined color with the value R:255 G:127 B:80 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.CornflowerBlue Property

Color.CornflowerBlue Property

Gets a system-defined color with the value R:100 G:149 B:237 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color CornflowerBlue { get; }

Property Value

A system-defined color with the value R:100 G:149 B:237 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Cornsilk Property

Color.Cornsilk Property

Gets a system-defined color with the value R:255 G:248 B:220 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Cornsilk { get; }

Property Value

A system-defined color with the value R:255 G:248 B:220 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Crimson Property

Color.Crimson Property

Gets a system-defined color with the value R:220 G:20 B:60 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Crimson { get; }

Property Value

A system-defined color with the value R:220 G:20 B:60 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Cyan Property

Color.Cyan Property

Gets a system-defined color with the value R:0 G:255 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Cyan { get; }

Property Value

A system-defined color with the value R:0 G:255 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkBlue Property

Color.DarkBlue Property

Gets a system-defined color with the value R:0 G:0 B:139 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkBlue { get; }

Property Value

A system-defined color with the value R:0 G:0 B:139 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkCyan Property

Color.DarkCyan Property

Gets a system-defined color with the value R:0 G:139 B:139 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkCyan { get; }

Property Value

A system-defined color with the value R:0 G:139 B:139 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkGoldenrod Property

Color.DarkGoldenrod Property

Gets a system-defined color with the value R:184 G:134 B:11 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkGoldenrod { get; }

Property Value

A system-defined color with the value R:184 G:134 B:11 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkGray Property

Color.DarkGray Property

Gets a system-defined color with the value R:169 G:169 B:169 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkGray { get; }

Property Value

A system-defined color with the value R:169 G:169 B:169 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkGreen Property

Color.DarkGreen Property

Gets a system-defined color with the value R:0 G:100 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkGreen { get; }

Property Value

A system-defined color with the value R:0 G:100 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkKhaki Property

Color.DarkKhaki Property

Gets a system-defined color with the value R:189 G:183 B:107 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkKhaki { get; }

Property Value

A system-defined color with the value R:189 G:183 B:107 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkMagenta Property

Color.DarkMagenta Property

Gets a system-defined color with the value R:139 G:0 B:139 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkMagenta { get; }

Property Value

A system-defined color with the value R:139 G:0 B:139 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkOliveGreen Property

Color.DarkOliveGreen Property

Gets a system-defined color with the value R:85 G:107 B:47 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkOliveGreen { get; }

Property Value

A system-defined color with the value R:85 G:107 B:47 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkOrange Property

Color.DarkOrange Property

Gets a system-defined color with the value R:255 G:140 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkOrange { get; }

Property Value

A system-defined color with the value R:255 G:140 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkOrchid Property

Color.DarkOrchid Property

Gets a system-defined color with the value R:153 G:50 B:204 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkOrchid { get; }

Property Value

A system-defined color with the value R:153 G:50 B:204 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkRed Property

Color.DarkRed Property

Gets a system-defined color with the value R:139 G:0 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkRed { get; }

Property Value

A system-defined color with the value R:139 G:0 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkSalmon Property

Color.DarkSalmon Property

Gets a system-defined color with the value R:233 G:150 B:122 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkSalmon { get; }

Property Value

A system-defined color with the value R:233 G:150 B:122 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkSeaGreen Property

Color.DarkSeaGreen Property

Gets a system-defined color with the value R:143 G:188 B:139 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkSeaGreen { get; }

Property Value

A system-defined color with the value R:143 G:188 B:139 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkSlateBlue Property

Color.DarkSlateBlue Property

Gets a system-defined color with the value R:72 G:61 B:139 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkSlateBlue { get; }

Property Value

A system-defined color with the value R:72 G:61 B:139 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkSlateGray Property

Color.DarkSlateGray Property

Gets a system-defined color with the value R:47 G:79 B:79 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkSlateGray { get; }

Property Value

A system-defined color with the value R:47 G:79 B:79 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkTurquoise Property

Color.DarkTurquoise Property

Gets a system-defined color with the value R:0 G:206 B:209 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkTurquoise { get; }

Property Value

A system-defined color with the value R:0 G:206 B:209 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DarkViolet Property

Color.DarkViolet Property

Gets a system-defined color with the value R:148 G:0 B:211 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DarkViolet { get; }

Property Value

A system-defined color with the value R:148 G:0 B:211 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DeepPink Property

Color.DeepPink Property

Gets a system-defined color with the value R:255 G:20 B:147 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DeepPink { get; }

Property Value

A system-defined color with the value R:255 G:20 B:147 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DeepSkyBlue Property

Color.DeepSkyBlue Property

Gets a system-defined color with the value R:0 G:191 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DeepSkyBlue { get; }

Property Value

A system-defined color with the value R:0 G:191 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DimGray Property

Color.DimGray Property

Gets a system-defined color with the value R:105 G:105 B:105 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DimGray { get; }

Property Value

A system-defined color with the value R:105 G:105 B:105 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.DodgerBlue Property

Color.DodgerBlue Property

Gets a system-defined color with the value R:30 G:144 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color DodgerBlue { get; }

Property Value

A system-defined color with the value R:30 G:144 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Firebrick Property

Color.Firebrick Property

Gets a system-defined color with the value R:178 G:34 B:34 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Firebrick { get; }

Property Value

A system-defined color with the value R:178 G:34 B:34 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.FloralWhite Property

Color.FloralWhite Property

Gets a system-defined color with the value R:255 G:250 B:240 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color FloralWhite { get; }

Property Value

A system-defined color with the value R:255 G:250 B:240 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.ForestGreen Property

Color.ForestGreen Property

Gets a system-defined color with the value R:34 G:139 B:34 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color ForestGreen { get; }

Property Value

A system-defined color with the value R:34 G:139 B:34 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Fuchsia Property

Color.Fuchsia Property

Gets a system-defined color with the value R:255 G:0 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Fuchsia { get; }

Property Value

A system-defined color with the value R:255 G:0 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.G Property

Color.G Property

Gets or sets the green component value of this Color.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public byte G { get; set; }

Property Value

The green component value of this Color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Gainsboro Property

Color.Gainsboro Property

Gets a system-defined color with the value R:220 G:220 B:220 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Gainsboro { get; }

Property Value

A system-defined color with the value R:220 G:220 B:220 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.GhostWhite Property

Color.GhostWhite Property

Gets a system-defined color with the value R:248 G:248 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color GhostWhite { get; }

Property Value

A system-defined color with the value R:248 G:248 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Gold Property

Color.Gold Property

Gets a system-defined color with the value R:255 G:215 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Gold { get; }

Property Value

A system-defined color with the value R:255 G:215 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Goldenrod Property

Color.Goldenrod Property

Gets a system-defined color with the value R:218 G:165 B:32 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Goldenrod { get; }

Property Value

A system-defined color with the value R:218 G:165 B:32 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Gray Property

Color.Gray Property

Gets a system-defined color with the value R:128 G:128 B:128 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Gray { get; }

Property Value

A system-defined color with the value R:128 G:128 B:128 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Green Property

Color.Green Property

Gets a system-defined color with the value R:0 G:128 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Green { get; }

Property Value

A system-defined color with the value R:0 G:128 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.GreenYellow Property

Color.GreenYellow Property

Gets a system-defined color with the value R:173 G:255 B:47 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color GreenYellow { get; }

Property Value

A system-defined color with the value R:173 G:255 B:47 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Honeydew Property

Color.Honeydew Property

Gets a system-defined color with the value R:240 G:255 B:240 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Honeydew { get; }

Property Value

A system-defined color with the value R:240 G:255 B:240 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.HotPink Property

Color.HotPink Property

Gets a system-defined color with the value R:255 G:105 B:180 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color HotPink { get; }

Property Value

A system-defined color with the value R:255 G:105 B:180 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.IndianRed Property

Color.IndianRed Property

Gets a system-defined color with the value R:205 G:92 B:92 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color IndianRed { get; }

Property Value

A system-defined color with the value R:205 G:92 B:92 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Indigo Property

Color.Indigo Property

Gets a system-defined color with the value R:75 G:0 B:130 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Indigo { get; }

Property Value

A system-defined color with the value R:75 G:0 B:130 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Ivory Property

Color.Ivory Property

Gets a system-defined color with the value R:255 G:255 B:240 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Ivory { get; }

Property Value

A system-defined color with the value R:255 G:255 B:240 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Khaki Property

Color.Khaki Property

Gets a system-defined color with the value R:240 G:230 B:140 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Khaki { get; }

Property Value

A system-defined color with the value R:240 G:230 B:140 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Lavender Property

Color.Lavender Property

Gets a system-defined color with the value R:230 G:230 B:250 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Lavender { get; }

Property Value

A system-defined color with the value R:230 G:230 B:250 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LavenderBlush Property

Color.LavenderBlush Property

Gets a system-defined color with the value R:255 G:240 B:245 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LavenderBlush { get; }

Property Value

A system-defined color with the value R:255 G:240 B:245 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LawnGreen Property

Color.LawnGreen Property

Gets a system-defined color with the value R:124 G:252 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LawnGreen { get; }

Property Value

A system-defined color with the value R:124 G:252 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LemonChiffon Property

Color.LemonChiffon Property

Gets a system-defined color with the value R:255 G:250 B:205 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LemonChiffon { get; }

Property Value

A system-defined color with the value R:255 G:250 B:205 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightBlue Property

Color.LightBlue Property

Gets a system-defined color with the value R:173 G:216 B:230 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightBlue { get; }

Property Value

A system-defined color with the value R:173 G:216 B:230 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightCoral Property

Color.LightCoral Property

Gets a system-defined color with the value R:240 G:128 B:128 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightCoral { get; }

Property Value

A system-defined color with the value R:240 G:128 B:128 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightCyan Property

Color.LightCyan Property

Gets a system-defined color with the value R:224 G:255 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightCyan { get; }

Property Value

A system-defined color with the value R:224 G:255 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightGoldenrodYellow Property

Color.LightGoldenrodYellow Property

Gets a system-defined color with the value R:250 G:250 B:210 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightGoldenrodYellow { get; }

Property Value

A system-defined color with the value R:250 G:250 B:210 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightGray Property

Color.LightGray Property

Gets a system-defined color with the value R:211 G:211 B:211 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightGray { get; }

Property Value

A system-defined color with the value R:211 G:211 B:211 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightGreen Property

Color.LightGreen Property

Gets a system-defined color with the value R:144 G:238 B:144 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightGreen { get; }

Property Value

A system-defined color with the value R:144 G:238 B:144 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightPink Property

Color.LightPink Property

Gets a system-defined color with the value R:255 G:182 B:193 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightPink { get; }

Property Value

A system-defined color with the value R:255 G:182 B:193 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightSalmon Property

Color.LightSalmon Property

Gets a system-defined color with the value R:255 G:160 B:122 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightSalmon { get; }

Property Value

A system-defined color with the value R:255 G:160 B:122 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightSeaGreen Property

Color.LightSeaGreen Property

Gets a system-defined color with the value R:32 G:178 B:170 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightSeaGreen { get; }

Property Value

A system-defined color with the value R:32 G:178 B:170 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightSkyBlue Property

Color.LightSkyBlue Property

Gets a system-defined color with the value R:135 G:206 B:250 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightSkyBlue { get; }

Property Value

A system-defined color with the value R:135 G:206 B:250 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightSlateGray Property

Color.LightSlateGray Property

Gets a system-defined color with the value R:119 G:136 B:153 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightSlateGray { get; }

Property Value

A system-defined color with the value R:119 G:136 B:153 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightSteelBlue Property

Color.LightSteelBlue Property

Gets a system-defined color with the value R:176 G:196 B:222 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightSteelBlue { get; }

Property Value

A system-defined color with the value R:176 G:196 B:222 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LightYellow Property

Color.LightYellow Property

Gets a system-defined color with the value R:255 G:255 B:224 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LightYellow { get; }

Property Value

A system-defined color with the value R:255 G:255 B:224 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Lime Property

Color.Lime Property

Gets a system-defined color with the value R:0 G:255 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Lime { get; }

Property Value

A system-defined color with the value R:0 G:255 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.LimeGreen Property

Color.LimeGreen Property

Gets a system-defined color with the value R:50 G:205 B:50 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color LimeGreen { get; }

Property Value

A system-defined color with the value R:50 G:205 B:50 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Linen Property

Color.Linen Property

Gets a system-defined color with the value R:250 G:240 B:230 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Linen { get; }

Property Value

A system-defined color with the value R:250 G:240 B:230 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Magenta Property

Color.Magenta Property

Gets a system-defined color with the value R:255 G:0 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Magenta { get; }

Property Value

A system-defined color with the value R:255 G:0 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Maroon Property

Color.Maroon Property

Gets a system-defined color with the value R:128 G:0 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Maroon { get; }

Property Value

A system-defined color with the value R:128 G:0 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MediumAquamarine Property

Color.MediumAquamarine Property

Gets a system-defined color with the value R:102 G:205 B:170 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MediumAquamarine { get; }

Property Value

A system-defined color with the value R:102 G:205 B:170 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MediumBlue Property

Color.MediumBlue Property

Gets a system-defined color with the value R:0 G:0 B:205 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MediumBlue { get; }

Property Value

A system-defined color with the value R:0 G:0 B:205 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MediumOrchid Property

Color.MediumOrchid Property

Gets a system-defined color with the value R:186 G:85 B:211 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MediumOrchid { get; }

Property Value

A system-defined color with the value R:186 G:85 B:211 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MediumPurple Property

Color.MediumPurple Property

Gets a system-defined color with the value R:147 G:112 B:219 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MediumPurple { get; }

Property Value

A system-defined color with the value R:147 G:112 B:219 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MediumSeaGreen Property

Color.MediumSeaGreen Property

Gets a system-defined color with the value R:60 G:179 B:113 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MediumSeaGreen { get; }

Property Value

A system-defined color with the value R:60 G:179 B:113 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MediumSlateBlue Property

Color.MediumSlateBlue Property

Gets a system-defined color with the value R:123 G:104 B:238 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MediumSlateBlue { get; }

Property Value

A system-defined color with the value R:123 G:104 B:238 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MediumSpringGreen Property

Color.MediumSpringGreen Property

Gets a system-defined color with the value R:0 G:250 B:154 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MediumSpringGreen { get; }

Property Value

A system-defined color with the value R:0 G:250 B:154 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MediumTurquoise Property

Color.MediumTurquoise Property

Gets a system-defined color with the value R:72 G:209 B:204 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MediumTurquoise { get; }

Property Value

A system-defined color with the value R:72 G:209 B:204 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MediumVioletRed Property

Color.MediumVioletRed Property

Gets a system-defined color with the value R:199 G:21 B:133 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MediumVioletRed { get; }

Property Value

A system-defined color with the value R:199 G:21 B:133 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MidnightBlue Property

Color.MidnightBlue Property

Gets a system-defined color with the value R:25 G:25 B:112 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MidnightBlue { get; }

Property Value

A system-defined color with the value R:25 G:25 B:112 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MintCream Property

Color.MintCream Property

Gets a system-defined color with the value R:245 G:255 B:250 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MintCream { get; }

Property Value

A system-defined color with the value R:245 G:255 B:250 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.MistyRose Property

Color.MistyRose Property

Gets a system-defined color with the value R:255 G:228 B:225 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color MistyRose { get; }

Property Value

A system-defined color with the value R:255 G:228 B:225 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Moccasin Property

Color.Moccasin Property

Gets a system-defined color with the value R:255 G:228 B:181 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Moccasin { get; }

Property Value

A system-defined color with the value R:255 G:228 B:181 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.NavajoWhite Property

Color.NavajoWhite Property

Gets a system-defined color with the value R:255 G:222 B:173 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color NavajoWhite { get; }

Property Value

A system-defined color with the value R:255 G:222 B:173 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Navy Property

Color.Navy Property

Gets a system-defined color R:0 G:0 B:128 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Navy { get; }

Property Value

A system-defined color R:0 G:0 B:128 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.OldLace Property

Color.OldLace Property

Gets a system-defined color with the value R:253 G:245 B:230 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color OldLace { get; }

Property Value

A system-defined color with the value R:253 G:245 B:230 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Olive Property

Color.Olive Property

Gets a system-defined color with the value R:128 G:128 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Olive { get; }

Property Value

A system-defined color with the value R:128 G:128 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.OliveDrab Property

Color.OliveDrab Property

Gets a system-defined color with the value R:107 G:142 B:35 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color OliveDrab { get; }

Property Value

A system-defined color with the value R:107 G:142 B:35 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Orange Property

Color.Orange Property

Gets a system-defined color with the value R:255 G:165 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Orange { get; }

Property Value

A system-defined color with the value R:255 G:165 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.OrangeRed Property

Color.OrangeRed Property

Gets a system-defined color with the value R:255 G:69 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color OrangeRed { get; }

Property Value

A system-defined color with the value R:255 G:69 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Orchid Property

Color.Orchid Property

Gets a system-defined color with the value R:218 G:112 B:214 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Orchid { get; }

Property Value

A system-defined color with the value R:218 G:112 B:214 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.PackedValue Property

Color.PackedValue Property

Gets the current color as a packed value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public uint PackedValue { get; set; }

Property Value

The current color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.PaleGoldenrod Property

Color.PaleGoldenrod Property

Gets a system-defined color with the value R:238 G:232 B:170 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color PaleGoldenrod { get; }

Property Value

A system-defined color with the value R:238 G:232 B:170 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.PaleGreen Property

Color.PaleGreen Property

Gets a system-defined color with the value R:152 G:251 B:152 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color PaleGreen { get; }

Property Value

A system-defined color with the value R:152 G:251 B:152 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.PaleTurquoise Property

Color.PaleTurquoise Property

Gets a system-defined color with the value R:175 G:238 B:238 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color PaleTurquoise { get; }

Property Value

A system-defined color with the value R:175 G:238 B:238 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.PaleVioletRed Property

Color.PaleVioletRed Property

Gets a system-defined color with the value R:219 G:112 B:147 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color PaleVioletRed { get; }

Property Value

A system-defined color with the value R:219 G:112 B:147 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.PapayaWhip Property

Color.PapayaWhip Property

Gets a system-defined color with the value R:255 G:239 B:213 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color PapayaWhip { get; }

Property Value

A system-defined color with the value R:255 G:239 B:213 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.PeachPuff Property

Color.PeachPuff Property

Gets a system-defined color with the value R:255 G:218 B:185 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color PeachPuff { get; }

Property Value

A system-defined color with the value R:255 G:218 B:185 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Peru Property

Color.Peru Property

Gets a system-defined color with the value R:205 G:133 B:63 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Peru { get; }

Property Value

A system-defined color with the value R:205 G:133 B:63 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Pink Property

Color.Pink Property

Gets a system-defined color with the value R:255 G:192 B:203 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Pink { get; }

Property Value

A system-defined color with the value R:255 G:192 B:203 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Plum Property

Color.Plum Property

Gets a system-defined color with the value R:221 G:160 B:221 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Plum { get; }

Property Value

A system-defined color with the value R:221 G:160 B:221 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.PowderBlue Property

Color.PowderBlue Property

Gets a system-defined color with the value R:176 G:224 B:230 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color PowderBlue { get; }

Property Value

A system-defined color with the value R:176 G:224 B:230 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Purple Property

Color.Purple Property

Gets a system-defined color with the value R:128 G:0 B:128 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Purple { get; }

Property Value

A system-defined color with the value R:128 G:0 B:128 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.R Property

Color.R Property

Gets or sets the red component value of this Color.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public byte R { get; set; }

Property Value

The red component value of this Color.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Red Property

Color.Red Property

Gets a system-defined color with the value R:255 G:0 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Red { get; }

Property Value

A system-defined color with the value R:255 G:0 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.RosyBrown Property

Color.RosyBrown Property

Gets a system-defined color with the value R:188 G:143 B:143 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color RosyBrown { get; }

Property Value

A system-defined color with the value R:188 G:143 B:143 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.RoyalBlue Property

Color.RoyalBlue Property

Gets a system-defined color with the value R:65 G:105 B:225 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color RoyalBlue { get; }

Property Value

A system-defined color with the value R:65 G:105 B:225 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.SaddleBrown Property

Color.SaddleBrown Property

Gets a system-defined color with the value R:139 G:69 B:19 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color SaddleBrown { get; }

Property Value

A system-defined color with the value R:139 G:69 B:19 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Salmon Property

Color.Salmon Property

Gets a system-defined color with the value R:250 G:128 B:114 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Salmon { get; }

Property Value

A system-defined color with the value R:250 G:128 B:114 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.SandyBrown Property

Color.SandyBrown Property

Gets a system-defined color with the value R:244 G:164 B:96 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color SandyBrown { get; }

Property Value

A system-defined color with the value R:244 G:164 B:96 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.SeaGreen Property

Color.SeaGreen Property

Gets a system-defined color with the value R:46 G:139 B:87 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color SeaGreen { get; }

Property Value

A system-defined color with the value R:46 G:139 B:87 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.SeaShell Property

Color.SeaShell Property

Gets a system-defined color with the value R:255 G:245 B:238 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color SeaShell { get; }

Property Value

A system-defined color with the value R:255 G:245 B:238 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Sienna Property

Color.Sienna Property

Gets a system-defined color with the value R:160 G:82 B:45 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Sienna { get; }

Property Value

A system-defined color with the value R:160 G:82 B:45 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Silver Property

Color.Silver Property

Gets a system-defined color with the value R:192 G:192 B:192 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Silver { get; }

Property Value

A system-defined color with the value R:192 G:192 B:192 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.SkyBlue Property

Color.SkyBlue Property

Gets a system-defined color with the value R:135 G:206 B:235 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color SkyBlue { get; }

Property Value

A system-defined color with the value R:135 G:206 B:235 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.SlateBlue Property

Color.SlateBlue Property

Gets a system-defined color with the value R:106 G:90 B:205 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color SlateBlue { get; }

Property Value

A system-defined color with the value R:106 G:90 B:205 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.SlateGray Property

Color.SlateGray Property

Gets a system-defined color with the value R:112 G:128 B:144 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color SlateGray { get; }

Property Value

A system-defined color with the value R:112 G:128 B:144 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Snow Property

Color.Snow Property

Gets a system-defined color with the value R:255 G:250 B:250 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Snow { get; }

Property Value

A system-defined color with the value R:255 G:250 B:250 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.SpringGreen Property

Color.SpringGreen Property

Gets a system-defined color with the value R:0 G:255 B:127 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color SpringGreen { get; }

Property Value

A system-defined color with the value R:0 G:255 B:127 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.SteelBlue Property

Color.SteelBlue Property

Gets a system-defined color with the value R:70 G:130 B:180 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color SteelBlue { get; }

Property Value

A system-defined color with the value R:70 G:130 B:180 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Tan Property

Color.Tan Property

Gets a system-defined color with the value R:210 G:180 B:140 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Tan { get; }

Property Value

A system-defined color with the value R:210 G:180 B:140 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Teal Property

Color.Teal Property

Gets a system-defined color with the value R:0 G:128 B:128 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Teal { get; }

Property Value

A system-defined color with the value R:0 G:128 B:128 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Thistle Property

Color.Thistle Property

Gets a system-defined color with the value R:216 G:191 B:216 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Thistle { get; }

Property Value

A system-defined color with the value R:216 G:191 B:216 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Tomato Property

Color.Tomato Property

Gets a system-defined color with the value R:255 G:99 B:71 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Tomato { get; }

Property Value

A system-defined color with the value R:255 G:99 B:71 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Transparent Property

Color.Transparent Property

Gets a system-defined color with the value R:0 G:0 B:0 A:0.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Transparent { get; }

Property Value

A system-defined color with the value R:0 G:0 B:0 A:0.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Turquoise Property

Color.Turquoise Property

Gets a system-defined color with the value R:64 G:224 B:208 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Turquoise { get; }

Property Value

A system-defined color with the value R:64 G:224 B:208 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Violet Property

Color.Violet Property

Gets a system-defined color with the value R:238 G:130 B:238 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Violet { get; }

Property Value

A system-defined color with the value R:238 G:130 B:238 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Wheat Property

Color.Wheat Property

Gets a system-defined color with the value R:245 G:222 B:179 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Wheat { get; }

Property Value

A system-defined color with the value R:245 G:222 B:179 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.White Property

Color.White Property

Gets a system-defined color with the value R:255 G:255 B:255 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color White { get; }

Property Value

A system-defined color with the value R:255 G:255 B:255 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.WhiteSmoke Property

Color.WhiteSmoke Property

Gets a system-defined color with the value R:245 G:245 B:245 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color WhiteSmoke { get; }

Property Value

A system-defined color with the value R:245 G:245 B:245 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.Yellow Property

Color.Yellow Property

Gets a system-defined color with the value R:255 G:255 B:0 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color Yellow { get; }

Property Value

A system-defined color with the value R:255 G:255 B:0 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Color.YellowGreen Property

Color.YellowGreen Property

Gets a system-defined color with the value R:154 G:205 B:50 A:255.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Color YellowGreen { get; }

Property Value

A system-defined color with the value R:154 G:205 B:50 A:255.

Expand image See Also

Reference

Color Structure
Color Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContainmentType Enumeration

ContainmentType Enumeration

Indicates the extent to which bounding volumes intersect or contain one another.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum ContainmentType

Expand image Members

Member name | Description
Contains | Indicates that one bounding volume completely contains the other.
Disjoint | Indicates there is no overlap between the bounding volumes.
Intersects | Indicates that the bounding volumes partially overlap.

Expand image See Also

Reference

Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve Class

Curve Class
See Also Members
CollapseAll image

Stores an arbitrary collection of 2D CurveKey points, and provides methods for evaluating features of the curve they define.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)]
[SerializableAttribute]
public class Curve

Expand image Remarks

The Curve class describes how two float values vary with respect to each other even when you cannot easily define their relationship by a formula. Instead, the relationship is defined by an ordered set of value pairs that exemplify it.

You specify a Curve by adding a sequence of CurveKey objects to its Keys collection, each of which must contain at minimum a Position greater than that of the preceding CurveKey, and a corresponding Value. In practice, the Position is almost always used to represent a point in time, while the Value property generally represents a coordinate value corresponding to that point in time.

To represent a time path in two or three dimensions, you can define two or three Curve objects, each of which corresponds to a different spatial axis. Coordinates of a given time's point on the resulting 2D or 3D curve are calculated very efficiently.

The Curve.Evaluate method returns a (coordinate) value corresponding to a (time) position that you specify. The position doesn't have to be contained in any of the CurveKey points, because Curve interpolates between points depending on the CurveKey characteristics you have defined.

Not only is Curve useful for controlling animation and spatial motion, it can also be used anywhere you want to define a response that changes over time. For example, if you are using a button to accelerate a car in your game, you might want to define a complex velocity curve that varies with how long the button is held down to simulate gear shifts.

A CurveKey point need not always be part of a smoothly varying curve; you can also set a CurveKey to represent a step or sharp inflection point.

Expand image See Also

Reference

CurveKey
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve Members

Curve Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the Curve type.

Expand image Public Constructors

 | Name | Description
Public Method | Curve | Initializes a new instance of Curve.

Expand image Public Properties

 | Name | Description
Public Property | IsConstant | Gets a value indicating whether the curve is constant.
Public Property | Keys | The points that make up the curve.
Public Property | PostLoop | Specifies how to handle weighting values that are greater than the last control point in the curve.
Public Property | PreLoop | Specifies how to handle weighting values that are less than the first control point in the curve.

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a copy of the Curve.
Public Method | ComputeTangent | Overloaded. Computes the tangents for a specified CurveKey in this Curve.
Public Method | ComputeTangents | Overloaded. Computes all tangents for all CurveKeys in the Curve.
Public Method | Equals | (Inherited from Object.)
Public Method | Evaluate | Finds the value at a position on the Curve.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Curve Class
Microsoft.Xna.Framework Namespace


Curve Constructor

Curve Constructor

Initializes a new instance of Curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Curve ()

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve Methods

Curve Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a copy of the Curve.
Public Method | ComputeTangent | Overloaded. Computes the tangents for a specified CurveKey in this Curve.
Public Method | ComputeTangents | Overloaded. Computes all tangents for all CurveKeys in the Curve.
Public Method | Equals | (Inherited from Object.)
Public Method | Evaluate | Finds the value at a position on the Curve.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Curve Class
Microsoft.Xna.Framework Namespace


Curve.Clone Method

Curve.Clone Method

Creates a copy of the Curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Curve Clone ()

Return Value

The copy of the Curve.

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve.ComputeTangent Method

Curve.ComputeTangent Method

Computes the tangents for a specified CurveKey in this Curve.

Expand image Overload List

Name | Description
Curve.ComputeTangent (Int32, CurveTangent) | Computes both the TangentIn and the TangentOut for a CurveKey specified by its index.
Curve.ComputeTangent (Int32, CurveTangent, CurveTangent) | Computes a specified type of TangentIn and a specified type of TangentOut for a given CurveKey.

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace


Curve.ComputeTangent Method (Int32, CurveTangent)

Curve.ComputeTangent Method (Int32, CurveTangent)
See Also
CollapseAll image

Computes both the TangentIn and the TangentOut for a CurveKey specified by its index.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void ComputeTangent (
         int keyIndex,
         CurveTangent tangentType
)

Parameters

keyIndex
The index of the CurveKey for which to compute tangents (in the Keys collection of the Curve).
tangentType
The type of tangents to compute (one of the types specified in the CurveTangent enumeration).

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | keyIndex is not a valid index.

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve.ComputeTangent Method (Int32, CurveTangent, CurveTangent)

Curve.ComputeTangent Method (Int32, CurveTangent, CurveTangent)
See Also
CollapseAll image

Computes a specified type of TangentIn and a specified type of TangentOut for a given CurveKey.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void ComputeTangent (
         int keyIndex,
         CurveTangent tangentInType,
         CurveTangent tangentOutType
)

Parameters

keyIndex
The index of the CurveKey for which to compute tangents (in the Keys collection of the Curve).
tangentInType
The type of TangentIn to compute (one of the types specified in the CurveTangent enumeration).
tangentOutType
The type of TangentOut to compute (one of the types specified in the CurveTangent enumeration).

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | keyIndex is not a valid index.

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve.ComputeTangents Method

Curve.ComputeTangents Method

Computes all tangents for all CurveKeys in the Curve.

Expand image Overload List

Name | Description
Curve.ComputeTangents (CurveTangent) | Computes all tangents for all CurveKeys in this Curve, using a specified tangent type for both TangentIn and TangentOut.
Curve.ComputeTangents (CurveTangent, CurveTangent) | Computes all tangents for all CurveKeys in this Curve, using different tangent types for TangentOut and TangentIn.

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace


Curve.ComputeTangents Method (CurveTangent)

Curve.ComputeTangents Method (CurveTangent)
See Also
CollapseAll image

Computes all tangents for all CurveKeys in this Curve, using a specified tangent type for both TangentIn and TangentOut.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void ComputeTangents (
         CurveTangent tangentType
)

Parameters

tangentType
The type of TangentOut and TangentIn to compute (one of the types specified in the CurveTangent enumeration).

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve.ComputeTangents Method (CurveTangent, CurveTangent)

Curve.ComputeTangents Method (CurveTangent, CurveTangent)
See Also
CollapseAll image

Computes all tangents for all CurveKeys in this Curve, using different tangent types for TangentOut and TangentIn.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void ComputeTangents (
         CurveTangent tangentInType,
         CurveTangent tangentOutType
)

Parameters

tangentInType
The type of TangentIn to compute (one of the types specified in the CurveTangent enumeration).
tangentOutType
The type of TangentOut to compute (one of the types specified in the CurveTangent enumeration).

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve.Evaluate Method

Curve.Evaluate Method

Finds the value at a position on the Curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Evaluate (
         float position
)

Parameters

position
The position on the Curve.

Return Value

Value at the position on the Curve.

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve Properties

Curve Properties

Expand image Public Properties

 | Name | Description
Public Property | IsConstant | Gets a value indicating whether the curve is constant.
Public Property | Keys | The points that make up the curve.
Public Property | PostLoop | Specifies how to handle weighting values that are greater than the last control point in the curve.
Public Property | PreLoop | Specifies how to handle weighting values that are less than the first control point in the curve.

Expand image See Also

Reference

Curve Class
Microsoft.Xna.Framework Namespace


Curve.IsConstant Property

Curve.IsConstant Property

Gets a value indicating whether the curve is constant.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsConstant { get; }

Property Value

true is the curve is constant (has one or fewer points); false otherwise.

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve.Keys Property

Curve.Keys Property

The points that make up the curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveKeyCollection Keys { get; }

Property Value

Points that make up the curve.

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve.PostLoop Property

Curve.PostLoop Property

Specifies how to handle weighting values that are greater than the last control point in the curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveLoopType PostLoop { get; set; }

Property Value

Specifies how to handle weighting values.

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Curve.PreLoop Property

Curve.PreLoop Property

Specifies how to handle weighting values that are less than the first control point in the curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveLoopType PreLoop { get; set; }

Property Value

Specifies how to handle weighting values.

Expand image See Also

Reference

Curve Class
Curve Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveContinuity Enumeration

CurveContinuity Enumeration

Defines the continuity of CurveKeys on a Curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum CurveContinuity

Expand image Members

Member name | Description
Smooth | Interpolation can be used between this CurveKey and the next.
Step | Interpolation cannot be used between this CurveKey and the next. Specifying a position between the two points returns this point.

Expand image See Also

Reference

Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey Class

CurveKey Class
See Also Members
CollapseAll image

Represents a point in a multi-point curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)]
[SerializableAttribute]
public class CurveKey : IEquatable<CurveKey>, IComparable<CurveKey>

Expand image See Also

Reference

CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey Members

CurveKey Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the CurveKey type.

Expand image Public Constructors

 | Name | Description
Public Method | CurveKey | Overloaded. Initializes a new instance of CurveKey.

Expand image Public Properties

 | Name | Description
Public Property | Continuity | Describes whether the segment between this point and the next point in the curve is discrete or continuous.
Public Property | Position | Position of the CurveKey in the curve.
Public Property | TangentIn | Describes the tangent when approaching this point from the previous point in the curve.
Public Property | TangentOut | Describes the tangent when leaving this point to the next point in the curve.
Public Property | Value | Describes the value of this point.

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a copy of the CurveKey.
Public Method | CompareTo | Compares this instance to another CurveKey and returns an indication of their relative values.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Returns the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two CurveKey instances are equal.
 | op_Inequality | Determines whether two CurveKey instances are not equal.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

CurveKey Class
Microsoft.Xna.Framework Namespace


CurveKey Constructor

CurveKey Constructor

Initializes a new instance of CurveKey.

Expand image Overload List

Name | Description
CurveKey (Single, Single) | Initializes a new instance of CurveKey.
CurveKey (Single, Single, Single, Single) | Initializes a new instance of CurveKey.
CurveKey (Single, Single, Single, Single, CurveContinuity) | Initializes a new instance of CurveKey.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace


CurveKey Constructor (Single, Single)

CurveKey Constructor (Single, Single)
See Also
CollapseAll image

Initializes a new instance of CurveKey.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveKey (
         float position,
         float value
)

Parameters

position
Position in the curve.
value
Value of the control point.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey Constructor (Single, Single, Single, Single)

CurveKey Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of CurveKey.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveKey (
         float position,
         float value,
         float tangentIn,
         float tangentOut
)

Parameters

position
Position in the curve.
value
Value of the control point.
tangentIn
Tangent approaching point from the previous point in the curve.
tangentOut
Tangent leaving point toward next point in the curve.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey Constructor (Single, Single, Single, Single, CurveContinuity)

CurveKey Constructor (Single, Single, Single, Single, CurveContinuity)
See Also
CollapseAll image

Initializes a new instance of CurveKey.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveKey (
         float position,
         float value,
         float tangentIn,
         float tangentOut,
         CurveContinuity continuity
)

Parameters

position
Position in the curve.
value
Value of the control point.
tangentIn
Tangent approaching point from the previous point in the curve.
tangentOut
Tangent leaving point toward next point in the curve.
continuity
Enum indicating whether the curve is discrete or continuous.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey Methods

CurveKey Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a copy of the CurveKey.
Public Method | CompareTo | Compares this instance to another CurveKey and returns an indication of their relative values.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Returns the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two CurveKey instances are equal.
 | op_Inequality | Determines whether two CurveKey instances are not equal.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

CurveKey Class
Microsoft.Xna.Framework Namespace


CurveKey.Clone Method

CurveKey.Clone Method

Creates a copy of the CurveKey.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveKey Clone ()

Return Value

The copy of the CurveKey.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey.CompareTo Method

CurveKey.CompareTo Method

Compares this instance to another CurveKey and returns an indication of their relative values.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int CompareTo (
         CurveKey other
)

Parameters

other
CurveKey to compare to.

Return Value

Zero if the positions are the same; -1 if this CurveKey comes before other and 1 if this CurveKey comes after other.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey.Equals Method

CurveKey.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
CurveKey.Equals (CurveKey) | Determines whether the specified Object is equal to the CurveKey.
CurveKey.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace


CurveKey.Equals Method (CurveKey)

CurveKey.Equals Method (CurveKey)
See Also
CollapseAll image

Determines whether the specified Object is equal to the CurveKey.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         CurveKey other
)

Parameters

other
The Object to compare with the current CurveKey.

Return Value

true if the specified Object is equal to the current CurveKey; false otherwise.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey.Equals Method (Object)

CurveKey.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object with which to make the comparison.

Return Value

Value that is true if the current instance is equal to the specified object, or false if it is not.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey.GetHashCode Method

CurveKey.GetHashCode Method

Returns the hash code for this instance.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hashcode for this object.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey.op_Equality Method

CurveKey.op_Equality Method

Determines whether two CurveKey instances are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         CurveKey a,
         CurveKey b
)

Parameters

a
CurveKey on the left of the equal sign.
b
CurveKey on the right of the equal sign.

Return Value

true if the CurveKeys are equal; false otherwise.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey.op_Inequality Method

CurveKey.op_Inequality Method

Determines whether two CurveKey instances are not equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         CurveKey a,
         CurveKey b
)

Parameters

a
CurveKey on the left of the equal sign.
b
CurveKey on the right of the equal sign.

Return Value

true /> if the CurveKeys are not equal; false otherwise.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey Properties

CurveKey Properties

Expand image Public Properties

 | Name | Description
Public Property | Continuity | Describes whether the segment between this point and the next point in the curve is discrete or continuous.
Public Property | Position | Position of the CurveKey in the curve.
Public Property | TangentIn | Describes the tangent when approaching this point from the previous point in the curve.
Public Property | TangentOut | Describes the tangent when leaving this point to the next point in the curve.
Public Property | Value | Describes the value of this point.

Expand image See Also

Reference

CurveKey Class
Microsoft.Xna.Framework Namespace


CurveKey.Continuity Property

CurveKey.Continuity Property

Describes whether the segment between this point and the next point in the curve is discrete or continuous.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveContinuity Continuity { get; set; }

Property Value

Describes the continuity between this point and the next.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey.Position Property

CurveKey.Position Property

Position of the CurveKey in the curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Position { get; }

Property Value

Position of the CurveKey in the curve.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey.TangentIn Property

CurveKey.TangentIn Property

Describes the tangent when approaching this point from the previous point in the curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float TangentIn { get; set; }

Property Value

The tangent when approaching.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey.TangentOut Property

CurveKey.TangentOut Property

Describes the tangent when leaving this point to the next point in the curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float TangentOut { get; set; }

Property Value

The tangent when leaving.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKey.Value Property

CurveKey.Value Property

Describes the value of this point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Value { get; set; }

Property Value

The value of the point.

Expand image See Also

Reference

CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection Class

CurveKeyCollection Class
See Also Members
CollapseAll image

Contains the CurveKeys making up a Curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)]
[SerializableAttribute]
public class CurveKeyCollection : ICollection<CurveKey>, IEnumerable<CurveKey>, IEnumerable

Expand image See Also

Reference

CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection Members

CurveKeyCollection Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the CurveKeyCollection type.

Expand image Public Constructors

 | Name | Description
Public Method | CurveKeyCollection | Initializes a new instance of CurveKeyCollection.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of elements contained in the CurveKeyCollection.
Public Property | IsReadOnly | Returns a value indicating whether the CurveKeyCollection is read-only.
Public Property | Item | Gets or sets the element at the specified index.

Expand image Public Methods

 | Name | Description
Public Method | Add | Adds a CurveKey to the CurveKeyCollection.
Public Method | Clear | Removes all CurveKeys from the CurveKeyCollection.
Public Method | Clone | Creates a copy of the CurveKeyCollection.
Public Method | Contains | Determines whether the CurveKeyCollection contains a specific CurveKey.
Public Method | CopyTo | Copies the CurveKeys of the CurveKeyCollection to an array, starting at the array index provided.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the CurveKeyCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Determines the index of a CurveKey in the CurveKeyCollection.
Public Method | Remove | Removes the first occurrence of a specific CurveKey from the CurveKeyCollection.
Public Method | RemoveAt | Removes the CurveKey at the specified index.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the CurveKeyCollection.

Expand image See Also

Reference

CurveKeyCollection Class
Microsoft.Xna.Framework Namespace


CurveKeyCollection Constructor

CurveKeyCollection Constructor

Initializes a new instance of CurveKeyCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveKeyCollection ()

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection Methods

CurveKeyCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | Adds a CurveKey to the CurveKeyCollection.
Public Method | Clear | Removes all CurveKeys from the CurveKeyCollection.
Public Method | Clone | Creates a copy of the CurveKeyCollection.
Public Method | Contains | Determines whether the CurveKeyCollection contains a specific CurveKey.
Public Method | CopyTo | Copies the CurveKeys of the CurveKeyCollection to an array, starting at the array index provided.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the CurveKeyCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Determines the index of a CurveKey in the CurveKeyCollection.
Public Method | Remove | Removes the first occurrence of a specific CurveKey from the CurveKeyCollection.
Public Method | RemoveAt | Removes the CurveKey at the specified index.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the CurveKeyCollection.

Expand image See Also

Reference

CurveKeyCollection Class
Microsoft.Xna.Framework Namespace


CurveKeyCollection.Add Method

CurveKeyCollection.Add Method

Adds a CurveKey to the CurveKeyCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Add (
         CurveKey item
)

Parameters

item
The CurveKey to add.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | item is null.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection.Clear Method

CurveKeyCollection.Clear Method

Removes all CurveKeys from the CurveKeyCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Clear ()

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection.Clone Method

CurveKeyCollection.Clone Method

Creates a copy of the CurveKeyCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveKeyCollection Clone ()

Return Value

A new object that is a copy of this instance.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection.Contains Method

CurveKeyCollection.Contains Method

Determines whether the CurveKeyCollection contains a specific CurveKey.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Contains (
         CurveKey item
)

Parameters

item
true if the CurveKey is found in the CurveKeyCollection; false otherwise.

Return Value

The CurveKey to locate in the CurveKeyCollection.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection.CopyTo Method

CurveKeyCollection.CopyTo Method

Copies the CurveKeys of the CurveKeyCollection to an array, starting at the array index provided.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void CopyTo (
         CurveKey[] array,
         int arrayIndex
)

Parameters

array
The destination of the CurveKeys copied from CurveKeyCollection. The array must have zero-based indexing.
arrayIndex
The zero-based index in the array to start copying from.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection.GetEnumerator Method

CurveKeyCollection.GetEnumerator Method

Returns an enumerator that iterates through the CurveKeyCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public IEnumerator<CurveKey> GetEnumerator ()

Return Value

An enumerator for the CurveKeyCollection.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection.IndexOf Method

CurveKeyCollection.IndexOf Method

Determines the index of a CurveKey in the CurveKeyCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int IndexOf (
         CurveKey item
)

Parameters

item
CurveKey to locate in the CurveKeyCollection.

Return Value

The index of the CurveKey if found in the CurveKeyCollection; −1 otherwise.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection.Remove Method

CurveKeyCollection.Remove Method

Removes the first occurrence of a specific CurveKey from the CurveKeyCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Remove (
         CurveKey item
)

Parameters

item
The CurveKey to remove from the CurveKeyCollection.

Return Value

true if CurveKey is successfully removed; false otherwise.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection.RemoveAt Method

CurveKeyCollection.RemoveAt Method

Removes the CurveKey at the specified index.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void RemoveAt (
         int index
)

Parameters

index
The zero-based index of the item to remove.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the CurveKeyCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

An enumerator for the CurveKeyCollection.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection Properties

CurveKeyCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of elements contained in the CurveKeyCollection.
Public Property | IsReadOnly | Returns a value indicating whether the CurveKeyCollection is read-only.
Public Property | Item | Gets or sets the element at the specified index.

Expand image See Also

Reference

CurveKeyCollection Class
Microsoft.Xna.Framework Namespace


CurveKeyCollection.Count Property

CurveKeyCollection.Count Property

Gets the number of elements contained in the CurveKeyCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

The number of elements in the CurveKeyCollection.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection.IsReadOnly Property

CurveKeyCollection.IsReadOnly Property

Returns a value indicating whether the CurveKeyCollection is read-only.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsReadOnly { get; }

Property Value

true if the CurveKeyCollection is read-only; false otherwise.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveKeyCollection.Item Property

CurveKeyCollection.Item Property

Gets or sets the element at the specified index.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public CurveKey this [
         int index
] { get; set; }

Property Value

The CurveKey at the specified index.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | Item is null.

Expand image See Also

Reference

CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveLoopType Enumeration

CurveLoopType Enumeration

Defines how the value of a Curve will be determined for positions before the first point on the Curve or after the last point on the Curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum CurveLoopType

Expand image Members

Member name | Description
Constant | The Curve will evaluate to its first key for positions before the first point in the Curve and to the last key for positions after the last point.
Cycle | Positions specified past the ends of the curve will wrap around to the opposite side of the Curve.
CycleOffset | Positions specified past the ends of the curve will wrap around to the opposite side of the Curve. The value will be offset by the difference between the values of the first and last CurveKey multiplied by the number of times the position wraps around. If the position is before the first point in the Curve, the difference will be subtracted from its value; otherwise, the difference will be added.
Linear | Linear interpolation will be performed to determine the value.
Oscillate | Positions specified past the ends of the Curve act as an offset from the same side of the Curve toward the opposite side.

Expand image See Also

Reference

Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CurveTangent Enumeration

CurveTangent Enumeration

Specifies different tangent types to be calculated for CurveKey points in a Curve.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum CurveTangent

Expand image Members

Member name | Description
Flat | A Flat tangent always has a value equal to zero.
Linear

A Linear tangent at a CurveKey is equal to the difference between its Value and the Value of the preceding or succeeding CurveKey.

For example, in Curve MyCurve, where i is greater than zero and (i + 1) is less than the total number of CurveKeys in MyCurve, the linear TangentIn of MyCurve.Keys[i] is equal to:

  ( MyCurve.Keys[i].Value - MyCurve.Keys[i - 1].Value )

Similarly, the linear TangentOut is equal to:

  ( MyCurve.Keys[i + 1].Value - MyCurve.Keys[i].Value.)
Smooth

A Smooth tangent smooths the inflection between a TangentIn and TangentOut by taking into account the values of both neighbors of the CurveKey.

The smooth TangentIn of MyCurve.Keys[i] is equal to:

  ( ( MyCurve.Keys[i + 1].Value - MyCurve.Keys[i - 1].Value ) *
    ( ( MyCurve.Keys[i].Position - MyCurve.Keys[i - 1].Position ) /
      ( MyCurve.Keys[i + 1].Position - MyCurve.Keys[i-1].Position ) ) )

Similarly, the smooth TangentOut is equal to:

  ( ( MyCurve.Keys[i + 1].Value - MyCurve.Keys[i - 1].Value ) *
    ( ( MyCurve.Keys[i + 1].Position - MyCurve.Keys[i].Position ) /
      ( MyCurve.Keys[i + 1].Position - MyCurve.Keys[i - 1].Position ) ) )

Expand image See Also

Reference

Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayOrientation Enumeration

DisplayOrientation Enumeration

Defines the display orientation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[FlagsAttribute]
public enum DisplayOrientation

Expand image Members

Member name | Description
Default | The default display orientation.
LandscapeLeft | The display is rotated counterclockwise 90 degrees into a landscape orientation, where the width is greater than the height.
LandscapeRight | The display is rotated clockwise 90 degrees into a landscape orientation, where the width is greater than the height.
Portrait | The orientation is a portrait, where the height is greater than the width.

Expand image See Also

Overview

Automatic Rotation and Scaling (Windows Phone)

Reference

Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent Class

DrawableGameComponent Class
See Also Members
CollapseAll image

A game component that is notified when it needs to draw itself.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public class DrawableGameComponent : GameComponent, IDrawable

Expand image See Also

Reference

DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent Members

DrawableGameComponent Members
See Also Constructors Events Methods Properties
CollapseAll image

The following tables list the members exposed by the DrawableGameComponent type.

Expand image Public Constructors

 | Name | Description
Public Method | DrawableGameComponent | Creates a new instance of DrawableGameComponent.

Expand image Public Properties

 | Name | Description
Public Property | DrawOrder | Order in which the component should be drawn, relative to other components that are in the same GameComponentCollection.
Public Property | Enabled | (Inherited from GameComponent.)
Public Property | Game | (Inherited from GameComponent.)
Public Property | GraphicsDevice | The GraphicsDevice the DrawableGameComponent is associated with.
Public Property | UpdateOrder | (Inherited from GameComponent.)
Public Property | Visible | Indicates whether Draw should be called.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Releases the resources used by the DrawableGameComponent class.
Public Method | Draw | Called when the DrawableGameComponent needs to be drawn. Override this method with component-specific drawing code.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Initialize | Initializes the component. Override this method to load any non-graphics resources and query for any required services.
Public Method | ToString | (Inherited from Object.)
Public Method | Update | (Inherited from GameComponent.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GameComponent.)
Protected Method | LoadContent | Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnDrawOrderChanged | Called when the DrawOrder property changes. Raises the DrawOrderChanged event.
Protected Method | OnEnabledChanged | (Inherited from GameComponent.)
Protected Method | OnUpdateOrderChanged | (Inherited from GameComponent.)
Protected Method | OnVisibleChanged | Called when the Visible property changes. Raises the VisibleChanged event.
Protected Method | UnloadContent | Called when graphics resources need to be unloaded. Override this method to unload any component-specific graphics resources.

Expand image Public Events

 | Name | Description
Public Event | Disposed | (Inherited from GameComponent.)
Public Event | DrawOrderChanged | Raised when the DrawOrder property changes.
Public Event | EnabledChanged | (Inherited from GameComponent.)
Public Event | UpdateOrderChanged | (Inherited from GameComponent.)
Public Event | VisibleChanged | Raised when the Visible property changes.

Expand image See Also

Reference

DrawableGameComponent Class
Microsoft.Xna.Framework Namespace


DrawableGameComponent Constructor

DrawableGameComponent Constructor

Creates a new instance of DrawableGameComponent.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public DrawableGameComponent (
         Game game
)

Parameters

game
The Game that the game component should be attached to.

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent Methods

DrawableGameComponent Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Releases the resources used by the DrawableGameComponent class.
Public Method | Draw | Called when the DrawableGameComponent needs to be drawn. Override this method with component-specific drawing code.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Initialize | Initializes the component. Override this method to load any non-graphics resources and query for any required services.
Public Method | ToString | (Inherited from Object.)
Public Method | Update | (Inherited from GameComponent.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GameComponent.)
Protected Method | LoadContent | Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnDrawOrderChanged | Called when the DrawOrder property changes. Raises the DrawOrderChanged event.
Protected Method | OnEnabledChanged | (Inherited from GameComponent.)
Protected Method | OnUpdateOrderChanged | (Inherited from GameComponent.)
Protected Method | OnVisibleChanged | Called when the Visible property changes. Raises the VisibleChanged event.
Protected Method | UnloadContent | Called when graphics resources need to be unloaded. Override this method to unload any component-specific graphics resources.

Expand image See Also

Reference

DrawableGameComponent Class
Microsoft.Xna.Framework Namespace


DrawableGameComponent.Dispose Method

DrawableGameComponent.Dispose Method

Releases the resources used by the DrawableGameComponent class.

Expand image Overload List

Name | Description
DrawableGameComponent.Dispose (Boolean) | Releases the unmanaged resources used by the DrawableGameComponent and optionally releases the managed resources.

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace


DrawableGameComponent.Dispose Method (Boolean)

DrawableGameComponent.Dispose Method (Boolean)
See Also
CollapseAll image

Releases the unmanaged resources used by the DrawableGameComponent and optionally releases the managed resources.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool disposing
)

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent.Draw Method

DrawableGameComponent.Draw Method

Called when the DrawableGameComponent needs to be drawn. Override this method with component-specific drawing code.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public virtual void Draw (
         GameTime gameTime
)

Parameters

gameTime
Time passed since the last call to Draw.

Expand image Remarks

Caution

In the Draw method of an Xbox 360 game, vertex buffers, index buffers, and textures should not be written using SetData when they are intended to be used for rendering. This condition may lead to graphics corruption or crashes. To avoid this potential issue, use DrawUserPrimitives or DrawUserIndexedPrimitives as the preferred alternative to VertexBuffer.SetData for dynamic vertex generation. In cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of embedded memory (EDRAM), predicated tiling is used on this platform to compensate for the additional memory requirements. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render target dimensions.

When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not available for modification until the GPU is finished with presenting the entire frame.

Expand image See Also

Concepts

Predicated Tiling

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent.Initialize Method

DrawableGameComponent.Initialize Method

Initializes the component. Override this method to load any non-graphics resources and query for any required services.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public override void Initialize ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | There is no IGraphicsDeviceService available in the GameServiceContainer that this DrawableGameComponent is associated with. Usually this means there is no GraphicsDeviceManager associated with the services of a Game.

Expand image Remarks

Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers request services from Game.Services. This arrangement allows an object that requires a service to request the service without knowing the name of the service provider.

Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service being implemented and a reference to the object providing the service. For example, to register an object that provides a service represented by the interface IMyService, you would use the following code.

Services.AddService( typeof( IMyService ), myobject );

Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.

IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( typeof(IGraphicsDeviceService) );

Expand image See Also

Reference

Game.Services Property
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent.LoadContent Method

DrawableGameComponent.LoadContent Method

Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual void LoadContent ()

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent.OnDrawOrderChanged Method

DrawableGameComponent.OnDrawOrderChanged Method

Called when the DrawOrder property changes. Raises the DrawOrderChanged event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnDrawOrderChanged (
         Object sender,
         EventArgs args
)

Parameters

sender
The DrawableGameComponent.
args
Arguments to the DrawOrderChanged event.

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent.OnVisibleChanged Method

DrawableGameComponent.OnVisibleChanged Method

Called when the Visible property changes. Raises the VisibleChanged event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnVisibleChanged (
         Object sender,
         EventArgs args
)

Parameters

sender
The DrawableGameComponent.
args
Arguments to the VisibleChanged event.

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent.UnloadContent Method

DrawableGameComponent.UnloadContent Method

Called when graphics resources need to be unloaded. Override this method to unload any component-specific graphics resources.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual void UnloadContent ()

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent Properties

DrawableGameComponent Properties

Expand image Public Properties

 | Name | Description
Public Property | DrawOrder | Order in which the component should be drawn, relative to other components that are in the same GameComponentCollection.
Public Property | Enabled | (Inherited from GameComponent.)
Public Property | Game | (Inherited from GameComponent.)
Public Property | GraphicsDevice | The GraphicsDevice the DrawableGameComponent is associated with.
Public Property | UpdateOrder | (Inherited from GameComponent.)
Public Property | Visible | Indicates whether Draw should be called.

Expand image See Also

Reference

DrawableGameComponent Class
Microsoft.Xna.Framework Namespace


DrawableGameComponent.DrawOrder Property

DrawableGameComponent.DrawOrder Property
See Also Example
CollapseAll image

Order in which the component should be drawn, relative to other components that are in the same GameComponentCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public int DrawOrder { get; set; }

Property Value

Order in which the component should be drawn.

Expand image Remarks

This value can be any integer. Components in the GameComponentCollection are drawn in ascending order based on their DrawOrder.

Expand image Example

In this example, the three components are added to a GameComponentCollection, and the DrawOrder of each component is explicitly set to control the drawing order of each component regardless of the order it was added to the GameComponentCollection. MyDrawableGameComponent is a class which derives from DrawableGameComponent, and game is an instance of Game.

  MyDrawableGameComponent thirdGameComponent = new MyDrawableGameComponent(game);
  d3.DrawOrder = 3;
  game.Components.Add(d3);

  MyDrawableGameComponent firstGameComponent = new MyDrawableGameComponent(game);
  d1.DrawOrder = 1;
  game.Components.Add(d1);

  MyDrawableGameComponent secondGameComponent = new MyDrawableGameComponent(game);
  d2.DrawOrder = 2;
  game.Components.Add(d2);

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent.GraphicsDevice Property

DrawableGameComponent.GraphicsDevice Property

The GraphicsDevice the DrawableGameComponent is associated with.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GraphicsDevice GraphicsDevice { get; }

Property Value

GraphicsDevice the DrawableGameComponent is associated with.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The GraphicsDevice property cannot be used before Initialize has been called.

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent.Visible Property

DrawableGameComponent.Visible Property

Indicates whether Draw should be called.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool Visible { get; set; }

Property Value

true Draw should be called; false otherwise.

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent Events

DrawableGameComponent Events

Expand image Public Events

 | Name | Description
Public Event | Disposed | (Inherited from GameComponent.)
Public Event | DrawOrderChanged | Raised when the DrawOrder property changes.
Public Event | EnabledChanged | (Inherited from GameComponent.)
Public Event | UpdateOrderChanged | (Inherited from GameComponent.)
Public Event | VisibleChanged | Raised when the Visible property changes.

Expand image See Also

Reference

DrawableGameComponent Class
Microsoft.Xna.Framework Namespace


DrawableGameComponent.DrawOrderChanged Event

DrawableGameComponent.DrawOrderChanged Event

Raised when the DrawOrder property changes.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DrawOrderChanged

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DrawableGameComponent.VisibleChanged Event

DrawableGameComponent.VisibleChanged Event

Raised when the Visible property changes.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> VisibleChanged

Expand image See Also

Reference

DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FrameworkDispatcher Class

FrameworkDispatcher Class
See Also Members
CollapseAll image

Implements the Windows-specific portion of a FrameworkDispatcher class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static class FrameworkDispatcher

Expand image See Also

Reference

FrameworkDispatcher Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FrameworkDispatcher Members

FrameworkDispatcher Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the FrameworkDispatcher type.

Expand image Public Methods

Name | Description
Update | Updates the status of various framework components (such as power state and media), and raises related events.

Expand image See Also

Reference

FrameworkDispatcher Class
Microsoft.Xna.Framework Namespace


FrameworkDispatcher Methods

FrameworkDispatcher Methods

Expand image Public Methods

Name | Description
Update | Updates the status of various framework components (such as power state and media), and raises related events.

Expand image See Also

Reference

FrameworkDispatcher Class
Microsoft.Xna.Framework Namespace


FrameworkDispatcher.Update Method

FrameworkDispatcher.Update Method

Updates the status of various framework components (such as power state and media), and raises related events.

If your game does not use the Game class, you must call this method yourself. The recommendation is once per frame.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Update ()

Expand image See Also

Reference

FrameworkDispatcher Class
FrameworkDispatcher Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game Class

Game Class
See Also Members
CollapseAll image

Provides basic graphics device initialization, game logic, and rendering code.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public class Game : IDisposable

Expand image See Also

Reference

Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game Members

Game Members
See Also Constructors Events Methods Properties
CollapseAll image

The following tables list the members exposed by the Game type.

Expand image Public Constructors

 | Name | Description
Public Method | Game | Initializes a new instance of this class, which provides basic graphics device initialization, game logic, rendering code, and a game loop.

Expand image Public Properties

 | Name | Description
Public Property | Components | Gets the collection of GameComponents owned by the game.
Public Property | Content | Gets or sets the current ContentManager.
Public Property | GraphicsDevice | Gets the current GraphicsDevice.
Public Property | InactiveSleepTime | Gets or sets the time to sleep when the game is inactive.
Public Property | IsActive | Indicates whether the game is currently the active application.
Public Property | IsFixedTimeStep | Gets or sets a value indicating whether to use fixed time steps.
Public Property | IsMouseVisible | Gets or sets a value indicating whether the mouse cursor should be visible.
Public Property | LaunchParameters | Gets the start up parameters in LaunchParameters.
Public Property | Services | Gets the GameServiceContainer holding all the service providers attached to the Game.
Public Property | TargetElapsedTime | Gets or sets the target time between calls to Update when IsFixedTimeStep is true.
Public Property | Window | Gets the underlying operating system window.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | Exit | Exits the game.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ResetElapsedTime | Resets the elapsed time counter.
Public Method | Run | Call this method to initialize the game, begin running the game loop, and start processing events for the game.
Public Method | RunOneFrame | Run the game through what would happen in a single tick of the game clock; this method is designed for debugging only.
Public Method | SuppressDraw | Prevents calls to Draw until the next Update.
Public Method | Tick | Updates the game's clock and calls Update and Draw.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | BeginDraw | Starts the drawing of a frame. This method is followed by calls to Draw and EndDraw.
Protected Method | BeginRun | Called after all components are initialized but before the first update in the game loop.
Protected Method | Draw | Called when the game determines it is time to draw a frame.
Protected Method | EndDraw | Ends the drawing of a frame. This method is preceeded by calls to Draw and BeginDraw.
Protected Method | EndRun | Called after the game loop has stopped running before exiting.
Protected Method | Finalize | Allows a Game to attempt to free resources and perform other cleanup operations before garbage collection reclaims the Game.
Protected Method | Initialize | Called after the Game and GraphicsDevice are created, but before LoadContent.
Protected Method | LoadContent | Called when graphics resources need to be loaded.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnActivated | Raises the Activated event. Override this method to add code to handle when the game gains focus.
Protected Method | OnDeactivated | Raises the Deactivated event. Override this method to add code to handle when the game loses focus.
Protected Method | OnExiting | Raises an Exiting event. Override this method to add code to handle when the game is exiting.
Protected Method | ShowMissingRequirementMessage | This is used to display an error message if there is no suitable graphics device or sound card.
Protected Method | UnloadContent | Called when graphics resources need to be unloaded. Override this method to unload any game-specific graphics resources.
Protected Method | Update | Called when the game has determined that game logic needs to be processed.

Expand image Public Events

 | Name | Description
Public Event | Activated | Raised when the game gains focus.
Public Event | Deactivated | Raised when the game loses focus.
Public Event | Disposed | Raised when the game is being disposed.
Public Event | Exiting | Raised when the game is exiting.

Expand image See Also

Reference

Game Class
Microsoft.Xna.Framework Namespace


Game Constructor

Game Constructor
See Also Example
CollapseAll image

Initializes a new instance of this class, which provides basic graphics device initialization, game logic, rendering code, and a game loop.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public Game ()

Expand image Remarks

Although the GraphicsDeviceManager constructor requires an instance of Game, if the application does not otherwise require an instance of Game it is often more desirable to implement the IGraphicsDeviceService interface to provide the same services that would be provided by the GraphicsDeviceManager.

Similarly, when creating a new ContentManager, if no instance of Game is otherwise required by the application, it is often more desirable to create a new class that implements the IServiceProvider interface rather than creating an instance of Game just to create a new instance of GraphicsDeviceManager.

Expand image Example

/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
    using (Game1 game = new Game1())
    {
        game.Run();
    }
}

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game Methods

Game Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | Exit | Exits the game.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ResetElapsedTime | Resets the elapsed time counter.
Public Method | Run | Call this method to initialize the game, begin running the game loop, and start processing events for the game.
Public Method | RunOneFrame | Run the game through what would happen in a single tick of the game clock; this method is designed for debugging only.
Public Method | SuppressDraw | Prevents calls to Draw until the next Update.
Public Method | Tick | Updates the game's clock and calls Update and Draw.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | BeginDraw | Starts the drawing of a frame. This method is followed by calls to Draw and EndDraw.
Protected Method | BeginRun | Called after all components are initialized but before the first update in the game loop.
Protected Method | Draw | Called when the game determines it is time to draw a frame.
Protected Method | EndDraw | Ends the drawing of a frame. This method is preceeded by calls to Draw and BeginDraw.
Protected Method | EndRun | Called after the game loop has stopped running before exiting.
Protected Method | Finalize | Allows a Game to attempt to free resources and perform other cleanup operations before garbage collection reclaims the Game.
Protected Method | Initialize | Called after the Game and GraphicsDevice are created, but before LoadContent.
Protected Method | LoadContent | Called when graphics resources need to be loaded.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnActivated | Raises the Activated event. Override this method to add code to handle when the game gains focus.
Protected Method | OnDeactivated | Raises the Deactivated event. Override this method to add code to handle when the game loses focus.
Protected Method | OnExiting | Raises an Exiting event. Override this method to add code to handle when the game is exiting.
Protected Method | ShowMissingRequirementMessage | This is used to display an error message if there is no suitable graphics device or sound card.
Protected Method | UnloadContent | Called when graphics resources need to be unloaded. Override this method to unload any game-specific graphics resources.
Protected Method | Update | Called when the game has determined that game logic needs to be processed.

Expand image See Also

Reference

Game Class
Microsoft.Xna.Framework Namespace


Game.BeginDraw Method

Game.BeginDraw Method

Starts the drawing of a frame. This method is followed by calls to Draw and EndDraw.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual bool BeginDraw ()

Return Value

true if the frame should be drawn; false otherwise.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.BeginRun Method

Game.BeginRun Method

Called after all components are initialized but before the first update in the game loop.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void BeginRun ()

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Dispose Method

Game.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
Game.Dispose () | Immediately releases the unmanaged resources used by this object.
Game.Dispose (Boolean) | Releases all resources used by the Game class.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace


Game.Dispose Method ()

Game.Dispose Method ()
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Dispose Method (Boolean)

Game.Dispose Method (Boolean)
See Also
CollapseAll image

Releases all resources used by the Game class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool disposing
)

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image Remarks

This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.

When the disposing parameter is true, this method releases all resources held by any managed objects that this Game references. This method invokes the Dispose method of each referenced object.

Note

Notes to Inheritors

Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects disposed of in an earlier call to Dispose.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Draw Method

Game.Draw Method
See Also Example
CollapseAll image

Called when the game determines it is time to draw a frame. Override this method with game-specific rendering code.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void Draw (
         GameTime gameTime
)

Parameters

gameTime
Time passed since the last call to Draw.

Expand image Remarks

Update and Draw are called at different rates depending on whether IsFixedTimeStep is true or false. If IsFixedTimeStep is false, Update and Draw will be called sequentially as often as possible. If IsFixedTimeStep is true, Update will be called at the interval specified in TargetElapsedTime, while Draw will continue to be called as often as possible.

Caution

In the Draw method of an Xbox 360 game, vertex buffers, index buffers, and textures should not be written using SetData when they are intended to be used for rendering. This condition may lead to graphics corruption or crashes. To avoid this potential issue, use DrawUserPrimitives or DrawUserIndexedPrimitives as the preferred alternative to VertexBuffer.SetData for dynamic vertex generation. In cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of embedded memory (EDRAM), predicated tiling is used on this platform to compensate for the additional memory requirements. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render target dimensions.

When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not available for modification until the GPU is finished with presenting the entire frame.

Expand image Example

In classes that derive from Game, it is necessary to make these calls:

  • Call base.Draw in Draw to enumerate through any graphics components that have been added to Components. This method will automatically call the Initialize method for every component that has been added to the collection.
protected override void Draw( GameTime gameTime )
{
  base.Draw( gameTime );
}

Expand image See Also

Concepts

Game State Management Sample at XNA Creators Club Online
Predicated Tiling

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.EndDraw Method

Game.EndDraw Method

Ends the drawing of a frame. This method is preceeded by calls to Draw and BeginDraw.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void EndDraw ()

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.EndRun Method

Game.EndRun Method

Called after the game loop has stopped running before exiting.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void EndRun ()

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Exit Method

Game.Exit Method

Exits the game.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void Exit ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The current platform does not allow games to exit.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Finalize Method

Game.Finalize Method

Allows a Game to attempt to free resources and perform other cleanup operations before garbage collection reclaims the Game.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image Remarks

This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is automatically invoked during garbage collection.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Initialize Method

Game.Initialize Method
See Also Example
CollapseAll image

Called after the Game and GraphicsDevice are created, but before LoadContent.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void Initialize ()

Expand image Remarks

Override this method to query for any required services, and load any non-graphics resources. Use LoadContent to load graphics resources.

Initialize is called before Draw, so the length of time spent executing code in this method will be experienced by the user as a delay before he or she sees the initial game screen.

Expand image Example

In classes that derive from Game, you need to call base.Initialize in Initialize, which will automatically enumerate through any game components that have been added to Game.Components and call their Initialize methods.

protected override void Initialize()
{
  base.Initialize();
}

Expand image See Also

Reference

Game Class
Game.LoadContent Method
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.LoadContent Method

Game.LoadContent Method

Called when graphics resources need to be loaded. Override this method to load any game-specific graphics resources.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual void LoadContent ()

Expand image Remarks

This method is called by Initialize. Also, it is called any time the game content needs to be reloaded, such as when the DeviceReset event occurs. You should not access the GraphicsDevice until LoadContent is called.

LoadContent is called by Initialize, and before Draw. During the time the code for this method is executing, the user will experience a delay before the initial game screen appears.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.OnActivated Method

Game.OnActivated Method

Raises the Activated event. Override this method to add code to handle when the game gains focus.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnActivated (
         Object sender,
         EventArgs args
)

Parameters

sender
The Game.
args
Arguments for the Activated event.

Expand image Remarks

The OnActivated method allows derived classes to handle the Activated event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.OnDeactivated Method

Game.OnDeactivated Method

Raises the Deactivated event. Override this method to add code to handle when the game loses focus.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnDeactivated (
         Object sender,
         EventArgs args
)

Parameters

sender
The Game.
args
Arguments for the Deactivated event.

Expand image Remarks

The OnDeactivated method allows derived classes to handle the Deactivated event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.OnExiting Method

Game.OnExiting Method

Raises an Exiting event. Override this method to add code to handle when the game is exiting.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnExiting (
         Object sender,
         EventArgs args
)

Parameters

sender
The Game.
args
Arguments for the Exiting event.

Expand image Remarks

The OnExiting method allows derived classes to handle the Exiting event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.ResetElapsedTime Method

Game.ResetElapsedTime Method

Resets the elapsed time counter.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void ResetElapsedTime ()

Expand image Remarks

Use this method if your game is recovering from a slow-running state, and ElapsedGameTime is too large to be useful.

Expand image See Also

Reference

Game Class
Game Members
ElapsedGameTime
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Run Method

Game.Run Method

Call this method to initialize the game, begin running the game loop, and start processing events for the game.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void Run ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Run has been called multiple times in the same application.
ArgumentException

Invalid arguments have been requested for the creation of the graphics device.

Invalid back buffer options have been requested:

  • BackBufferFormat is not valid. Try SurfaceFormat.Bgr565, SurfaceFormat.Bgr555, SurfaceFormat.Bgra5551, SurfaceFormat.Bgr32, SurfaceFormat.Color, SurfaceFormat.Bgra1010102.
  • The selected BackBufferFormat and IsFullScreen values are not valid for the selected adapter format and device type.
  • The BackBufferWidth and BackBufferHeight values do not correspond to a valid display mode.

Invalid PresentationParameters.PresentationInterval option has been requested:

  • On Xbox 360, PresentationParameters.PresentationInterval has been assigned the invalid value PresentInterval.Four.

Invalid depth stencil options have been requested:

  • Multiple PresentationParameters have been specified but BackBufferFormat, BackBufferWidth, and BackBufferHeight are not the same for all adapters.

IsFullScreen is true, but:

  • BackBufferWidth and BackBufferHeight are not nonzero.
  • PresentationInterval is not one of the following: PresentInterval.Default, PresentInterval.Immediate, PresentInterval.One, PresentInterval.Two PresentInterval.Three, or PresentInterval.Four.
  • The selected adapter does not support the selected full screen PresentationInterval.

IsFullScreen is false, but:

  • PresentationInterval is not one of the following: PresentInterval.Default, PresentInterval.Immediate, or PresentInterval.One.

Expand image Remarks

This method calls the game Initialize and BeginRun methods before it begins the game loop and starts processing events for the game.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.RunOneFrame Method

Game.RunOneFrame Method

Run the game through what would happen in a single tick of the game clock; this method is designed for debugging only.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void RunOneFrame ()

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.ShowMissingRequirementMessage Method

Game.ShowMissingRequirementMessage Method

This is used to display an error message if there is no suitable graphics device or sound card.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual bool ShowMissingRequirementMessage (
         Exception exception
)

Parameters

exception
The exception to display.

Return Value

true if an error was displayed, otherwise false.

Expand image Remarks

Xbox 360 Specific Information
On the Xbox 360 platform, this method will not display a message box and return immediately.
Zune Specific Information
On the Zune platform, this method will not display a message box and return immediately.

Games are not expected to call this method directly. This method will be called automatically if the game throws an unhandled exception of type NoSuitableGraphicsDeviceException or NoAudioHardwareException. You may override this method to add messages for additional exception types, or to provide localized versions of the error message text.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.SuppressDraw Method

Game.SuppressDraw Method

Prevents calls to Draw until the next Update.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void SuppressDraw ()

Expand image Remarks

Call this method during Update to prevent any calls to Draw until after the next call to Update. This method can be used on small devices to conserve battery life if the display does not change as a result of Update. For example, if the screen is static with no background animations, the player input can be examined during Update to determine whether the player is performing any action. If no input is detected, this method allows the game to skip drawing until the next update.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Tick Method

Game.Tick Method

Updates the game's clock and calls Update and Draw.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void Tick ()

Expand image Remarks

In a fixed-step game, Tick calls Update only after a target time interval has elapsed.

In a variable-step game, Update is called every time Tick is called.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.UnloadContent Method

Game.UnloadContent Method

Called when graphics resources need to be unloaded. Override this method to unload any game-specific graphics resources.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual void UnloadContent ()

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Update Method

Game.Update Method

Called when the game has determined that game logic needs to be processed. This might include the management of the game state, the processing of user input, or the updating of simulation data. Override this method with game-specific logic.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void Update (
         GameTime gameTime
)

Parameters

gameTime
Time passed since the last call to Update.

Expand image Remarks

Best Practice

When updating the game state, you can examine SignedInGamer.GameDefaults to determine a player's preferences for settings such as game difficulty and controller sensitivity.

Update and Draw are called at different rates depending on whether IsFixedTimeStep is true or false. If IsFixedTimeStep is false, Update and Draw will be called in a continuous loop. If IsFixedTimeStep is true, Update will be called at the interval specified in TargetElapsedTime, while Draw will only be called if an Update is not due. If Draw is not called, IsRunningSlowly will be set to true.

Expand image See Also

Concepts

Game State Management Sample at XNA Creators Club Online

Reference

SignedInGamer.GameDefaults
Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game Properties

Game Properties

Expand image Public Properties

 | Name | Description
Public Property | Components | Gets the collection of GameComponents owned by the game.
Public Property | Content | Gets or sets the current ContentManager.
Public Property | GraphicsDevice | Gets the current GraphicsDevice.
Public Property | InactiveSleepTime | Gets or sets the time to sleep when the game is inactive.
Public Property | IsActive | Indicates whether the game is currently the active application.
Public Property | IsFixedTimeStep | Gets or sets a value indicating whether to use fixed time steps.
Public Property | IsMouseVisible | Gets or sets a value indicating whether the mouse cursor should be visible.
Public Property | LaunchParameters | Gets the start up parameters in LaunchParameters.
Public Property | Services | Gets the GameServiceContainer holding all the service providers attached to the Game.
Public Property | TargetElapsedTime | Gets or sets the target time between calls to Update when IsFixedTimeStep is true.
Public Property | Window | Gets the underlying operating system window.

Expand image See Also

Reference

Game Class
Microsoft.Xna.Framework Namespace


Game.Components Property

Game.Components Property

Gets the collection of GameComponents owned by the game.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GameComponentCollection Components { get; }

Property Value

The collection of game GameComponents.

Expand image Remarks

Game components provide a modular way of adding functionality to a game. You create a game component by deriving the new component either from the GameComponent class, or, if the component loads and draws graphics content, from the DrawableGameComponent class. You then add game logic and rendering code to the game component by overriding GameComponent.Update,DrawableGameComponent.Draw and GameComponent.Initialize. A game component is registered with a game by passing the component to Game.Components.Add. A registered component will have its draw, update, and initialize methods called from the Game.Initialize, Game.Update, and Game.Draw methods.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Content Property

Game.Content Property

Gets or sets the current ContentManager.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentManager Content { get; set; }

Property Value

The current ContentManager.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.GraphicsDevice Property

Game.GraphicsDevice Property

Gets the current GraphicsDevice.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GraphicsDevice GraphicsDevice { get; }

Property Value

The current GraphicsDevice.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | This property requires a graphics device service in the game service container.

Expand image Remarks

Do not access this property until LoadContent is called.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.InactiveSleepTime Property

Game.InactiveSleepTime Property

Gets or sets the time to sleep when the game is inactive.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public TimeSpan InactiveSleepTime { get; set; }

Property Value

The time to sleep when the game is inactive.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | The value specified for InactiveSleepTime is not greater than or equal to zero. Specify zero or a positive value.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.IsActive Property

Game.IsActive Property

Indicates whether the game is currently the active application.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool IsActive { get; }

Property Value

true if the game is active; false otherwise.

Expand image Remarks

On Windows, a game is active if it is not minimized and has the current input focus. On Xbox 360, the game is active if the user is not interacting with the Guide or Dashboard.

Best Practice
It is generally a good idea to pause the game when Game.IsActive is false.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.IsFixedTimeStep Property

Game.IsFixedTimeStep Property

Gets or sets a value indicating whether to use fixed time steps.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool IsFixedTimeStep { get; set; }

Property Value

true if using fixed time steps; false otherwise.

Expand image Remarks

The default value for IsFixedTimeStep is true.

A fixed-step Game tries to call its Update method on the fixed interval specified in TargetElapsedTime. Setting Game.IsFixedTimeStep to true causes a Game to use a fixed-step game loop. A new XNA project uses a fixed-step game loop with a default TargetElapsedTime of 1/60th of a second.

In a fixed-step game loop, Game calls Update once the TargetElapsedTime has elapsed. After Update is called, if it is not time to call Update again, Game calls Draw. After Draw is called, if it is not time to call Update again, Game idles until it is time to call Update.

If Update takes too long to process, Game sets IsRunningSlowly to true and calls Update again, without calling Draw in between. When an update runs longer than the TargetElapsedTime, Game responds by calling Update extra times and dropping the frames associated with those updates to catch up. This ensures that Update will have been called the expected number of times when the game loop catches up from a slowdown. You can check the value of IsRunningSlowly in your Update if you want to detect dropped frames and shorten your Update processing to compensate. You can reset the elapsed times by calling ResetElapsedTime.

When your game pauses in the debugger, Game will not make extra calls to Update when the game resumes.

Expand image See Also

Reference

GameTime.IsRunningSlowly Property
Game.TargetElapsedTime Property
Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.IsMouseVisible Property

Game.IsMouseVisible Property

Gets or sets a value indicating whether the mouse cursor should be visible.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool IsMouseVisible { get; set; }

Property Value

true if the mouse cursor should be visible; false otherwise.

Expand image Remarks

Note
This property applies only to Windows development. The Mouse and MouseState objects are not supported on Xbox 360.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.LaunchParameters Property

Game.LaunchParameters Property

Gets the start up parameters in LaunchParameters.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public LaunchParameters LaunchParameters { get; }

Property Value

The start up parameters.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Services Property

Game.Services Property

Gets the GameServiceContainer holding all the service providers attached to the Game.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GameServiceContainer Services { get; }

Property Value

The GameServiceContainer holding all the service providers attached to the Game.

Expand image Remarks

Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers request services from Game.Services. This arrangement allows an object that requires a service to request the service without knowing the name of the service provider.

Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service being implemented and a reference to the object providing the service. For example, to register an object that provides a service represented by the interface IMyService, you would use the following code.

Services.AddService( typeof( IMyService ), myobject );

Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.

IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( typeof(IGraphicsDeviceService) );

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.TargetElapsedTime Property

Game.TargetElapsedTime Property

Gets or sets the target time between calls to Update when IsFixedTimeStep is true.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public TimeSpan TargetElapsedTime { get; set; }

Property Value

The target time period for the game loop.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | The value specified for TargetElapsedTime is not greater than zero. Specify a nonzero positive value.

Expand image Remarks

When the game framerate is less than TargetElapsedTime, IsRunningSlowly will return true.

The default value for TargetElapsedTime is 1/60th of a second.

A fixed-step Game tries to call its Update method on the fixed interval specified in TargetElapsedTime. Setting Game.IsFixedTimeStep to true causes a Game to use a fixed-step game loop. A new XNA project uses a fixed-step game loop with a default TargetElapsedTime of 1/60th of a second.

In a fixed-step game loop, Game calls Update once the TargetElapsedTime has elapsed. After Update is called, if it is not time to call Update again, Game calls Draw. After Draw is called, if it is not time to call Update again, Game idles until it is time to call Update.

If Update takes too long to process, Game sets IsRunningSlowly to true and calls Update again, without calling Draw in between. When an update runs longer than the TargetElapsedTime, Game responds by calling Update extra times and dropping the frames associated with those updates to catch up. This ensures that Update will have been called the expected number of times when the game loop catches up from a slowdown. You can check the value of IsRunningSlowly in your Update if you want to detect dropped frames and shorten your Update processing to compensate. You can reset the elapsed times by calling ResetElapsedTime.

When your game pauses in the debugger, Game will not make extra calls to Update when the game resumes.

Expand image See Also

Tasks

Achieving Good Performance on Different Hardware Types

Reference

GameTime.IsRunningSlowly Property
Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Window Property

Game.Window Property

Gets the underlying operating system window.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GameWindow Window { get; }

Property Value

The underlying operating system window.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game Events

Game Events

Expand image Public Events

 | Name | Description
Public Event | Activated | Raised when the game gains focus.
Public Event | Deactivated | Raised when the game loses focus.
Public Event | Disposed | Raised when the game is being disposed.
Public Event | Exiting | Raised when the game is exiting.

Expand image See Also

Reference

Game Class
Microsoft.Xna.Framework Namespace


Game.Activated Event

Game.Activated Event

Raised when the game gains focus.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Activated

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Deactivated Event

Game.Deactivated Event

Raised when the game loses focus.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Deactivated

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Disposed Event

Game.Disposed Event

Raised when the game is being disposed.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Disposed

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Game.Exiting Event

Game.Exiting Event

Raised when the game is exiting.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Exiting

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent Class

GameComponent Class
See Also Members
CollapseAll image

Base class for all XNA Framework game components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public class GameComponent : IGameComponent, IUpdateable, IDisposable

Expand image Remarks

Game components provide a modular way of adding functionality to a game. You create a game component by deriving the new component either from the GameComponent class, or, if the component loads and draws graphics content, from the DrawableGameComponent class. You then add game logic and rendering code to the game component by overriding GameComponent.Update,DrawableGameComponent.Draw and GameComponent.Initialize. A game component is registered with a game by passing the component to Game.Components.Add. A registered component will have its draw, update, and initialize methods called from the Game.Initialize, Game.Update, and Game.Draw methods.

Expand image See Also

Reference

GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent Members

GameComponent Members
See Also Constructors Events Methods Properties
CollapseAll image

The following tables list the members exposed by the GameComponent type.

Expand image Public Constructors

 | Name | Description
Public Method | GameComponent | Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | Enabled | Indicates whether GameComponent.Update should be called when Game.Update is called.
Public Property | Game | Gets the Game associated with this GameComponent.
Public Property | UpdateOrder | Indicates the order in which the GameComponent should be updated relative to other GameComponent instances. Lower values are updated first.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Initialize | Called when the GameComponent needs to be initialized.
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Called when the GameComponent needs to be updated. Override this method with component-specific update code.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows a GameComponent to attempt to free resources and perform other cleanup operations before garbage collection reclaims the GameComponent.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnEnabledChanged | Called when the Enabled property changes. Raises the EnabledChanged event.
Protected Method | OnUpdateOrderChanged | Called when the UpdateOrder property changes. Raises the UpdateOrderChanged event.

Expand image Public Events

 | Name | Description
Public Event | Disposed | Raised when the GameComponent is disposed.
Public Event | EnabledChanged | Raised when the Enabled property changes.
Public Event | UpdateOrderChanged | Raised when the UpdateOrder property changes.

Expand image See Also

Reference

GameComponent Class
Microsoft.Xna.Framework Namespace


GameComponent Constructor

GameComponent Constructor

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GameComponent (
         Game game
)

Parameters

game
Game that the game component should be attached to.

Expand image Remarks

Game components provide a modular way of adding functionality to a game. You create a game component by deriving the new component either from the GameComponent class, or, if the component loads and draws graphics content, from the DrawableGameComponent class. You then add game logic and rendering code to the game component by overriding GameComponent.Update,DrawableGameComponent.Draw and GameComponent.Initialize. A game component is registered with a game by passing the component to Game.Components.Add. A registered component will have its draw, update, and initialize methods called from the Game.Initialize, Game.Update, and Game.Draw methods.

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent Methods

GameComponent Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Initialize | Called when the GameComponent needs to be initialized.
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Called when the GameComponent needs to be updated. Override this method with component-specific update code.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows a GameComponent to attempt to free resources and perform other cleanup operations before garbage collection reclaims the GameComponent.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnEnabledChanged | Called when the Enabled property changes. Raises the EnabledChanged event.
Protected Method | OnUpdateOrderChanged | Called when the UpdateOrder property changes. Raises the UpdateOrderChanged event.

Expand image See Also

Reference

GameComponent Class
Microsoft.Xna.Framework Namespace


GameComponent.Dispose Method

GameComponent.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
GameComponent.Dispose () | Immediately releases the unmanaged resources used by this object.
GameComponent.Dispose (Boolean) | Releases the unmanaged resources used by the GameComponent and optionally releases the managed resources.

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace


GameComponent.Dispose Method ()

GameComponent.Dispose Method ()
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent.Dispose Method (Boolean)

GameComponent.Dispose Method (Boolean)
See Also
CollapseAll image

Releases the unmanaged resources used by the GameComponent and optionally releases the managed resources.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool disposing
)

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent.Finalize Method

GameComponent.Finalize Method

Allows a GameComponent to attempt to free resources and perform other cleanup operations before garbage collection reclaims the GameComponent.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image Remarks

This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is automatically invoked during garbage collection.

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent.Initialize Method

GameComponent.Initialize Method
See Also Example
CollapseAll image

Called when the GameComponent needs to be initialized. Override this method to query for required services and load any non-graphics resources.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public virtual void Initialize ()

Expand image Remarks

If this GameComponent has been added to the Game.Components collection, this method will be called automatically if you call base.Initialize in your Game.Initialize method. Note that the template code created by XNA Game Studio will already have this call to base.Initialize in place.

Expand image Example

In classes that derive from Game, it is necessary to call base.Initialize in Game.Initialize, which will automatically enumerate through any game components that have been added to Game.Components and call their Initialize methods.

protected override void Initialize()
{
    base.Initialize();
}

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent.OnEnabledChanged Method

GameComponent.OnEnabledChanged Method

Called when the Enabled property changes. Raises the EnabledChanged event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnEnabledChanged (
         Object sender,
         EventArgs args
)

Parameters

sender
The GameComponent.
args
Arguments to the EnabledChanged event.

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent.OnUpdateOrderChanged Method

GameComponent.OnUpdateOrderChanged Method

Called when the UpdateOrder property changes. Raises the UpdateOrderChanged event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnUpdateOrderChanged (
         Object sender,
         EventArgs args
)

Parameters

sender
The GameComponent.
args
Arguments to the UpdateOrderChanged event.

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent.Update Method

GameComponent.Update Method

Called when the GameComponent needs to be updated. Override this method with component-specific update code.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public virtual void Update (
         GameTime gameTime
)

Parameters

gameTime
Time elapsed since the last call to Update

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent Properties

GameComponent Properties

Expand image Public Properties

 | Name | Description
Public Property | Enabled | Indicates whether GameComponent.Update should be called when Game.Update is called.
Public Property | Game | Gets the Game associated with this GameComponent.
Public Property | UpdateOrder | Indicates the order in which the GameComponent should be updated relative to other GameComponent instances. Lower values are updated first.

Expand image See Also

Reference

GameComponent Class
Microsoft.Xna.Framework Namespace


GameComponent.Enabled Property

GameComponent.Enabled Property

Indicates whether GameComponent.Update should be called when Game.Update is called.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool Enabled { get; set; }

Property Value

true if GameComponent.Update should be called; false otherwise.

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent.Game Property

GameComponent.Game Property

Gets the Game associated with this GameComponent.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public Game Game { get; }

Property Value

The Game associated with this GameComponent.

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent.UpdateOrder Property

GameComponent.UpdateOrder Property

Indicates the order in which the GameComponent should be updated relative to other GameComponent instances. Lower values are updated first.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public int UpdateOrder { get; set; }

Property Value

The order in which the GameComponent should be updated.

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent Events

GameComponent Events

Expand image Public Events

 | Name | Description
Public Event | Disposed | Raised when the GameComponent is disposed.
Public Event | EnabledChanged | Raised when the Enabled property changes.
Public Event | UpdateOrderChanged | Raised when the UpdateOrder property changes.

Expand image See Also

Reference

GameComponent Class
Microsoft.Xna.Framework Namespace


GameComponent.Disposed Event

GameComponent.Disposed Event

Raised when the GameComponent is disposed.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Disposed

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent.EnabledChanged Event

GameComponent.EnabledChanged Event

Raised when the Enabled property changes.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> EnabledChanged

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponent.UpdateOrderChanged Event

GameComponent.UpdateOrderChanged Event

Raised when the UpdateOrder property changes.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> UpdateOrderChanged

Expand image See Also

Reference

GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponentCollection Class

GameComponentCollection Class
See Also Members
CollapseAll image

A collection of game components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public sealed class GameComponentCollection : Collection<IGameComponent>

Expand image See Also

Reference

GameComponentCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponentCollection Members

GameComponentCollection Members
See Also Constructors Events Methods
CollapseAll image

The following tables list the members exposed by the GameComponentCollection type.

Expand image Public Constructors

 | Name | Description
Public Method | GameComponentCollection | Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
 | InsertItem | Overloaded. Inserts a child object into the collection at the specified location.
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
 | SetItem | Overloaded. Modifies the specified child object in the collection.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image Public Events

 | Name | Description
Public Event | ComponentAdded | Raised when a component is added to the GameComponentCollection.
Public Event | ComponentRemoved | Raised when a component is removed from the GameComponentCollection.

Expand image See Also

Reference

GameComponentCollection Class
Microsoft.Xna.Framework Namespace


GameComponentCollection Constructor

GameComponentCollection Constructor

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GameComponentCollection ()

Expand image See Also

Reference

GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponentCollection Methods

GameComponentCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
 | InsertItem | Overloaded. Inserts a child object into the collection at the specified location.
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
 | SetItem | Overloaded. Modifies the specified child object in the collection.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

GameComponentCollection Class
Microsoft.Xna.Framework Namespace


GameComponentCollection.InsertItem Method

GameComponentCollection.InsertItem Method

Inserts a child object into the collection at the specified location.

Expand image Overload List

Name Description

Expand image See Also

Reference

GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace


GameComponentCollection.SetItem Method

GameComponentCollection.SetItem Method

Modifies the specified child object in the collection.

Expand image Overload List

Name Description

Expand image See Also

Reference

GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace


GameComponentCollection Properties

GameComponentCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image See Also

Reference

GameComponentCollection Class
Microsoft.Xna.Framework Namespace


GameComponentCollection Events

GameComponentCollection Events

Expand image Public Events

 | Name | Description
Public Event | ComponentAdded | Raised when a component is added to the GameComponentCollection.
Public Event | ComponentRemoved | Raised when a component is removed from the GameComponentCollection.

Expand image See Also

Reference

GameComponentCollection Class
Microsoft.Xna.Framework Namespace


GameComponentCollection.ComponentAdded Event

GameComponentCollection.ComponentAdded Event

Raised when a component is added to the GameComponentCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<GameComponentCollectionEventArgs> ComponentAdded

Expand image See Also

Reference

GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponentCollection.ComponentRemoved Event

GameComponentCollection.ComponentRemoved Event

Raised when a component is removed from the GameComponentCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<GameComponentCollectionEventArgs> ComponentRemoved

Expand image See Also

Reference

GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponentCollectionEventArgs Class

GameComponentCollectionEventArgs Class
See Also Members
CollapseAll image

Arguments used with events from the GameComponentCollection.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public class GameComponentCollectionEventArgs : EventArgs

Expand image See Also

Reference

GameComponentCollectionEventArgs Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponentCollectionEventArgs Members

GameComponentCollectionEventArgs Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the GameComponentCollectionEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | GameComponentCollectionEventArgs | Creates a new instance of GameComponentCollectionEventArgs.

Expand image Public Properties

 | Name | Description
Public Property | GameComponent | The game component affected by the event.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameComponentCollectionEventArgs Class
Microsoft.Xna.Framework Namespace


GameComponentCollectionEventArgs Constructor

GameComponentCollectionEventArgs Constructor

Creates a new instance of GameComponentCollectionEventArgs.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GameComponentCollectionEventArgs (
         IGameComponent gameComponent
)

Parameters

gameComponent
The game component affected by the event.

Expand image See Also

Reference

GameComponentCollectionEventArgs Class
GameComponentCollectionEventArgs Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameComponentCollectionEventArgs Methods

GameComponentCollectionEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameComponentCollectionEventArgs Class
Microsoft.Xna.Framework Namespace


GameComponentCollectionEventArgs Properties

GameComponentCollectionEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | GameComponent | The game component affected by the event.

Expand image See Also

Reference

GameComponentCollectionEventArgs Class
Microsoft.Xna.Framework Namespace


GameComponentCollectionEventArgs.GameComponent Property

GameComponentCollectionEventArgs.GameComponent Property

The game component affected by the event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public IGameComponent GameComponent { get; }

Property Value

The game component affected by the event.

Expand image See Also

Reference

GameComponentCollectionEventArgs Class
GameComponentCollectionEventArgs Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameServiceContainer Class

GameServiceContainer Class
See Also Members
CollapseAll image

A collection of game services.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public class GameServiceContainer : IServiceProvider

Expand image Remarks

Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers request services from Game.Services. This arrangement allows an object that requires a service to request the service without knowing the name of the service provider.

Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service being implemented and a reference to the object providing the service. For example, to register an object that provides a service represented by the interface IMyService, you would use the following code.

Services.AddService( typeof( IMyService ), myobject );

Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.

IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( typeof(IGraphicsDeviceService) );

Expand image See Also

Reference

Game.Services Property
GameServiceContainer Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameServiceContainer Members

GameServiceContainer Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the GameServiceContainer type.

Expand image Public Constructors

 | Name | Description
Public Method | GameServiceContainer | Initializes a new instance of this class, which represents a collection of game services.

Expand image Public Methods

 | Name | Description
Public Method | AddService | Adds a service to the GameServiceContainer.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetService | Gets the object providing a specified service.
Public Method | GetType | (Inherited from Object.)
Public Method | RemoveService | Removes the object providing a specified service.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameServiceContainer Class
Microsoft.Xna.Framework Namespace


GameServiceContainer Constructor

GameServiceContainer Constructor

Initializes a new instance of this class, which represents a collection of game services.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GameServiceContainer ()

Expand image Remarks

Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers request services from Game.Services. This arrangement allows an object that requires a service to request the service without knowing the name of the service provider.

Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service being implemented and a reference to the object providing the service. For example, to register an object that provides a service represented by the interface IMyService, you would use the following code.

Services.AddService( typeof( IMyService ), myobject );

Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.

IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( typeof(IGraphicsDeviceService) );

Expand image See Also

Reference

Game.Services Property
GameServiceContainer Class
GameServiceContainer Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameServiceContainer Methods

GameServiceContainer Methods

Expand image Public Methods

 | Name | Description
Public Method | AddService | Adds a service to the GameServiceContainer.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetService | Gets the object providing a specified service.
Public Method | GetType | (Inherited from Object.)
Public Method | RemoveService | Removes the object providing a specified service.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameServiceContainer Class
Microsoft.Xna.Framework Namespace


GameServiceContainer.AddService Method

GameServiceContainer.AddService Method

Adds a service to the GameServiceContainer.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void AddService (
         Type type,
         Object provider
)

Parameters

type
The type of service to add.
provider
The service provider to add.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The type or provider parameter is null.
ArgumentException | The container already contains a service of this type, or the service provider object of the type requested is not assignable to this service type.

Expand image Remarks

Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers request services from Game.Services. This arrangement allows an object that requires a service to request the service without knowing the name of the service provider.

Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service being implemented and a reference to the object providing the service. For example, to register an object that provides a service represented by the interface IMyService, you would use the following code.

Services.AddService( typeof( IMyService ), myobject );

Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.

IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( typeof(IGraphicsDeviceService) );

Expand image See Also

Reference

GameServiceContainer Class
GameServiceContainer Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameServiceContainer.GetService Method

GameServiceContainer.GetService Method

Gets the object providing a specified service.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public Object GetService (
         Type type
)

Parameters

type
The type of service.

Return Value

The object providing the service.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The type parameter is null.

Expand image Remarks

Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers request services from Game.Services. This arrangement allows an object that requires a service to request the service without knowing the name of the service provider.

Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service being implemented and a reference to the object providing the service. For example, to register an object that provides a service represented by the interface IMyService, you would use the following code.

Services.AddService( typeof( IMyService ), myobject );

Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.

IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( typeof(IGraphicsDeviceService) );

Expand image See Also

Reference

GameServiceContainer Class
GameServiceContainer Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameServiceContainer.RemoveService Method

GameServiceContainer.RemoveService Method

Removes the object providing a specified service.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void RemoveService (
         Type type
)

Parameters

type
The type of service.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The type parameter is null.

Expand image See Also

Reference

GameServiceContainer Class
GameServiceContainer Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameTime Class

GameTime Class
See Also Members
CollapseAll image

Snapshot of the game timing state expressed in values that can be used by variable-step (real time) or fixed-step (game time) games.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public class GameTime

Expand image See Also

Reference

GameTime Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameTime Members

GameTime Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the GameTime type.

Expand image Public Constructors

 | Name | Description
Public Method | GameTime | Overloaded. Creates a new instance of GameTime.

Expand image Public Properties

 | Name | Description
Public Property | ElapsedGameTime | The amount of elapsed game time since the last update.
Public Property | IsRunningSlowly | Gets a value indicating that the game loop is taking longer than its TargetElapsedTime. In this case, the game loop can be considered to be running too slowly and should do something to "catch up."
Public Property | TotalGameTime | The amount of game time since the start of the game.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameTime Class
Microsoft.Xna.Framework Namespace


GameTime Constructor

GameTime Constructor

Creates a new instance of GameTime.

Expand image Overload List

Name | Description
GameTime () | Creates a new instance of GameTime.
GameTime (TimeSpan, TimeSpan) | Creates a new instance of GameTime.
GameTime (TimeSpan, TimeSpan, Boolean) | Creates a new instance of GameTime.

Expand image See Also

Reference

GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace


GameTime Constructor ()

GameTime Constructor ()
See Also
CollapseAll image

Creates a new instance of GameTime.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GameTime ()

Expand image See Also

Reference

GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameTime Constructor (TimeSpan, TimeSpan)

GameTime Constructor (TimeSpan, TimeSpan)
See Also
CollapseAll image

Creates a new instance of GameTime.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GameTime (
         TimeSpan totalGameTime,
         TimeSpan elapsedGameTime
)

Parameters

totalGameTime
The amount of game time since the start of the game.
elapsedGameTime
The amount of elapsed game time since the last update.

Expand image See Also

Reference

GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameTime Constructor (TimeSpan, TimeSpan, Boolean)

GameTime Constructor (TimeSpan, TimeSpan, Boolean)
See Also
CollapseAll image

Creates a new instance of GameTime.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GameTime (
         TimeSpan totalGameTime,
         TimeSpan elapsedGameTime,
         bool isRunningSlowly
)

Parameters

totalGameTime
The amount of game time since the start of the game.
elapsedGameTime
The amount of elapsed game time since the last update.
isRunningSlowly
Whether the game is running multiple updates this frame.

Expand image See Also

Reference

GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameTime Methods

GameTime Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameTime Class
Microsoft.Xna.Framework Namespace


GameTime Properties

GameTime Properties

Expand image Public Properties

 | Name | Description
Public Property | ElapsedGameTime | The amount of elapsed game time since the last update.
Public Property | IsRunningSlowly | Gets a value indicating that the game loop is taking longer than its TargetElapsedTime. In this case, the game loop can be considered to be running too slowly and should do something to "catch up."
Public Property | TotalGameTime | The amount of game time since the start of the game.

Expand image See Also

Reference

GameTime Class
Microsoft.Xna.Framework Namespace


GameTime.ElapsedGameTime Property

GameTime.ElapsedGameTime Property

The amount of elapsed game time since the last update.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public TimeSpan ElapsedGameTime { get; set; }

Property Value

Elapsed game time since the last update.

Expand image Remarks

Fixed-step clocks update by a fixed time span upon every clock step. This results in uniform clock steps that may not actually track the wall clock time. Fixed-step clocks were popular on console systems where one had tight control over code and a fixed system performance. Fixed-step clocks are also useful when trying to achieve deterministic updates for debugging, offline rendering, or other such scenarios.

Expand image See Also

Reference

GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameTime.IsRunningSlowly Property

GameTime.IsRunningSlowly Property

Gets a value indicating that the game loop is taking longer than its TargetElapsedTime. In this case, the game loop can be considered to be running too slowly and should do something to "catch up."

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool IsRunningSlowly { get; set; }

Property Value

true if the game loop is taking too long; false otherwise.

Expand image See Also

Reference

GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameTime.TotalGameTime Property

GameTime.TotalGameTime Property

The amount of game time since the start of the game.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public TimeSpan TotalGameTime { get; set; }

Property Value

Game time since the start of the game.

Expand image Remarks

Fixed-step clocks update by a fixed time span upon every clock step. This results in uniform clock steps that may not actually track the wall clock time. Fixed step clocks were popular on console systems where one had tight control over code and a fixed system performance. Fixed-step clocks are also useful when trying to achieve deterministic updates for debugging, offline rendering, or other such scenarios.

Expand image See Also

Reference

GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow Class

GameWindow Class
See Also Members
CollapseAll image

The system window associated with a Game.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public abstract class GameWindow

Expand image See Also

Reference

GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow Members

GameWindow Members
See Also Events Methods Properties
CollapseAll image

The following tables list the members exposed by the GameWindow type.

Expand image Public Properties

 | Name | Description
Public Property | AllowUserResizing | Specifies whether to allow the user to resize the game window.
Public Property | ClientBounds | The screen dimensions of the game window's client rectangle.
Public Property | CurrentOrientation | Gets the current display orientation, which reflects the physical orientation of the phone in the user's hand.
Public Property | Handle | Gets the handle to the system window.
Public Property | ScreenDeviceName | Gets the device name of the screen the window is currently in.
Public Property | Title | Gets and sets the title of the system window.

Expand image Public Methods

 | Name | Description
Public Method | BeginScreenDeviceChange | Starts a device transition (windowed to full screen or vice versa).
Public Method | EndScreenDeviceChange | Overloaded. Completes a device transition.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnActivated | Called when the GameWindow gets focus.
Protected Method | OnClientSizeChanged | Called when the size of the client window changes. Raises the ClientSizeChanged event.
Protected Method | OnDeactivated | Called when the GameWindow loses focus.
Protected Method | OnOrientationChanged | Called when the GameWindow display orientation changes.
Protected Method | OnPaint | Called when the GameWindow needs to be painted.
Protected Method | OnScreenDeviceNameChanged | Called when the GameWindow is moved to a different screen. Raises the ScreenDeviceNameChanged event.
Protected Method | SetSupportedOrientations | Sets the supported display orientations.
Protected Method | SetTitle | Sets the title of the GameWindow.

Expand image Public Events

 | Name | Description
Public Event | ClientSizeChanged | Raised when the size of the GameWindow changes.
Public Event | OrientationChanged | Describes the event raised when the display orientation of the GameWindow changes. When this event occurs, the XNA Framework automatically adjusts the game orientation based on the value specified by the developer with SupportedOrientations.
Public Event | ScreenDeviceNameChanged | Raised when the GameWindow moves to a different display.

Expand image See Also

Reference

GameWindow Class
Microsoft.Xna.Framework Namespace


GameWindow Methods

GameWindow Methods

Expand image Public Methods

 | Name | Description
Public Method | BeginScreenDeviceChange | Starts a device transition (windowed to full screen or vice versa).
Public Method | EndScreenDeviceChange | Overloaded. Completes a device transition.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnActivated | Called when the GameWindow gets focus.
Protected Method | OnClientSizeChanged | Called when the size of the client window changes. Raises the ClientSizeChanged event.
Protected Method | OnDeactivated | Called when the GameWindow loses focus.
Protected Method | OnOrientationChanged | Called when the GameWindow display orientation changes.
Protected Method | OnPaint | Called when the GameWindow needs to be painted.
Protected Method | OnScreenDeviceNameChanged | Called when the GameWindow is moved to a different screen. Raises the ScreenDeviceNameChanged event.
Protected Method | SetSupportedOrientations | Sets the supported display orientations.
Protected Method | SetTitle | Sets the title of the GameWindow.

Expand image See Also

Reference

GameWindow Class
Microsoft.Xna.Framework Namespace


GameWindow.BeginScreenDeviceChange Method

GameWindow.BeginScreenDeviceChange Method

Starts a device transition (windowed to full screen or vice versa).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public abstract void BeginScreenDeviceChange (
         bool willBeFullScreen
)

Parameters

willBeFullScreen
Specifies whether the device will be in full-screen mode upon completion of the change.

Expand image Remarks

This method must be called before any device change occurs (that is, before resetting the graphics device). EndScreenDeviceChange should be called to complete the transition.

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.EndScreenDeviceChange Method

GameWindow.EndScreenDeviceChange Method

Completes a device transition.

Expand image Overload List

Name | Description
GameWindow.EndScreenDeviceChange (String) | Completes a device transition.
GameWindow.EndScreenDeviceChange (String, Int32, Int32) | Completes a device transition.

Expand image See Also

Reference

BeginScreenDeviceChange
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace


GameWindow.EndScreenDeviceChange Method (String)

GameWindow.EndScreenDeviceChange Method (String)
See Also
CollapseAll image

Completes a device transition.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void EndScreenDeviceChange (
         string screenDeviceName
)

Parameters

screenDeviceName
The desktop screen to move the window to. This should be the screen device name of the graphics device that has transitioned to full screen.

Expand image Remarks

This method must be called after any device change (that is, after resetting the graphics device).

Expand image See Also

Reference

BeginScreenDeviceChange
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.EndScreenDeviceChange Method (String, Int32, Int32)

GameWindow.EndScreenDeviceChange Method (String, Int32, Int32)
See Also
CollapseAll image

Completes a device transition.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public abstract void EndScreenDeviceChange (
         string screenDeviceName,
         int clientWidth,
         int clientHeight
)

Parameters

screenDeviceName
The desktop screen to move the window to. This should be the screen device name of the graphics device that has transitioned to full screen.
clientWidth
The new width of the game's client window.
clientHeight
The new height of the game's client window.

Expand image Remarks

This method must be called after any device change (that is, after resetting the graphics device).

Expand image See Also

Reference

BeginScreenDeviceChange
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.OnActivated Method

GameWindow.OnActivated Method

Called when the GameWindow gets focus.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected void OnActivated ()

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.OnClientSizeChanged Method

GameWindow.OnClientSizeChanged Method

Called when the size of the client window changes. Raises the ClientSizeChanged event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected void OnClientSizeChanged ()

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.OnDeactivated Method

GameWindow.OnDeactivated Method

Called when the GameWindow loses focus.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected void OnDeactivated ()

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.OnOrientationChanged Method

GameWindow.OnOrientationChanged Method

Called when the GameWindow display orientation changes.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected void OnOrientationChanged ()

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.OnPaint Method

GameWindow.OnPaint Method

Called when the GameWindow needs to be painted.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected void OnPaint ()

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.OnScreenDeviceNameChanged Method

GameWindow.OnScreenDeviceNameChanged Method

Called when the GameWindow is moved to a different screen. Raises the ScreenDeviceNameChanged event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected void OnScreenDeviceNameChanged ()

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.SetSupportedOrientations Method

GameWindow.SetSupportedOrientations Method

Sets the supported display orientations.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected internal abstract void SetSupportedOrientations (
         DisplayOrientation orientations
)

Parameters

orientations
A set of supported display orientations.

Expand image See Also

Overview

Automatic Rotation and Scaling (Windows Phone)

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Automatic Rotation and Scaling (Windows Phone)

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.SetTitle Method

GameWindow.SetTitle Method

Sets the title of the GameWindow.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected abstract void SetTitle (
         string title
)

Parameters

title
The new title of the GameWindow.
Note
This method is ignored on the Xbox 360.

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow Properties

GameWindow Properties

Expand image Public Properties

 | Name | Description
Public Property | AllowUserResizing | Specifies whether to allow the user to resize the game window.
Public Property | ClientBounds | The screen dimensions of the game window's client rectangle.
Public Property | CurrentOrientation | Gets the current display orientation, which reflects the physical orientation of the phone in the user's hand.
Public Property | Handle | Gets the handle to the system window.
Public Property | ScreenDeviceName | Gets the device name of the screen the window is currently in.
Public Property | Title | Gets and sets the title of the system window.

Expand image See Also

Reference

GameWindow Class
Microsoft.Xna.Framework Namespace


GameWindow.AllowUserResizing Property

GameWindow.AllowUserResizing Property

Specifies whether to allow the user to resize the game window.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
[DefaultValueAttribute(false)]
public abstract bool AllowUserResizing { get; set; }

Property Value

true if user resizing is allowed; false otherwise.
Note
On the Xbox 360, this property is always false.

Expand image See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.ClientBounds Property

GameWindow.ClientBounds Property

The screen dimensions of the game window's client rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public abstract Rectangle ClientBounds { get; }

Property Value

Screen dimensions of the game window's client rectangle.

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.CurrentOrientation Property

GameWindow.CurrentOrientation Property

Gets the current display orientation, which reflects the physical orientation of the phone in the user's hand.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public abstract DisplayOrientation CurrentOrientation { get; }

Property Value

The current display orientation.

Expand image Remarks

Windows Phone Specific Information
Orientation settings apply only to Windows Phone-based games.

Expand image See Also

Overview

Automatic Rotation and Scaling (Windows Phone)

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.Handle Property

GameWindow.Handle Property

Gets the handle to the system window.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public abstract IntPtr Handle { get; }

Property Value

The handle to the system window.
Note
On the Xbox 360 this property is always IntPtr.Zero.

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.ScreenDeviceName Property

GameWindow.ScreenDeviceName Property

Gets the device name of the screen the window is currently in.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public abstract string ScreenDeviceName { get; }

Property Value

The device name of the screen.

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.Title Property

GameWindow.Title Property

Gets and sets the title of the system window.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public string Title { get; set; }

Property Value

The title of the system window.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | Title is null. Use an empty string instead.
Note
This property is ignored on the Xbox 360.

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow Events

GameWindow Events

Expand image Public Events

 | Name | Description
Public Event | ClientSizeChanged | Raised when the size of the GameWindow changes.
Public Event | OrientationChanged | Describes the event raised when the display orientation of the GameWindow changes. When this event occurs, the XNA Framework automatically adjusts the game orientation based on the value specified by the developer with SupportedOrientations.
Public Event | ScreenDeviceNameChanged | Raised when the GameWindow moves to a different display.

Expand image See Also

Reference

GameWindow Class
Microsoft.Xna.Framework Namespace


GameWindow.ClientSizeChanged Event

GameWindow.ClientSizeChanged Event

Raised when the size of the GameWindow changes.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> ClientSizeChanged

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.OrientationChanged Event

GameWindow.OrientationChanged Event

Describes the event raised when the display orientation of the GameWindow changes. When this event occurs, the XNA Framework automatically adjusts the game orientation based on the value specified by the developer with SupportedOrientations.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> OrientationChanged

Expand image Remarks

Windows Phone Specific Information
Orientation settings apply only to Windows Phone-based games.

Expand image See Also

Overview

Automatic Rotation and Scaling (Windows Phone)

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameWindow.ScreenDeviceNameChanged Event

GameWindow.ScreenDeviceNameChanged Event

Raised when the GameWindow moves to a different display.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> ScreenDeviceNameChanged

Expand image See Also

Reference

GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceInformation Class

GraphicsDeviceInformation Class
See Also Members
CollapseAll image

Holds the settings for creating a graphics device on Windows.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public class GraphicsDeviceInformation

Expand image See Also

Reference

GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceInformation Members

GraphicsDeviceInformation Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the GraphicsDeviceInformation type.

Expand image Public Constructors

 | Name | Description
Public Method | GraphicsDeviceInformation | Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | Adapter | Specifies which graphics adapter to create the device on.
Public Property | GraphicsProfile | Gets the graphics profile, which determines the graphics feature set.
Public Property | PresentationParameters | Specifies the presentation parameters to use when creating a graphics device.

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a clone of this object.
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this object.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GraphicsDeviceInformation Class
Microsoft.Xna.Framework Namespace


GraphicsDeviceInformation Constructor

GraphicsDeviceInformation Constructor

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GraphicsDeviceInformation ()

Expand image See Also

Reference

GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceInformation Methods

GraphicsDeviceInformation Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a clone of this object.
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this object.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GraphicsDeviceInformation Class
Microsoft.Xna.Framework Namespace


GraphicsDeviceInformation.Clone Method

GraphicsDeviceInformation.Clone Method

Creates a clone of this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GraphicsDeviceInformation Clone ()

Return Value

The cloned object.

Expand image See Also

Reference

GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceInformation.Equals Method

GraphicsDeviceInformation.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current GraphicsDeviceInformation.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceInformation.GetHashCode Method

GraphicsDeviceInformation.GetHashCode Method

Gets the hash code for this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceInformation Properties

GraphicsDeviceInformation Properties

Expand image Public Properties

 | Name | Description
Public Property | Adapter | Specifies which graphics adapter to create the device on.
Public Property | GraphicsProfile | Gets the graphics profile, which determines the graphics feature set.
Public Property | PresentationParameters | Specifies the presentation parameters to use when creating a graphics device.

Expand image See Also

Reference

GraphicsDeviceInformation Class
Microsoft.Xna.Framework Namespace


GraphicsDeviceInformation.Adapter Property

GraphicsDeviceInformation.Adapter Property

Specifies which graphics adapter to create the device on.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GraphicsAdapter Adapter { get; set; }

Property Value

The graphics adapter to create the device on.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | Adapter is null. Try using DefaultAdapter instead.

Expand image See Also

Reference

GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceInformation.GraphicsProfile Property

GraphicsDeviceInformation.GraphicsProfile Property

Gets the graphics profile, which determines the graphics feature set.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GraphicsProfile GraphicsProfile { get; set; }

Property Value

The graphics profile.

Expand image See Also

Reference

GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceInformation.PresentationParameters Property

GraphicsDeviceInformation.PresentationParameters Property

Specifies the presentation parameters to use when creating a graphics device.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public PresentationParameters PresentationParameters { get; set; }

Property Value

The presentation parameters to use when creating a graphics device.

Expand image See Also

Reference

GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager Class

GraphicsDeviceManager Class
See Also Members
CollapseAll image

Handles the configuration and management of the graphics device.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public class GraphicsDeviceManager : IGraphicsDeviceService, IDisposable, IGraphicsDeviceManager

Expand image Remarks

Custom behavior of the GraphicsDeviceManager can be achieved by deriving a class from GraphicsDeviceManager. For example, to allow only widescreen devices in full-screen mode the RankDevices method could be overridden to drop non-widescreen devices.

Or, if you are creating a 2D game, you might want to create a graphics device without a depth buffer. By adding an event handler for the PreparingDeviceSettings event to the GraphicsDeviceManager, you can control the PresentationParameters properties associated with the graphics device. In the example below, the event handler is named graphics_Settings_NoDepthBuffer.

C#
graphics = new GraphicsDeviceManager(this);
graphics.PreparingDeviceSettings +=
    new EventHandler<PreparingDeviceSettingsEventArgs>(
                        graphics_Settings_NoDepthBuffer);

Expand image See Also

Reference

GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager Members

GraphicsDeviceManager Members
See Also Constructors Events Fields Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the GraphicsDeviceManager type.

Expand image Public Constructors

 | Name | Description
Public Method | GraphicsDeviceManager | Creates a new GraphicsDeviceManager and registers it to handle the configuration and management of the graphics device for the specified Game.

Expand image Public Fields

Name | Description
DefaultBackBufferHeight | Specifies the default minimum back-buffer height.
DefaultBackBufferWidth | Specifies the default minimum back-buffer width.

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | Gets the GraphicsDevice associated with the GraphicsDeviceManager.
Public Property | GraphicsProfile | Gets the graphics profile, which determines the graphics feature set.
Public Property | IsFullScreen | Gets or sets a value that indicates whether the device should start in full-screen mode.
Public Property | PreferMultiSampling | Gets or sets a value that indicates whether to enable a multisampled back buffer.
Public Property | PreferredBackBufferFormat | Gets or sets the format of the back buffer.
Public Property | PreferredBackBufferHeight | Gets or sets the preferred back-buffer height.
Public Property | PreferredBackBufferWidth | Gets or sets the preferred back-buffer width.
Public Property | PreferredDepthStencilFormat | Gets or sets the format of the depth stencil.
Public Property | SupportedOrientations | Gets or sets the display orientations that are available if automatic rotation and scaling is enabled.
Public Property | SynchronizeWithVerticalRetrace | Gets or sets a value that indicates whether to sync to the vertical trace (vsync) when presenting the back buffer.

Expand image Public Methods

 | Name | Description
Public Method | ApplyChanges | Applies any changes to device-related properties, changing the graphics device as necessary.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToggleFullScreen | Toggles between full screen and windowed mode.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | CanResetDevice | Determines whether the given GraphicsDeviceInformation is compatible with the existing graphics device.
Protected Method | Dispose | Releases the unmanaged resources used by the GraphicsDeviceManager and optionally releases the managed resources.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | FindBestDevice | Finds the best device configuration that is compatible with the current device preferences.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnDeviceCreated | Called when a device is created. Raises the DeviceCreated event.
Protected Method | OnDeviceDisposing | Called when a device is being disposed. Raises the DeviceDisposing event.
Protected Method | OnDeviceReset | Called when the device has been reset. Raises the DeviceReset event.
Protected Method | OnDeviceResetting | Called when the device is about to be reset. Raises the DeviceResetting event.
Protected Method | OnPreparingDeviceSettings | Called when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset or recreation of the GraphicsDevice). Raises the PreparingDeviceSettings event.
Protected Method | RankDevices | Ranks the given list of devices that satisfy the given preferences.

Expand image Public Events

 | Name | Description
Public Event | DeviceCreated | Raised when a new graphics device is created.
Public Event | DeviceDisposing | Raised when the GraphicsDeviceManager is being disposed.
Public Event | DeviceReset | Raised when the GraphicsDeviceManager is reset.
Public Event | DeviceResetting | Raised when the GraphicsDeviceManager is about to be reset.
Public Event | Disposed | Raised when the GraphicsDeviceManager is disposed.
Public Event | PreparingDeviceSettings | Raised when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset or recreation of the GraphicsDevice).

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.IGraphicsDeviceManager.BeginDraw | Prepares the GraphicsDevice to draw.
Explicit Interface Implementation | Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice | Called to ensure that the device manager has created a valid device.
Explicit Interface Implementation | System.IDisposable.Dispose | Releases all resources used by the GraphicsDeviceManager class.
Explicit Interface Implementation | Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw | Called by the game at the end of drawing and presents the final rendering.

Expand image See Also

Reference

GraphicsDeviceManager Class
Microsoft.Xna.Framework Namespace


GraphicsDeviceManager Fields

GraphicsDeviceManager Fields

Expand image Public Fields

Name | Description
DefaultBackBufferHeight | Specifies the default minimum back-buffer height.
DefaultBackBufferWidth | Specifies the default minimum back-buffer width.

Expand image See Also

Reference

GraphicsDeviceManager Class
Microsoft.Xna.Framework Namespace


GraphicsDeviceManager.DefaultBackBufferHeight Field

GraphicsDeviceManager.DefaultBackBufferHeight Field

Specifies the default minimum back-buffer height.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public static readonly int DefaultBackBufferHeight

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.DefaultBackBufferWidth Field

GraphicsDeviceManager.DefaultBackBufferWidth Field

Specifies the default minimum back-buffer width.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public static readonly int DefaultBackBufferWidth

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager Constructor

GraphicsDeviceManager Constructor

Creates a new GraphicsDeviceManager and registers it to handle the configuration and management of the graphics device for the specified Game.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GraphicsDeviceManager (
         Game game
)

Parameters

game
Game the GraphicsDeviceManager should be associated with.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The game parameter is null.
ArgumentException | A graphics device manager has already been added to Services and registered as the graphics device manager for the application. The graphics device manager cannot be changed once it is set.

Expand image Remarks

This constructor adds this GraphicsDeviceManager to the collection of game services that have been implicitly registered by adding them to the Game.Services property.

Caution

Although this constructor requires an instance of Game, if the application does not otherwise require an instance of Game it is often better to implement a the IGraphicsDeviceService and IGraphicsDeviceManager interfaces to provide the same services that would be provided by the GraphicsDeviceManager.

Custom behavior of the GraphicsDeviceManager can be achieved by deriving a class from GraphicsDeviceManager. For example, to allow only widescreen devices in full-screen mode the RankDevices method could be overridden to drop non-widescreen devices.

Or, if you are creating a 2D game, you might want to create a graphics device without a depth buffer. By adding an event handler for the PreparingDeviceSettings event to the GraphicsDeviceManager, you can control the PresentationParameters properties associated with the graphics device. In the example below, the event handler is named graphics_Settings_NoDepthBuffer.

C#
graphics = new GraphicsDeviceManager(this);
graphics.PreparingDeviceSettings +=
    new EventHandler<PreparingDeviceSettingsEventArgs>(
                        graphics_Settings_NoDepthBuffer);

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager Methods

GraphicsDeviceManager Methods

Expand image Public Methods

 | Name | Description
Public Method | ApplyChanges | Applies any changes to device-related properties, changing the graphics device as necessary.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToggleFullScreen | Toggles between full screen and windowed mode.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | CanResetDevice | Determines whether the given GraphicsDeviceInformation is compatible with the existing graphics device.
Protected Method | Dispose | Releases the unmanaged resources used by the GraphicsDeviceManager and optionally releases the managed resources.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | FindBestDevice | Finds the best device configuration that is compatible with the current device preferences.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnDeviceCreated | Called when a device is created. Raises the DeviceCreated event.
Protected Method | OnDeviceDisposing | Called when a device is being disposed. Raises the DeviceDisposing event.
Protected Method | OnDeviceReset | Called when the device has been reset. Raises the DeviceReset event.
Protected Method | OnDeviceResetting | Called when the device is about to be reset. Raises the DeviceResetting event.
Protected Method | OnPreparingDeviceSettings | Called when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset or recreation of the GraphicsDevice). Raises the PreparingDeviceSettings event.
Protected Method | RankDevices | Ranks the given list of devices that satisfy the given preferences.

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.IGraphicsDeviceManager.BeginDraw | Prepares the GraphicsDevice to draw.
Explicit Interface Implementation | Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice | Called to ensure that the device manager has created a valid device.
Explicit Interface Implementation | System.IDisposable.Dispose | Releases all resources used by the GraphicsDeviceManager class.
Explicit Interface Implementation | Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw | Called by the game at the end of drawing and presents the final rendering.

Expand image See Also

Reference

GraphicsDeviceManager Class
Microsoft.Xna.Framework Namespace


GraphicsDeviceManager.ApplyChanges Method

GraphicsDeviceManager.ApplyChanges Method

Applies any changes to device-related properties, changing the graphics device as necessary.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void ApplyChanges ()

Expand image Exceptions

Exception type Condition
NoSuitableGraphicsDeviceException

One of the following conditions has occurred:

  • Could not find a Direct3D device that has a Direct3D9-level driver and supports a minimum of Pixel Shader Model 1.1.
  • Could not find a Direct3D device compatible with the current device preferences.
  • The process of ranking devices removed all compatible devices.
  • Direct3D hardware acceleration is not available or has been disabled. Verify that a Direct3D-enabled graphics device is installed, and check the display properties to verify that Hardware acceleration is set to Full.
  • Remote Desktop is in use. Direct3D is not available when you are using Remote Desktop.
InvalidOperationException

This graphics device manager has not been added to Services and registered as the graphics device manager for the application. Device settings cannot be changed or committed unless the device has been registered.

ArgumentException

Invalid arguments have been requested for the creation of the graphics device.

Invalid back buffer options have been requested:

  • BackBufferFormat is not valid. Try SurfaceFormat.Bgr565, SurfaceFormat.Bgr555, SurfaceFormat.Bgra5551, SurfaceFormat.Bgr32, SurfaceFormat.Color, SurfaceFormat.Bgra1010102.
  • The selected BackBufferFormat and IsFullScreen values are not valid for the selected adapter format and device type.
  • The BackBufferWidth and BackBufferHeight values do not correspond to a valid display mode.

Invalid PresentationParameters.PresentationInterval has been requested:

  • On Xbox 360, PresentationParameters.PresentationInterval has been assigned the invalid value PresentInterval.Four.

Invalid depth stencil options have been requested:

  • Multiple PresentationParameters have been specified but BackBufferFormat, BackBufferWidth, and BackBufferHeight are not the same for all adapters.

IsFullScreen is true, but:

  • BackBufferWidth and BackBufferHeight are not nonzero.
  • PresentationInterval is not one of the following: PresentInterval.Default, PresentInterval.Immediate, PresentInterval.One, PresentInterval.Two PresentInterval.Three, or PresentInterval.Four.
  • The selected adapter does not support the selected full screen PresentationInterval.

IsFullScreen is false, but:

  • PresentationInterval is not one of the following: PresentInterval.Default, PresentInterval.Immediate, or PresentInterval.One.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.CanResetDevice Method

GraphicsDeviceManager.CanResetDevice Method

Determines whether the given GraphicsDeviceInformation is compatible with the existing graphics device.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual bool CanResetDevice (
         GraphicsDeviceInformation newDeviceInfo
)

Parameters

newDeviceInfo
Information describing the desired device configuration.

Return Value

true if a device reset can be used to get a device compatible with the GraphicsDeviceInformation; false otherwise.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.Dispose Method

GraphicsDeviceManager.Dispose Method

Releases the unmanaged resources used by the GraphicsDeviceManager and optionally releases the managed resources.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool disposing
)

Parameters

disposing
true to release both automatic and manual resources; false to release only manual resources.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.FindBestDevice Method

GraphicsDeviceManager.FindBestDevice Method

Finds the best device configuration that is compatible with the current device preferences.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual GraphicsDeviceInformation FindBestDevice (
         bool anySuitableDevice
)

Parameters

anySuitableDevice
true if the FindBestDevice can select devices from any available adapter; false if only the current adapter should be considered.

Return Value

The best device configuration found.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.IGraphicsDeviceManager.BeginDraw Method

Microsoft.Xna.Framework.IGraphicsDeviceManager.BeginDraw Method
See Also
CollapseAll image

Prepares the GraphicsDevice to draw.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
private bool Microsoft.Xna.Framework.IGraphicsDeviceManager.BeginDraw ()

Return Value

true if the GraphicsDevice is ready to draw; false otherwise.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice Method

Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice Method
See Also
CollapseAll image

Called to ensure that the device manager has created a valid device.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice ()

Expand image Exceptions

Exception type Condition
NoSuitableGraphicsDeviceException

One of the following conditions has occurred:

  • Could not find a Direct3D device that has a Direct3D9-level driver and supports a minimum of Pixel Shader Model 1.1.
  • Could not find a Direct3D device compatible with the current device preferences.
  • The process of ranking devices removed all compatible devices.
  • Direct3D hardware acceleration is not available or has been disabled. Verify that a Direct3D-enabled graphics device is installed, and check the display properties to verify that Hardware acceleration is set to Full.
  • Remote Desktop is in use. Direct3D is not available when you are using Remote Desktop.
InvalidOperationException

This graphics device manager has not been added to Services and registered as the graphics device manager for the application. Device settings cannot be changed or committed unless the device has been registered.

ArgumentException

Invalid arguments have been requested for the creation of the graphics device.

Invalid back buffer options have been requested:

  • BackBufferFormat is not valid. Try SurfaceFormat.Bgr565, SurfaceFormat.Bgr555, SurfaceFormat.Bgra5551, SurfaceFormat.Bgr32, SurfaceFormat.Color, SurfaceFormat.Bgra1010102.
  • The selected BackBufferFormat and IsFullScreen values are not valid for the selected adapter format and device type.
  • The BackBufferWidth and BackBufferHeight values do not correspond to a valid display mode.

Invalid PresentationParameters.PresentationInterval option has been requested:

  • On Xbox 360, PresentationParameters.PresentationInterval has been assigned the invalid value PresentInterval.Four.

Invalid depth stencil options have been requested:

  • Multiple PresentationParameters have been specified but BackBufferFormat, BackBufferWidth, and BackBufferHeight are not the same for all adapters.

IsFullScreen is true, but:

  • BackBufferWidth and BackBufferHeight are not nonzero.
  • PresentationInterval is not one of the following: PresentInterval.Default, PresentInterval.Immediate, PresentInterval.One, PresentInterval.Two PresentInterval.Three, or PresentInterval.Four.
  • The selected adapter does not support the selected full screen PresentationInterval.

IsFullScreen is false, but:

  • PresentationInterval is not one of the following: PresentInterval.Default, PresentInterval.Immediate, or PresentInterval.One.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw Method

Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw Method
See Also
CollapseAll image

Called by the game at the end of drawing and presents the final rendering.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw ()

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.OnDeviceCreated Method

GraphicsDeviceManager.OnDeviceCreated Method

Called when a device is created. Raises the DeviceCreated event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnDeviceCreated (
         Object sender,
         EventArgs args
)

Parameters

sender
The GraphicsDeviceManager.
args
Arguments for the DeviceCreated event.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.OnDeviceDisposing Method

GraphicsDeviceManager.OnDeviceDisposing Method

Called when a device is being disposed. Raises the DeviceDisposing event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnDeviceDisposing (
         Object sender,
         EventArgs args
)

Parameters

sender
The GraphicsDeviceManager.
args
Arguments for the DeviceDisposing event.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.OnDeviceReset Method

GraphicsDeviceManager.OnDeviceReset Method

Called when the device has been reset. Raises the DeviceReset event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnDeviceReset (
         Object sender,
         EventArgs args
)

Parameters

sender
The GraphicsDeviceManager.
args
Arguments for the DeviceReset event.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.OnDeviceResetting Method

GraphicsDeviceManager.OnDeviceResetting Method

Called when the device is about to be reset. Raises the DeviceResetting event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnDeviceResetting (
         Object sender,
         EventArgs args
)

Parameters

sender
The GraphicsDeviceManager.
args
Arguments for the DeviceResetting event.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.OnPreparingDeviceSettings Method

GraphicsDeviceManager.OnPreparingDeviceSettings Method

Called when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset or recreation of the GraphicsDevice). Raises the PreparingDeviceSettings event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void OnPreparingDeviceSettings (
         Object sender,
         PreparingDeviceSettingsEventArgs args
)

Parameters

sender
The GraphicsDeviceManager.
args
The graphics device information to modify.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.RankDevices Method

GraphicsDeviceManager.RankDevices Method

Ranks the given list of devices that satisfy the given preferences.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
protected virtual void RankDevices (
         List<GraphicsDeviceInformation> foundDevices
)

Parameters

foundDevices
The list of devices to rank.

Expand image Remarks

RankDevices orders the provided list so that devices earlier in the list are preferred over devices later in the list. This method can remove devices from the list if they do not satisfy some custom criteria.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.IDisposable.Dispose Method

System.IDisposable.Dispose Method

Releases all resources used by the GraphicsDeviceManager class.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
private void System.IDisposable.Dispose ()

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.ToggleFullScreen Method

GraphicsDeviceManager.ToggleFullScreen Method

Toggles between full screen and windowed mode.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void ToggleFullScreen ()

Expand image Exceptions

Exception type Condition
NoSuitableGraphicsDeviceException

One of the following conditions has occurred:

  • Could not find a Direct3D device that has a Direct3D9-level driver and supports a minimum of Pixel Shader Model 1.1.
  • Could not find a Direct3D device compatible with the current device preferences.
  • The process of ranking devices removed all compatible devices.
  • Direct3D hardware acceleration is not available or has been disabled. Verify that a Direct3D-enabled graphics device is installed, and check the display properties to verify that Hardware acceleration is set to Full.
  • Remote Desktop is in use. Direct3D is not available when you are using Remote Desktop.
InvalidOperationException

This graphics device manager has not been added to Services and registered as the graphics device manager for the application. Device settings cannot be changed or committed unless the device has been registered.

ArgumentException

Full-screen mode is not compatible with the current back buffer settings:

  • The selected BackBufferFormat and IsFullScreen values are not valid for the selected adapter format and device type.

IsFullScreen is true, but:

  • BackBufferWidth and BackBufferHeight are not nonzero.
  • PresentationInterval is not one of the following: PresentInterval.Default, PresentInterval.Immediate, PresentInterval.One, PresentInterval.Two PresentInterval.Three, or PresentInterval.Four.
  • The selected adapter does not support the selected full screen PresentationInterval.

IsFullScreen is false, but:

  • PresentationInterval is not one of the following: PresentInterval.Default, PresentInterval.Immediate, or PresentInterval.One.

Expand image Remarks

This method has no effect on the Xbox 360.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager Properties

GraphicsDeviceManager Properties

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | Gets the GraphicsDevice associated with the GraphicsDeviceManager.
Public Property | GraphicsProfile | Gets the graphics profile, which determines the graphics feature set.
Public Property | IsFullScreen | Gets or sets a value that indicates whether the device should start in full-screen mode.
Public Property | PreferMultiSampling | Gets or sets a value that indicates whether to enable a multisampled back buffer.
Public Property | PreferredBackBufferFormat | Gets or sets the format of the back buffer.
Public Property | PreferredBackBufferHeight | Gets or sets the preferred back-buffer height.
Public Property | PreferredBackBufferWidth | Gets or sets the preferred back-buffer width.
Public Property | PreferredDepthStencilFormat | Gets or sets the format of the depth stencil.
Public Property | SupportedOrientations | Gets or sets the display orientations that are available if automatic rotation and scaling is enabled.
Public Property | SynchronizeWithVerticalRetrace | Gets or sets a value that indicates whether to sync to the vertical trace (vsync) when presenting the back buffer.

Expand image See Also

Reference

GraphicsDeviceManager Class
Microsoft.Xna.Framework Namespace


GraphicsDeviceManager.GraphicsDevice Property

GraphicsDeviceManager.GraphicsDevice Property

Gets the GraphicsDevice associated with the GraphicsDeviceManager.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GraphicsDevice GraphicsDevice { get; }

Property Value

The GraphicsDevice associated with the GraphicsDeviceManager.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.GraphicsProfile Property

GraphicsDeviceManager.GraphicsProfile Property

Gets the graphics profile, which determines the graphics feature set.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GraphicsProfile GraphicsProfile { get; set; }

Property Value

The graphics profile.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.IsFullScreen Property

GraphicsDeviceManager.IsFullScreen Property

Gets or sets a value that indicates whether the device should start in full-screen mode.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool IsFullScreen { get; set; }

Property Value

Value that indicates whether the device should start in full-screen mode.

Expand image Remarks

If no devices are present that support full screen, or the underlying host supports only full screen, this value may be ignored. This value has no effect on Xbox 360.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.PreferMultiSampling Property

GraphicsDeviceManager.PreferMultiSampling Property

Gets or sets a value that indicates whether to enable a multisampled back buffer.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool PreferMultiSampling { get; set; }

Property Value

Value indicating whether multisampling is enabled on the back buffer.

Expand image Remarks

PreferMultiSampling is ignored if no hardware is available that supports multisampling.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.PreferredBackBufferFormat Property

GraphicsDeviceManager.PreferredBackBufferFormat Property

Gets or sets the format of the back buffer.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public SurfaceFormat PreferredBackBufferFormat { get; set; }

Property Value

The format of the back buffer.

Expand image Exceptions

Exception type Condition
ArgumentOutOfRangeException

The BackBufferFormat requested is invalid. Use one of the following:

  • SurfaceFormat.Bgr565
  • SurfaceFormat.Bgr555
  • SurfaceFormat.Bgra5551
  • SurfaceFormat.Bgr32
  • SurfaceFormat.Color
  • SurfaceFormat.Bgra1010102

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.PreferredBackBufferHeight Property

GraphicsDeviceManager.PreferredBackBufferHeight Property

Gets or sets the preferred back-buffer height.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public int PreferredBackBufferHeight { get; set; }

Property Value

The preferred back-buffer height.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | BackBufferHeight is not greater than zero.

Expand image Remarks

If you request a back-buffer resolution that is not supported by the output device, the XNA Framework automatically selects the highest resolution supported by the output device. For example, if a graphics back buffer with a resolution of 1920×1080 (1080p or 1080i) is created and displayed on a device with 480i resolution, the back buffer is resized automatically to 480i.

Expand image See Also

Overview

Automatic Rotation and Scaling (Windows Phone)

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.PreferredBackBufferWidth Property

GraphicsDeviceManager.PreferredBackBufferWidth Property

Gets or sets the preferred back-buffer width.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public int PreferredBackBufferWidth { get; set; }

Property Value

The preferred back-buffer width.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | BackBufferWidth is not greater than zero.

Expand image Remarks

If you request a back-buffer resolution that is not supported by the output device, the XNA Framework automatically selects the highest resolution supported by the output device. For example, if a graphics back buffer with a resolution of 1920×1080 (1080p or 1080i) is created and displayed on a device with 480i resolution, the back buffer automatically is resized to 480i.

Expand image See Also

Overview

Automatic Rotation and Scaling (Windows Phone)

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.PreferredDepthStencilFormat Property

GraphicsDeviceManager.PreferredDepthStencilFormat Property

Gets or sets the format of the depth stencil.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public DepthFormat PreferredDepthStencilFormat { get; set; }

Property Value

The format of the depth stencil.

Expand image Exceptions

Exception type Condition
ArgumentOutOfRangeException

The DepthStencilFormat requested is an invalid format. Use one of the following:

  • DepthFormat.Depth32
  • DepthFormat.Depth15Stencil1
  • DepthFormat.Depth24Stencil8
  • DepthFormat.Depth24
  • DepthFormat.Depth24Stencil4
  • DepthFormat.Depth16
  • DepthFormat.Depth24Stencil8Single

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.SupportedOrientations Property

GraphicsDeviceManager.SupportedOrientations Property

Gets or sets the display orientations that are available if automatic rotation and scaling is enabled.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public DisplayOrientation SupportedOrientations { get; set; }

Property Value

The supported display orientations.

Expand image Remarks

Windows Phone Specific Information
Orientation settings apply only to Windows Phone-based games.

Call ApplyChanges to apply this change if you are setting this property outside of the game constructor.

Expand image See Also

Overview

Automatic Rotation and Scaling (Windows Phone)

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
DisplayOrientation Enumeration

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.SynchronizeWithVerticalRetrace Property

GraphicsDeviceManager.SynchronizeWithVerticalRetrace Property
See Also
CollapseAll image

Gets or sets a value that indicates whether to sync to the vertical trace (vsync) when presenting the back buffer.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool SynchronizeWithVerticalRetrace { get; set; }

Property Value

Value that indicates whether to sync to the vertical trace (vsync) when presenting the back buffer.

Expand image Remarks

This value is honored (when possible) in full screen and windowed modes.

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager Events

GraphicsDeviceManager Events

Expand image Public Events

 | Name | Description
Public Event | DeviceCreated | Raised when a new graphics device is created.
Public Event | DeviceDisposing | Raised when the GraphicsDeviceManager is being disposed.
Public Event | DeviceReset | Raised when the GraphicsDeviceManager is reset.
Public Event | DeviceResetting | Raised when the GraphicsDeviceManager is about to be reset.
Public Event | Disposed | Raised when the GraphicsDeviceManager is disposed.
Public Event | PreparingDeviceSettings | Raised when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset or recreation of the GraphicsDevice).

Expand image See Also

Reference

GraphicsDeviceManager Class
Microsoft.Xna.Framework Namespace


GraphicsDeviceManager.DeviceCreated Event

GraphicsDeviceManager.DeviceCreated Event

Raised when a new graphics device is created.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceCreated

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.DeviceDisposing Event

GraphicsDeviceManager.DeviceDisposing Event

Raised when the GraphicsDeviceManager is being disposed.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceDisposing

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.DeviceReset Event

GraphicsDeviceManager.DeviceReset Event

Raised when the GraphicsDeviceManager is reset.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceReset

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.DeviceResetting Event

GraphicsDeviceManager.DeviceResetting Event

Raised when the GraphicsDeviceManager is about to be reset.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceResetting

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.Disposed Event

GraphicsDeviceManager.Disposed Event

Raised when the GraphicsDeviceManager is disposed.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Disposed

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceManager.PreparingDeviceSettings Event

GraphicsDeviceManager.PreparingDeviceSettings Event

Raised when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset or recreation of the GraphicsDevice).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<PreparingDeviceSettingsEventArgs> PreparingDeviceSettings

Expand image See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IDrawable Interface

IDrawable Interface

Defines the interface for a drawable game component.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public interface IDrawable

Expand image See Also

Reference

IDrawable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IDrawable Members

IDrawable Members
See Also Events Methods Properties
CollapseAll image

The following tables list the members exposed by the IDrawable type.

Expand image Public Properties

 | Name | Description
Public Property | DrawOrder | The order in which to draw this object relative to other objects. Objects with a lower value are drawn first.
Public Property | Visible | Indicates whether IDrawable.Draw should be called in Game.Draw for this game component.

Expand image Public Methods

 | Name | Description
Public Method | Draw | Draws the IDrawable.

Expand image Public Events

 | Name | Description
Public Event | DrawOrderChanged | Raised when the DrawOrder property changes.
Public Event | VisibleChanged | Raised when the Visible property changes.

Expand image See Also

Reference

IDrawable Interface
Microsoft.Xna.Framework Namespace


IDrawable Methods

IDrawable Methods

Expand image Public Methods

 | Name | Description
Public Method | Draw | Draws the IDrawable.

Expand image See Also

Reference

IDrawable Interface
Microsoft.Xna.Framework Namespace


IDrawable.Draw Method

IDrawable.Draw Method

Draws the IDrawable.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void Draw (
         GameTime gameTime
)

Parameters

gameTime
Snapshot of the game's timing state.

Expand image Remarks

Caution

In the Draw method of an Xbox 360 game, vertex buffers, index buffers, and textures should not be written using SetData when they are intended to be used for rendering. This condition may lead to graphics corruption or crashes. To avoid this potential issue, use DrawUserPrimitives or DrawUserIndexedPrimitives as the preferred alternative to VertexBuffer.SetData for dynamic vertex generation. In cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of embedded memory (EDRAM), predicated tiling is used on this platform to compensate for the additional memory requirements. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render target dimensions.

When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not available for modification until the GPU is finished with presenting the entire frame.

Expand image See Also

Concepts

Predicated Tiling

Reference

IDrawable Interface
IDrawable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IDrawable Properties

IDrawable Properties

Expand image Public Properties

 | Name | Description
Public Property | DrawOrder | The order in which to draw this object relative to other objects. Objects with a lower value are drawn first.
Public Property | Visible | Indicates whether IDrawable.Draw should be called in Game.Draw for this game component.

Expand image See Also

Reference

IDrawable Interface
Microsoft.Xna.Framework Namespace


IDrawable.DrawOrder Property

IDrawable.DrawOrder Property

The order in which to draw this object relative to other objects. Objects with a lower value are drawn first.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public int DrawOrder { get; }

Property Value

Order in which to draw this object relative to other objects.

Expand image See Also

Reference

IDrawable Interface
IDrawable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IDrawable.Visible Property

IDrawable.Visible Property

Indicates whether IDrawable.Draw should be called in Game.Draw for this game component.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool Visible { get; }

Property Value

true if Draw should be called; false otherwise.

Expand image See Also

Reference

IDrawable Interface
IDrawable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IDrawable Events

IDrawable Events

Expand image Public Events

 | Name | Description
Public Event | DrawOrderChanged | Raised when the DrawOrder property changes.
Public Event | VisibleChanged | Raised when the Visible property changes.

Expand image See Also

Reference

IDrawable Interface
Microsoft.Xna.Framework Namespace


IDrawable.DrawOrderChanged Event

IDrawable.DrawOrderChanged Event

Raised when the DrawOrder property changes.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DrawOrderChanged

Expand image See Also

Reference

IDrawable Interface
IDrawable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IDrawable.VisibleChanged Event

IDrawable.VisibleChanged Event

Raised when the Visible property changes.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> VisibleChanged

Expand image See Also

Reference

IDrawable Interface
IDrawable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGameComponent Interface

IGameComponent Interface

Defines an interface for game components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public interface IGameComponent

Expand image See Also

Reference

IGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGameComponent Members

IGameComponent Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the IGameComponent type.

Expand image Public Methods

 | Name | Description
Public Method | Initialize | Called when the component should be initialized. This method can be used for tasks like querying for services the component needs and setting up non-graphics resources.

Expand image See Also

Reference

IGameComponent Interface
Microsoft.Xna.Framework Namespace


IGameComponent Methods

IGameComponent Methods

Expand image Public Methods

 | Name | Description
Public Method | Initialize | Called when the component should be initialized. This method can be used for tasks like querying for services the component needs and setting up non-graphics resources.

Expand image See Also

Reference

IGameComponent Interface
Microsoft.Xna.Framework Namespace


IGameComponent.Initialize Method

IGameComponent.Initialize Method

Called when the component should be initialized. This method can be used for tasks like querying for services the component needs and setting up non-graphics resources.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void Initialize ()

Expand image See Also

Reference

IGameComponent Interface
IGameComponent Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGraphicsDeviceManager Interface

IGraphicsDeviceManager Interface

Defines the interface for an object that manages a GraphicsDevice.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public interface IGraphicsDeviceManager

Expand image See Also

Reference

IGraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGraphicsDeviceManager Members

IGraphicsDeviceManager Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the IGraphicsDeviceManager type.

Expand image Public Methods

 | Name | Description
Public Method | BeginDraw | Starts the drawing of a frame.
Public Method | CreateDevice | Called to ensure that the device manager has created a valid device.
Public Method | EndDraw | Called by the game at the end of drawing; presents the final rendering.

Expand image See Also

Reference

IGraphicsDeviceManager Interface
Microsoft.Xna.Framework Namespace


IGraphicsDeviceManager Methods

IGraphicsDeviceManager Methods

Expand image Public Methods

 | Name | Description
Public Method | BeginDraw | Starts the drawing of a frame.
Public Method | CreateDevice | Called to ensure that the device manager has created a valid device.
Public Method | EndDraw | Called by the game at the end of drawing; presents the final rendering.

Expand image See Also

Reference

IGraphicsDeviceManager Interface
Microsoft.Xna.Framework Namespace


IGraphicsDeviceManager.BeginDraw Method

IGraphicsDeviceManager.BeginDraw Method

Starts the drawing of a frame.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool BeginDraw ()

Return Value

true if the frame should be drawn; false otherwise.

Expand image See Also

Reference

IGraphicsDeviceManager Interface
IGraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGraphicsDeviceManager.CreateDevice Method

IGraphicsDeviceManager.CreateDevice Method

Called to ensure that the device manager has created a valid device.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void CreateDevice ()

Expand image See Also

Reference

IGraphicsDeviceManager Interface
IGraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGraphicsDeviceManager.EndDraw Method

IGraphicsDeviceManager.EndDraw Method

Called by the game at the end of drawing; presents the final rendering.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void EndDraw ()

Expand image See Also

Reference

IGraphicsDeviceManager Interface
IGraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IUpdateable Interface

IUpdateable Interface

Defines an interface for a game component that should be updated in Game.Update.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public interface IUpdateable

Expand image See Also

Reference

IUpdateable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IUpdateable Members

IUpdateable Members
See Also Events Methods Properties
CollapseAll image

The following tables list the members exposed by the IUpdateable type.

Expand image Public Properties

 | Name | Description
Public Property | Enabled | Indicates whether the game component's Update method should be called in Game.Update.
Public Property | UpdateOrder | Indicates when the game component should be updated relative to other game components. Lower values are updated first.

Expand image Public Methods

 | Name | Description
Public Method | Update | Called when the game component should be updated.

Expand image Public Events

 | Name | Description
Public Event | EnabledChanged | Raised when the Enabled property changes.
Public Event | UpdateOrderChanged | Raised when the UpdateOrder property changes.

Expand image See Also

Reference

IUpdateable Interface
Microsoft.Xna.Framework Namespace


IUpdateable Methods

IUpdateable Methods

Expand image Public Methods

 | Name | Description
Public Method | Update | Called when the game component should be updated.

Expand image See Also

Reference

IUpdateable Interface
Microsoft.Xna.Framework Namespace


IUpdateable.Update Method

IUpdateable.Update Method

Called when the game component should be updated.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public void Update (
         GameTime gameTime
)

Parameters

gameTime
Snapshot of the game's timing state.

Expand image See Also

Reference

IUpdateable Interface
IUpdateable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IUpdateable Properties

IUpdateable Properties

Expand image Public Properties

 | Name | Description
Public Property | Enabled | Indicates whether the game component's Update method should be called in Game.Update.
Public Property | UpdateOrder | Indicates when the game component should be updated relative to other game components. Lower values are updated first.

Expand image See Also

Reference

IUpdateable Interface
Microsoft.Xna.Framework Namespace


IUpdateable.Enabled Property

IUpdateable.Enabled Property

Indicates whether the game component's Update method should be called in Game.Update.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public bool Enabled { get; }

Property Value

true if Update should be called; false otherwise.

Expand image See Also

Reference

IUpdateable Interface
IUpdateable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IUpdateable.UpdateOrder Property

IUpdateable.UpdateOrder Property

Indicates when the game component should be updated relative to other game components. Lower values are updated first.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public int UpdateOrder { get; }

Property Value

When the game component should be updated.

Expand image See Also

Reference

IUpdateable Interface
IUpdateable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IUpdateable Events

IUpdateable Events

Expand image Public Events

 | Name | Description
Public Event | EnabledChanged | Raised when the Enabled property changes.
Public Event | UpdateOrderChanged | Raised when the UpdateOrder property changes.

Expand image See Also

Reference

IUpdateable Interface
Microsoft.Xna.Framework Namespace


IUpdateable.EnabledChanged Event

IUpdateable.EnabledChanged Event

Raised when the Enabled property changes.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> EnabledChanged

Expand image See Also

Reference

IUpdateable Interface
IUpdateable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IUpdateable.UpdateOrderChanged Event

IUpdateable.UpdateOrderChanged Event

Raised when the UpdateOrder property changes.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> UpdateOrderChanged

Expand image See Also

Reference

IUpdateable Interface
IUpdateable Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LaunchParameters Class

LaunchParameters Class
See Also Members
CollapseAll image

The start up parameters for launching a Windows Phone or Windows game.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class LaunchParameters : Dictionary<string, string>

Expand image See Also

Reference

LaunchParameters Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LaunchParameters Members

LaunchParameters Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the LaunchParameters type.

Expand image Public Constructors

 | Name | Description
Public Method | LaunchParameters | Initializes a new instance of LaunchParameters.

Expand image Public Properties

 | Name | Description
Public Property | Comparer | (Inherited from Dictionary.)
Public Property | Count | (Inherited from Dictionary.)
Public Property | Item | (Inherited from Dictionary.)
Public Property | Keys | (Inherited from Dictionary.)
Public Property | Values | (Inherited from Dictionary.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Dictionary.)
Public Method | Clear | (Inherited from Dictionary.)
Public Method | ContainsKey | (Inherited from Dictionary.)
Public Method | ContainsValue | (Inherited from Dictionary.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Dictionary.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Remove | (Inherited from Dictionary.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | (Inherited from Dictionary.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

LaunchParameters Class
Microsoft.Xna.Framework Namespace


LaunchParameters Constructor

LaunchParameters Constructor

Initializes a new instance of LaunchParameters.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public LaunchParameters ()

Expand image See Also

Reference

LaunchParameters Class
LaunchParameters Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LaunchParameters Methods

LaunchParameters Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Dictionary.)
Public Method | Clear | (Inherited from Dictionary.)
Public Method | ContainsKey | (Inherited from Dictionary.)
Public Method | ContainsValue | (Inherited from Dictionary.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Dictionary.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Remove | (Inherited from Dictionary.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | (Inherited from Dictionary.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

LaunchParameters Class
Microsoft.Xna.Framework Namespace


LaunchParameters Properties

LaunchParameters Properties

Expand image Public Properties

 | Name | Description
Public Property | Comparer | (Inherited from Dictionary.)
Public Property | Count | (Inherited from Dictionary.)
Public Property | Item | (Inherited from Dictionary.)
Public Property | Keys | (Inherited from Dictionary.)
Public Property | Values | (Inherited from Dictionary.)

Expand image See Also

Reference

LaunchParameters Class
Microsoft.Xna.Framework Namespace


MathHelper Class

MathHelper Class
See Also Members
CollapseAll image

Contains commonly used precalculated values.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static class MathHelper

Expand image See Also

Reference

MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper Members

MathHelper Members
See Also Fields Methods
CollapseAll image

The following tables list the members exposed by the MathHelper type.

Expand image Public Fields

 | Name | Description
Public Field | E | Represents the mathematical constant e.
Public Field | Log10E | Represents the log base ten of e.
Public Field | Log2E | Represents the log base two of e.
Public Field | Pi | Represents the value of pi.
Public Field | PiOver2 | Represents the value of pi divided by two.
Public Field | PiOver4 | Represents the value of pi divided by four.
Public Field | TwoPi | Represents the value of pi times two.

Expand image Public Methods

Name | Description
Barycentric | Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two normalized barycentric (areal) coordinates.
CatmullRom | Performs a Catmull-Rom interpolation using the specified positions.
Clamp | Restricts a value to be within a specified range.
Distance | Calculates the absolute value of the difference of two values.
Hermite | Performs a Hermite spline interpolation.
Lerp | Linearly interpolates between two values.
Max | Returns the greater of two values.
Min | Returns the lesser of two values.
SmoothStep | Interpolates between two values using a cubic equation.
ToDegrees | Converts radians to degrees.
ToRadians | Converts degrees to radians.
WrapAngle | Reduces a given angle to a value between p and -p.

Expand image See Also

Reference

MathHelper Class
Microsoft.Xna.Framework Namespace


MathHelper Fields

MathHelper Fields

Expand image Public Fields

 | Name | Description
Public Field | E | Represents the mathematical constant e.
Public Field | Log10E | Represents the log base ten of e.
Public Field | Log2E | Represents the log base two of e.
Public Field | Pi | Represents the value of pi.
Public Field | PiOver2 | Represents the value of pi divided by two.
Public Field | PiOver4 | Represents the value of pi divided by four.
Public Field | TwoPi | Represents the value of pi times two.

Expand image See Also

Reference

MathHelper Class
Microsoft.Xna.Framework Namespace


MathHelper.E Field

MathHelper.E Field

Represents the mathematical constant e.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public const float E

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.Log10E Field

MathHelper.Log10E Field

Represents the log base ten of e.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public const float Log10E

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.Log2E Field

MathHelper.Log2E Field

Represents the log base two of e.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public const float Log2E

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.Pi Field

MathHelper.Pi Field

Represents the value of pi.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public const float Pi

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.PiOver2 Field

MathHelper.PiOver2 Field

Represents the value of pi divided by two.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public const float PiOver2

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.PiOver4 Field

MathHelper.PiOver4 Field

Represents the value of pi divided by four.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public const float PiOver4

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.TwoPi Field

MathHelper.TwoPi Field

Represents the value of pi times two.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public const float TwoPi

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper Methods

MathHelper Methods

Expand image Public Methods

Name | Description
Barycentric | Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two normalized barycentric (areal) coordinates.
CatmullRom | Performs a Catmull-Rom interpolation using the specified positions.
Clamp | Restricts a value to be within a specified range.
Distance | Calculates the absolute value of the difference of two values.
Hermite | Performs a Hermite spline interpolation.
Lerp | Linearly interpolates between two values.
Max | Returns the greater of two values.
Min | Returns the lesser of two values.
SmoothStep | Interpolates between two values using a cubic equation.
ToDegrees | Converts radians to degrees.
ToRadians | Converts degrees to radians.
WrapAngle | Reduces a given angle to a value between p and -p.

Expand image See Also

Reference

MathHelper Class
Microsoft.Xna.Framework Namespace


MathHelper.Barycentric Method

MathHelper.Barycentric Method

Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two normalized barycentric (areal) coordinates.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Barycentric (
         float value1,
         float value2,
         float value3,
         float amount1,
         float amount2
)

Parameters

value1
The coordinate on one axis of vertex 1 of the defining triangle.
value2
The coordinate on the same axis of vertex 2 of the defining triangle.
value3
The coordinate on the same axis of vertex 3 of the defining triangle.
amount1
The normalized barycentric (areal) coordinate b2, equal to the weighting factor for vertex 2, the coordinate of which is specified in value2.
amount2
The normalized barycentric (areal) coordinate b3, equal to the weighting factor for vertex 3, the coordinate of which is specified in value3.

Return Value

Cartesian coordinate of the specified point with respect to the axis being used.

Expand image Remarks

About Barycentric Coordinates

Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to the location of the point, as specified in the following formulas.

    Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
    Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
    Pz = (b1 * V1z) + (b2 * V2z) + (b3 * V3z);

Such triple-weighting factors b1, b2, and b3 are called barycentric coordinates.

Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same point as b1, b2, and b3 for any positive value of k.

If a set of barycentric coordinates is normalized so that: b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3, since b1 is known to equal (1 − b2 − b3).

What MathHelper Barycentric Does

On an axis a (a being the x-, y-, or z-axis), the MathHelper.Barycentric method takes three triangle vertex coordinates on that axis (V1a, V2a, and V3a), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument, and b3 is the amount2 argument). The b2 coordinate relates to vertex V2, and the b3 coordinate relates to V3.

Barycentric then calculates the Cartesian coordinate of Pa as follows:

Pa = ( (1 - b2 - b3) * V1a ) + (b2 * V2a) + (b3 * V3a);

Thus, to calculate the x-axis Cartesian coordinate of P, you would pass the x-coordinates of the triangle vertices to Barycentric together with the approproiate areal coordinates of P.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.CatmullRom Method

MathHelper.CatmullRom Method

Performs a Catmull-Rom interpolation using the specified positions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float CatmullRom (
         float value1,
         float value2,
         float value3,
         float value4,
         float amount
)

Parameters

value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.

Return Value

A position that is the result of the Catmull-Rom interpolation.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.Clamp Method

MathHelper.Clamp Method

Restricts a value to be within a specified range.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Clamp (
         float value,
         float min,
         float max
)

Parameters

value
The value to clamp.
min
The minimum value. If value is less than min, min will be returned.
max
The maximum value. If value is greater than max, max will be returned.

Return Value

The clamped value.
  • If value > max, max will be returned.
  • If value < min, min will be returned.
  • If min = value = max, value will be returned.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Adjusting Volume (XACT)

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.Distance Method

MathHelper.Distance Method

Calculates the absolute value of the difference of two values.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Distance (
         float value1,
         float value2
)

Parameters

value1
Source value.
value2
Source value.

Return Value

Distance between the two values.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.Hermite Method

MathHelper.Hermite Method

Performs a Hermite spline interpolation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Hermite (
         float value1,
         float tangent1,
         float value2,
         float tangent2,
         float amount
)

Parameters

value1
Source position.
tangent1
Source tangent.
value2
Source position.
tangent2
Source tangent.
amount
Weighting factor.

Return Value

The result of the Hermite spline interpolation.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.Lerp Method

MathHelper.Lerp Method

Linearly interpolates between two values.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Lerp (
         float value1,
         float value2,
         float amount
)

Parameters

value1
Source value.
value2
Source value.
amount
Value between 0 and 1 indicating the weight of value2.

Return Value

Interpolated value.

Expand image Remarks

This method performs the linear interpolation based on the following formula.

value1 + (value2 - value1) * amount

Passing amount a value of 0 will cause value1 to be returned, a value of 1 will cause value2 to be returned.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.Max Method

MathHelper.Max Method

Returns the greater of two values.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Max (
         float value1,
         float value2
)

Parameters

value1
Source value.
value2
Source value.

Return Value

The greater value.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.Min Method

MathHelper.Min Method

Returns the lesser of two values.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Min (
         float value1,
         float value2
)

Parameters

value1
Source value.
value2
Source value.

Return Value

The lesser value.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.SmoothStep Method

MathHelper.SmoothStep Method

Interpolates between two values using a cubic equation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float SmoothStep (
         float value1,
         float value2,
         float amount
)

Parameters

value1
Source value.
value2
Source value.
amount
Weighting value.

Return Value

Interpolated value.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.ToDegrees Method

MathHelper.ToDegrees Method

Converts radians to degrees.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float ToDegrees (
         float radians
)

Parameters

radians
The angle in radians.

Return Value

The angle in degrees.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.ToRadians Method

MathHelper.ToRadians Method

Converts degrees to radians.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float ToRadians (
         float degrees
)

Parameters

degrees
The angle in degrees.

Return Value

The angle in radians.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MathHelper.WrapAngle Method

MathHelper.WrapAngle Method

Reduces a given angle to a value between p and -p.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float WrapAngle (
         float angle
)

Parameters

angle
The angle to reduce, in radians.

Return Value

The new angle, in radians.

Expand image See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix Structure

Matrix Structure

Defines a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.MatrixConverter)")]
[SerializableAttribute]
public struct Matrix : IEquatable<Matrix>

Expand image Remarks

Matrices use a row vector layout in the XNA Framework. Matrices can be either row vector or column vector. Row vector matrices view vectors as a row from left to right, while column vector matrices view vectors as a column from top to bottom. For example, the x, y, and z of a matrix's translation vector in the XNA Framework would correspond to the fields M41, M42, M43.

Expand image See Also

Reference

Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix Members

Matrix Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the Matrix type.

Expand image Public Constructors

 | Name | Description
Public Method | Matrix | Initializes a new instance of Matrix.

Expand image Public Fields

 | Name | Description
Public Field | M11 | Value at row 1 column 1 of the matrix.
Public Field | M12 | Value at row 1 column 2 of the matrix.
Public Field | M13 | Value at row 1 column 3 of the matrix.
Public Field | M14 | Value at row 1 column 4 of the matrix.
Public Field | M21 | Value at row 2 column 1 of the matrix.
Public Field | M22 | Value at row 2 column 2 of the matrix.
Public Field | M23 | Value at row 2 column 3 of the matrix.
Public Field | M24 | Value at row 2 column 4 of the matrix.
Public Field | M31 | Value at row 3 column 1 of the matrix.
Public Field | M32 | Value at row 3 column 2 of the matrix.
Public Field | M33 | Value at row 3 column 3 of the matrix.
Public Field | M34 | Value at row 3 column 4 of the matrix.
Public Field | M41 | Value at row 4 column 1 of the matrix.
Public Field | M42 | Value at row 4 column 2 of the matrix.
Public Field | M43 | Value at row 4 column 3 of the matrix.
Public Field | M44 | Value at row 4 column 4 of the matrix.

Expand image Public Properties

 | Name | Description
Public Property | Backward | Gets and sets the backward vector of the Matrix.
Public Property | Down | Gets and sets the down vector of the Matrix.
Public Property | Forward | Gets and sets the forward vector of the Matrix.
 | Identity | Returns an instance of the identity matrix.
Public Property | Left | Gets and sets the left vector of the Matrix.
Public Property | Right | Gets and sets the right vector of the Matrix.
Public Property | Translation | Gets and sets the translation vector of the Matrix.
Public Property | Up | Gets and sets the up vector of the Matrix.

Expand image Public Methods

 | Name | Description
 | Add | Overloaded. Adds a matrix to another matrix.
 | CreateBillboard | Overloaded. Creates a spherical billboard that rotates around a specified object position.
 | CreateConstrainedBillboard | Overloaded. Creates a cylindrical billboard that rotates around a specified axis.
 | CreateFromAxisAngle | Overloaded. Creates a new Matrix that rotates around an arbitrary vector.
 | CreateFromQuaternion | Overloaded. Creates a rotation Matrix from a Quaternion.
 | CreateFromYawPitchRoll | Overloaded. Creates a new rotation matrix from a specified yaw, pitch, and roll.
 | CreateLookAt | Overloaded. Creates a view matrix.
 | CreateOrthographic | Overloaded. Builds an orthogonal projection matrix.
 | CreateOrthographicOffCenter | Overloaded. Builds a customized, orthogonal projection matrix.
 | CreatePerspective | Overloaded. Builds a perspective projection matrix.
 | CreatePerspectiveFieldOfView | Overloaded. Builds a perspective projection matrix based on a field of view.
 | CreatePerspectiveOffCenter | Overloaded. Builds a customized, perspective projection matrix.
 | CreateReflection | Overloaded. Creates a Matrix that reflects the coordinate system about a specified Plane.
 | CreateRotationX | Overloaded. Creates a matrix that can be used to rotate a set of vertices around the x-axis.
 | CreateRotationY | Overloaded. Creates a matrix that can be used to rotate a set of vertices around the y-axis.
 | CreateRotationZ | Overloaded. Creates a matrix that can be used to rotate a set of vertices around the z-axis.
 | CreateScale | Overloaded. Creates a scaling Matrix.
 | CreateShadow | Overloaded. Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source.
 | CreateTranslation | Overloaded. Creates a translation Matrix.
 | CreateWorld | Overloaded. Creates a world matrix.
Public Method | Decompose | Extracts the scalar, translation, and rotation components from a 3D scale/rotate/translate (SRT) Matrix.
Public Method | Determinant | Calculates the determinant of the matrix.
 | Divide | Overloaded. Divides a matrix by a scalar value or the components of another matrix.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code of this object.
Public Method | GetType | (Inherited from Object.)
 | Invert | Overloaded. Calculates the inverse of a matrix.
 | Lerp | Overloaded. Linearly interpolates between the corresponding values of two matrices.
 | Multiply | Overloaded. Multiplies a matrix by a scalar value or another matrix.
 | Negate | Overloaded. Negates individual elements of a matrix.
 | op_Addition | Adds a matrix to another matrix.
 | op_Division | Overloaded. Divides a matrix by a scalar value or the components of another matrix.
 | op_Equality | Compares a matrix for equality with another matrix.
 | op_Inequality | Tests a matrix for inequality with another matrix.
 | op_Multiply | Overloaded. Multiplies a matrix by a scalar value or another matrix.
 | op_Subtraction | Subtracts matrices.
 | op_UnaryNegation | Negates individual elements of a matrix.
 | Subtract | Overloaded. Subtracts matrices.
Public Method | ToString | Retrieves a string representation of the current object.
 | Transform | Overloaded. Transforms a Matrix by applying a Quaternion rotation.
 | Transpose | Overloaded. Transposes the rows and columns of a matrix.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Matrix Structure
Microsoft.Xna.Framework Namespace


Matrix Fields

Matrix Fields

Expand image Public Fields

 | Name | Description
Public Field | M11 | Value at row 1 column 1 of the matrix.
Public Field | M12 | Value at row 1 column 2 of the matrix.
Public Field | M13 | Value at row 1 column 3 of the matrix.
Public Field | M14 | Value at row 1 column 4 of the matrix.
Public Field | M21 | Value at row 2 column 1 of the matrix.
Public Field | M22 | Value at row 2 column 2 of the matrix.
Public Field | M23 | Value at row 2 column 3 of the matrix.
Public Field | M24 | Value at row 2 column 4 of the matrix.
Public Field | M31 | Value at row 3 column 1 of the matrix.
Public Field | M32 | Value at row 3 column 2 of the matrix.
Public Field | M33 | Value at row 3 column 3 of the matrix.
Public Field | M34 | Value at row 3 column 4 of the matrix.
Public Field | M41 | Value at row 4 column 1 of the matrix.
Public Field | M42 | Value at row 4 column 2 of the matrix.
Public Field | M43 | Value at row 4 column 3 of the matrix.
Public Field | M44 | Value at row 4 column 4 of the matrix.

Expand image See Also

Reference

Matrix Structure
Microsoft.Xna.Framework Namespace


Matrix.M11 Field

Matrix.M11 Field

Value at row 1 column 1 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M11

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M12 Field

Matrix.M12 Field

Value at row 1 column 2 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M12

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M13 Field

Matrix.M13 Field

Value at row 1 column 3 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M13

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M14 Field

Matrix.M14 Field

Value at row 1 column 4 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M14

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M21 Field

Matrix.M21 Field

Value at row 2 column 1 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M21

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M22 Field

Matrix.M22 Field

Value at row 2 column 2 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M22

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M23 Field

Matrix.M23 Field

Value at row 2 column 3 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M23

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M24 Field

Matrix.M24 Field

Value at row 2 column 4 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M24

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M31 Field

Matrix.M31 Field

Value at row 3 column 1 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M31

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M32 Field

Matrix.M32 Field

Value at row 3 column 2 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M32

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M33 Field

Matrix.M33 Field

Value at row 3 column 3 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M33

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M34 Field

Matrix.M34 Field

Value at row 3 column 4 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M34

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M41 Field

Matrix.M41 Field

Value at row 4 column 1 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M41

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M42 Field

Matrix.M42 Field

Value at row 4 column 2 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M42

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M43 Field

Matrix.M43 Field

Value at row 4 column 3 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M43

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.M44 Field

Matrix.M44 Field

Value at row 4 column 4 of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float M44

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix Constructor

Matrix Constructor

Initializes a new instance of Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Matrix (
         float m11,
         float m12,
         float m13,
         float m14,
         float m21,
         float m22,
         float m23,
         float m24,
         float m31,
         float m32,
         float m33,
         float m34,
         float m41,
         float m42,
         float m43,
         float m44
)

Parameters

m11
Value to initialize m11 to.
m12
Value to initialize m12 to.
m13
Value to initialize m13 to.
m14
Value to initialize m14 to.
m21
Value to initialize m21 to.
m22
Value to initialize m22 to.
m23
Value to initialize m23 to.
m24
Value to initialize m24 to.
m31
Value to initialize m31 to.
m32
Value to initialize m32 to.
m33
Value to initialize m33 to.
m34
Value to initialize m34 to.
m41
Value to initialize m41 to.
m42
Value to initialize m42 to.
m43
Value to initialize m43 to.
m44
Value to initialize m44 to.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix Methods

Matrix Methods

Expand image Public Methods

 | Name | Description
 | Add | Overloaded. Adds a matrix to another matrix.
 | CreateBillboard | Overloaded. Creates a spherical billboard that rotates around a specified object position.
 | CreateConstrainedBillboard | Overloaded. Creates a cylindrical billboard that rotates around a specified axis.
 | CreateFromAxisAngle | Overloaded. Creates a new Matrix that rotates around an arbitrary vector.
 | CreateFromQuaternion | Overloaded. Creates a rotation Matrix from a Quaternion.
 | CreateFromYawPitchRoll | Overloaded. Creates a new rotation matrix from a specified yaw, pitch, and roll.
 | CreateLookAt | Overloaded. Creates a view matrix.
 | CreateOrthographic | Overloaded. Builds an orthogonal projection matrix.
 | CreateOrthographicOffCenter | Overloaded. Builds a customized, orthogonal projection matrix.
 | CreatePerspective | Overloaded. Builds a perspective projection matrix.
 | CreatePerspectiveFieldOfView | Overloaded. Builds a perspective projection matrix based on a field of view.
 | CreatePerspectiveOffCenter | Overloaded. Builds a customized, perspective projection matrix.
 | CreateReflection | Overloaded. Creates a Matrix that reflects the coordinate system about a specified Plane.
 | CreateRotationX | Overloaded. Creates a matrix that can be used to rotate a set of vertices around the x-axis.
 | CreateRotationY | Overloaded. Creates a matrix that can be used to rotate a set of vertices around the y-axis.
 | CreateRotationZ | Overloaded. Creates a matrix that can be used to rotate a set of vertices around the z-axis.
 | CreateScale | Overloaded. Creates a scaling Matrix.
 | CreateShadow | Overloaded. Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source.
 | CreateTranslation | Overloaded. Creates a translation Matrix.
 | CreateWorld | Overloaded. Creates a world matrix.
Public Method | Decompose | Extracts the scalar, translation, and rotation components from a 3D scale/rotate/translate (SRT) Matrix.
Public Method | Determinant | Calculates the determinant of the matrix.
 | Divide | Overloaded. Divides a matrix by a scalar value or the components of another matrix.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code of this object.
Public Method | GetType | (Inherited from Object.)
 | Invert | Overloaded. Calculates the inverse of a matrix.
 | Lerp | Overloaded. Linearly interpolates between the corresponding values of two matrices.
 | Multiply | Overloaded. Multiplies a matrix by a scalar value or another matrix.
 | Negate | Overloaded. Negates individual elements of a matrix.
 | op_Addition | Adds a matrix to another matrix.
 | op_Division | Overloaded. Divides a matrix by a scalar value or the components of another matrix.
 | op_Equality | Compares a matrix for equality with another matrix.
 | op_Inequality | Tests a matrix for inequality with another matrix.
 | op_Multiply | Overloaded. Multiplies a matrix by a scalar value or another matrix.
 | op_Subtraction | Subtracts matrices.
 | op_UnaryNegation | Negates individual elements of a matrix.
 | Subtract | Overloaded. Subtracts matrices.
Public Method | ToString | Retrieves a string representation of the current object.
 | Transform | Overloaded. Transforms a Matrix by applying a Quaternion rotation.
 | Transpose | Overloaded. Transposes the rows and columns of a matrix.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Matrix Structure
Microsoft.Xna.Framework Namespace


Matrix.Add Method

Matrix.Add Method

Adds a matrix to another matrix.

Expand image Overload List

Name | Description
Matrix.Add (Matrix, Matrix) | Adds a matrix to another matrix.
Matrix.Add (Matrix, Matrix, Matrix) | Adds a matrix to another matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.Add Method (Matrix, Matrix)

Matrix.Add Method (Matrix, Matrix)
See Also
CollapseAll image

Adds a matrix to another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Add (
         Matrix matrix1,
         Matrix matrix2
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.

Return Value

Resulting matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Add Method (Matrix, Matrix, Matrix)

Matrix.Add Method (Matrix, Matrix, Matrix)
See Also
CollapseAll image

Adds a matrix to another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Add (
         ref Matrix matrix1,
         ref Matrix matrix2,
         out Matrix result
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.
result
[OutAttribute] Resulting matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateBillboard Method

Matrix.CreateBillboard Method

Creates a spherical billboard that rotates around a specified object position.

Expand image Overload List

Name | Description
Matrix.CreateBillboard (Vector3, Vector3, Vector3, Nullable<Vector3>) | Creates a spherical billboard that rotates around a specified object position.
Matrix.CreateBillboard (Vector3, Vector3, Vector3, Nullable<Vector3>, Matrix) | Creates a spherical billboard that rotates around a specified object position.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateBillboard Method (Vector3, Vector3, Vector3, Nullable<Vector3>)

Matrix.CreateBillboard Method (Vector3, Vector3, Vector3, Nullable<Vector3>)
See Also
CollapseAll image

Creates a spherical billboard that rotates around a specified object position.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateBillboard (
         Vector3 objectPosition,
         Vector3 cameraPosition,
         Vector3 cameraUpVector,
         Nullable<Vector3> cameraForwardVector
)

Parameters

objectPosition
Position of the object the billboard will rotate around.
cameraPosition
Position of the camera.
cameraUpVector
The up vector of the camera.
cameraForwardVector
Optional forward vector of the camera.

Return Value

The created billboard matrix.

Expand image Remarks

This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, the method uses the optional camera forward vector if the positions are too close.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateBillboard Method (Vector3, Vector3, Vector3, Nullable<Vector3>, Matrix)

Matrix.CreateBillboard Method (Vector3, Vector3, Vector3, Nullable<Vector3>, Matrix)
See Also
CollapseAll image

Creates a spherical billboard that rotates around a specified object position.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateBillboard (
         ref Vector3 objectPosition,
         ref Vector3 cameraPosition,
         ref Vector3 cameraUpVector,
         Nullable<Vector3> cameraForwardVector,
         out Matrix result
)

Parameters

objectPosition
Position of the object the billboard will rotate around.
cameraPosition
Position of the camera.
cameraUpVector
The up vector of the camera.
cameraForwardVector
Optional forward vector of the camera.
result
[OutAttribute] The created billboard matrix.

Expand image Remarks

This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, the method uses the optional camera forward vector if the positions are too close.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateConstrainedBillboard Method

Matrix.CreateConstrainedBillboard Method

Creates a cylindrical billboard that rotates around a specified axis.

Expand image Overload List

Name | Description
Matrix.CreateConstrainedBillboard (Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>) | Creates a cylindrical billboard that rotates around a specified axis.
Matrix.CreateConstrainedBillboard (Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>, Matrix) | Creates a cylindrical billboard that rotates around a specified axis.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateConstrainedBillboard Method (Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>)

Matrix.CreateConstrainedBillboard Method (Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>)
See Also
CollapseAll image

Creates a cylindrical billboard that rotates around a specified axis.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateConstrainedBillboard (
         Vector3 objectPosition,
         Vector3 cameraPosition,
         Vector3 rotateAxis,
         Nullable<Vector3> cameraForwardVector,
         Nullable<Vector3> objectForwardVector
)

Parameters

objectPosition
Position of the object the billboard will rotate around.
cameraPosition
Position of the camera.
rotateAxis
Axis to rotate the billboard around.
cameraForwardVector
Optional forward vector of the camera.
objectForwardVector
Optional forward vector of the object.

Return Value

The created billboard matrix.

Expand image Remarks

This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, the method uses the optional camera forward vector if the positions are too close.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateConstrainedBillboard Method (Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>, Matrix)

Matrix.CreateConstrainedBillboard Method (Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>, Matrix)
See Also
CollapseAll image

Creates a cylindrical billboard that rotates around a specified axis.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateConstrainedBillboard (
         ref Vector3 objectPosition,
         ref Vector3 cameraPosition,
         ref Vector3 rotateAxis,
         Nullable<Vector3> cameraForwardVector,
         Nullable<Vector3> objectForwardVector,
         out Matrix result
)

Parameters

objectPosition
Position of the object the billboard will rotate around.
cameraPosition
Position of the camera.
rotateAxis
Axis to rotate the billboard around.
cameraForwardVector
Optional forward vector of the camera.
objectForwardVector
Optional forward vector of the object.
result
[OutAttribute] The created billboard matrix.

Expand image Remarks

This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, the method uses the optional camera forward vector if the positions are too close.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateFromAxisAngle Method

Matrix.CreateFromAxisAngle Method

Creates a new Matrix that rotates around an arbitrary vector.

Expand image Overload List

Name | Description
Matrix.CreateFromAxisAngle (Vector3, Single) | Creates a new Matrix that rotates around an arbitrary vector.
Matrix.CreateFromAxisAngle (Vector3, Single, Matrix) | Creates a new Matrix that rotates around an arbitrary vector.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateFromAxisAngle Method (Vector3, Single)

Matrix.CreateFromAxisAngle Method (Vector3, Single)
See Also
CollapseAll image

Creates a new Matrix that rotates around an arbitrary vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateFromAxisAngle (
         Vector3 axis,
         float angle
)

Parameters

axis
The axis to rotate around.
angle
The angle to rotate around the vector.

Return Value

The created Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateFromAxisAngle Method (Vector3, Single, Matrix)

Matrix.CreateFromAxisAngle Method (Vector3, Single, Matrix)
See Also
CollapseAll image

Creates a new Matrix that rotates around an arbitrary vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateFromAxisAngle (
         ref Vector3 axis,
         float angle,
         out Matrix result
)

Parameters

axis
The axis to rotate around.
angle
The angle to rotate around the vector.
result
[OutAttribute] The created Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateFromQuaternion Method

Matrix.CreateFromQuaternion Method

Creates a rotation Matrix from a Quaternion.

Expand image Overload List

Name | Description
Matrix.CreateFromQuaternion (Quaternion) | Creates a rotation Matrix from a Quaternion.
Matrix.CreateFromQuaternion (Quaternion, Matrix) | Creates a rotation Matrix from a Quaternion.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateFromQuaternion Method (Quaternion)

Matrix.CreateFromQuaternion Method (Quaternion)
See Also
CollapseAll image

Creates a rotation Matrix from a Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateFromQuaternion (
         Quaternion quaternion
)

Parameters

quaternion
Quaternion to create the Matrix from.

Return Value

The created Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateFromQuaternion Method (Quaternion, Matrix)

Matrix.CreateFromQuaternion Method (Quaternion, Matrix)
See Also
CollapseAll image

Creates a rotation Matrix from a Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateFromQuaternion (
         ref Quaternion quaternion,
         out Matrix result
)

Parameters

quaternion
Quaternion to create the Matrix from.
result
[OutAttribute] The created Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateFromYawPitchRoll Method

Matrix.CreateFromYawPitchRoll Method

Creates a new rotation matrix from a specified yaw, pitch, and roll.

Expand image Overload List

Name | Description
Matrix.CreateFromYawPitchRoll (Single, Single, Single) | Creates a new rotation matrix from a specified yaw, pitch, and roll.
Matrix.CreateFromYawPitchRoll (Single, Single, Single, Matrix) | Fills in a rotation matrix from a specified yaw, pitch, and roll.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateFromYawPitchRoll Method (Single, Single, Single)

Matrix.CreateFromYawPitchRoll Method (Single, Single, Single)
See Also
CollapseAll image

Creates a new rotation matrix from a specified yaw, pitch, and roll.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateFromYawPitchRoll (
         float yaw,
         float pitch,
         float roll
)

Parameters

yaw
Angle of rotation, in radians, around the y-axis.
pitch
Angle of rotation, in radians, around the x-axis.
roll
Angle of rotation, in radians, around the z-axis.

Return Value

A new rotation matrix with the specified yaw, pitch, and roll.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateFromYawPitchRoll Method (Single, Single, Single, Matrix)

Matrix.CreateFromYawPitchRoll Method (Single, Single, Single, Matrix)
See Also
CollapseAll image

Fills in a rotation matrix from a specified yaw, pitch, and roll.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateFromYawPitchRoll (
         float yaw,
         float pitch,
         float roll,
         out Matrix result
)

Parameters

yaw
Angle of rotation, in radians, around the y-axis.
pitch
Angle of rotation, in radians, around the x-axis.
roll
Angle of rotation, in radians, around the z-axis.
result
[OutAttribute] An existing matrix filled in to represent the specified yaw, pitch, and roll.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateLookAt Method

Matrix.CreateLookAt Method

Creates a view matrix.

Expand image Overload List

Name | Description
Matrix.CreateLookAt (Vector3, Vector3, Vector3) | Creates a view matrix.
Matrix.CreateLookAt (Vector3, Vector3, Vector3, Matrix) | Creates a view matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateLookAt Method (Vector3, Vector3, Vector3)

Matrix.CreateLookAt Method (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Creates a view matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateLookAt (
         Vector3 cameraPosition,
         Vector3 cameraTarget,
         Vector3 cameraUpVector
)

Parameters

cameraPosition
The position of the camera.
cameraTarget
The target towards which the camera is pointing.
cameraUpVector
The direction that is "up" from the camera's point of view.

Return Value

The created view matrix.

Expand image Remarks

View space, sometimes called camera space, is similar to world space in that it is typically used for the entire scene. However, in view space, the origin is at the viewer or camera.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateLookAt Method (Vector3, Vector3, Vector3, Matrix)

Matrix.CreateLookAt Method (Vector3, Vector3, Vector3, Matrix)
See Also
CollapseAll image

Creates a view matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateLookAt (
         ref Vector3 cameraPosition,
         ref Vector3 cameraTarget,
         ref Vector3 cameraUpVector,
         out Matrix result
)

Parameters

cameraPosition
The position of the camera.
cameraTarget
The target towards which the camera is pointing.
cameraUpVector
The direction that is "up" from the camera's point of view.
result
[OutAttribute] The created view matrix.

Expand image Remarks

View space, sometimes called camera space, is similar to world space in that it is typically used for the entire scene. However, in view space, the origin is at the viewer or camera.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateOrthographic Method

Matrix.CreateOrthographic Method

Builds an orthogonal projection matrix.

Expand image Overload List

Name | Description
Matrix.CreateOrthographic (Single, Single, Single, Single) | Builds an orthogonal projection matrix.
Matrix.CreateOrthographic (Single, Single, Single, Single, Matrix) | Builds an orthogonal projection matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateOrthographic Method (Single, Single, Single, Single)

Matrix.CreateOrthographic Method (Single, Single, Single, Single)
See Also
CollapseAll image

Builds an orthogonal projection matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateOrthographic (
         float width,
         float height,
         float zNearPlane,
         float zFarPlane
)

Parameters

width
Width of the view volume.
height
Height of the view volume.
zNearPlane
Minimum z-value of the view volume.
zFarPlane
Maximum z-value of the view volume.

Return Value

The projection matrix.

Expand image Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.

Unlike perspective projection, in orthographic projection there is no perspective foreshortening.

The viewable area of this orthographic projection is centered on 0,0,0. The x-axis of the area ranges from -width/2 to width/2. The y-axis of the area ranges from -height/2 to height/2. The z-axis of the area ranges from zNearPlane to zFarPlane. These values are relative to the position and x, y, and z-axes of the view.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateOrthographic Method (Single, Single, Single, Single, Matrix)

Matrix.CreateOrthographic Method (Single, Single, Single, Single, Matrix)
See Also
CollapseAll image

Builds an orthogonal projection matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateOrthographic (
         float width,
         float height,
         float zNearPlane,
         float zFarPlane,
         out Matrix result
)

Parameters

width
Width of the view volume.
height
Height of the view volume.
zNearPlane
Minimum z-value of the view volume.
zFarPlane
Maximum z-value of the view volume.
result
[OutAttribute] The projection matrix.

Expand image Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.

Unlike perspective projection, in orthographic projection there is no perspective foreshortening.

The viewable area of this orthographic projection is centered on 0,0,0. The x-axis of the area ranges from -width/2 to width/2. The y-axis of the area ranges from -height/2 to height/2. The z-axis of the area ranges from zNearPlane to zFarPlane. These values are relative to the position and x, y, and z-axes of the view.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateOrthographicOffCenter Method

Matrix.CreateOrthographicOffCenter Method

Builds a customized, orthogonal projection matrix.

Expand image Overload List

Name | Description
Matrix.CreateOrthographicOffCenter (Single, Single, Single, Single, Single, Single) | Builds a customized, orthogonal projection matrix.
Matrix.CreateOrthographicOffCenter (Single, Single, Single, Single, Single, Single, Matrix) | Builds a customized, orthogonal projection matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateOrthographicOffCenter Method (Single, Single, Single, Single, Single, Single)

Matrix.CreateOrthographicOffCenter Method (Single, Single, Single, Single, Single, Single)
See Also
CollapseAll image

Builds a customized, orthogonal projection matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateOrthographicOffCenter (
         float left,
         float right,
         float bottom,
         float top,
         float zNearPlane,
         float zFarPlane
)

Parameters

left
Minimum x-value of the view volume.
right
Maximum x-value of the view volume.
bottom
Minimum y-value of the view volume.
top
Maximum y-value of the view volume.
zNearPlane
Minimum z-value of the view volume.
zFarPlane
Maximum z-value of the view volume.

Return Value

The projection matrix.

Expand image Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.

Unlike perspective projection, in orthographic projection there is no perspective foreshortening.

The viewable area of this orthographic projection extends from left to right on the x-axis, bottom to top on the y-axis, and zNearPlane to zFarPlane on the z-axis. These values are relative to the position and x, y, and z-axes of the view.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateOrthographicOffCenter Method (Single, Single, Single, Single, Single, Single, Matrix)

Matrix.CreateOrthographicOffCenter Method (Single, Single, Single, Single, Single, Single, Matrix)
See Also
CollapseAll image

Builds a customized, orthogonal projection matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateOrthographicOffCenter (
         float left,
         float right,
         float bottom,
         float top,
         float zNearPlane,
         float zFarPlane,
         out Matrix result
)

Parameters

left
Minimum x-value of the view volume.
right
Maximum x-value of the view volume.
bottom
Minimum y-value of the view volume.
top
Maximum y-value of the view volume.
zNearPlane
Minimum z-value of the view volume.
zFarPlane
Maximum z-value of the view volume.
result
[OutAttribute] The projection matrix.

Expand image Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.

Unlike perspective projection, in orthographic projection there is no perspective foreshortening.

The viewable area of this orthographic projection extends from left to right on the x-axis, bottom to top on the y-axis, and zNearPlane to zFarPlane on the z-axis. These values are relative to the position and x, y, and z-axes of the view.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreatePerspective Method

Matrix.CreatePerspective Method

Builds a perspective projection matrix.

Expand image Overload List

Name | Description
Matrix.CreatePerspective (Single, Single, Single, Single) | Builds a perspective projection matrix and returns the result by value.
Matrix.CreatePerspective (Single, Single, Single, Single, Matrix) | Builds a perspective projection matrix and returns the result by reference.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreatePerspective Method (Single, Single, Single, Single)

Matrix.CreatePerspective Method (Single, Single, Single, Single)
See Also
CollapseAll image

Builds a perspective projection matrix and returns the result by value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreatePerspective (
         float width,
         float height,
         float nearPlaneDistance,
         float farPlaneDistance
)

Parameters

width
Width of the view volume at the near view plane.
height
Height of the view volume at the near view plane.
nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to the far view plane.

Return Value

The projection matrix.

Expand image Exceptions

Exception type Condition
ArgumentOutOfRangeException

One of the following conditions is true:

  • nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for nearPlaneDistance or farPlaneDistance.
  • nearPlaneDistance is larger than farPlaneDistance. nearPlaneDistance must be smaller than farPlaneDistance.

Expand image Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x- and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreatePerspective Method (Single, Single, Single, Single, Matrix)

Matrix.CreatePerspective Method (Single, Single, Single, Single, Matrix)
See Also
CollapseAll image

Builds a perspective projection matrix and returns the result by reference.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreatePerspective (
         float width,
         float height,
         float nearPlaneDistance,
         float farPlaneDistance,
         out Matrix result
)

Parameters

width
Width of the view volume at the near view plane.
height
Height of the view volume at the near view plane.
nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to the far view plane.
result
[OutAttribute] The projection matrix.

Expand image Exceptions

Exception type Condition
ArgumentOutOfRangeException

One of the following conditions is true:

  • nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for nearPlaneDistance or farPlaneDistance.
  • nearPlaneDistance is larger than farPlaneDistance. nearPlaneDistance must be smaller than farPlaneDistance.

Expand image Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x- and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreatePerspectiveFieldOfView Method

Matrix.CreatePerspectiveFieldOfView Method

Builds a perspective projection matrix based on a field of view.

Expand image Overload List

Name | Description
Matrix.CreatePerspectiveFieldOfView (Single, Single, Single, Single) | Builds a perspective projection matrix based on a field of view and returns by value.
Matrix.CreatePerspectiveFieldOfView (Single, Single, Single, Single, Matrix) | Builds a perspective projection matrix based on a field of view and returns by reference.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreatePerspectiveFieldOfView Method (Single, Single, Single, Single)

Matrix.CreatePerspectiveFieldOfView Method (Single, Single, Single, Single)
See Also
CollapseAll image

Builds a perspective projection matrix based on a field of view and returns by value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreatePerspectiveFieldOfView (
         float fieldOfView,
         float aspectRatio,
         float nearPlaneDistance,
         float farPlaneDistance
)

Parameters

fieldOfView
Field of view in the y direction, in radians.
aspectRatio

Aspect ratio, defined as view space width divided by height.

To match the aspect ratio of the viewport, the property AspectRatio.

nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to the far view plane.

Return Value

The perspective projection matrix.

Expand image Exceptions

Exception type Condition
ArgumentOutOfRangeException

One of the following conditions is true:

  • fieldOfView is not between 0 and pi (180 degrees). Note that fieldOfView should be specified in radians.
  • nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for nearPlaneDistance or farPlaneDistance.
  • nearPlaneDistance is larger than farPlaneDistance. nearPlaneDistance must be smaller than farPlaneDistance.

Expand image Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x- and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreatePerspectiveFieldOfView Method (Single, Single, Single, Single, Matrix)

Matrix.CreatePerspectiveFieldOfView Method (Single, Single, Single, Single, Matrix)
See Also
CollapseAll image

Builds a perspective projection matrix based on a field of view and returns by reference.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreatePerspectiveFieldOfView (
         float fieldOfView,
         float aspectRatio,
         float nearPlaneDistance,
         float farPlaneDistance,
         out Matrix result
)

Parameters

fieldOfView
Field of view in the y direction, in radians.
aspectRatio

Aspect ratio, defined as view space width divided by height.

To match the aspect ratio of the viewport, the property AspectRatio.

nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to the far view plane.
result
[OutAttribute] The perspective projection matrix.

Expand image Exceptions

Exception type Condition
ArgumentOutOfRangeException

One of the following conditions is true:

  • fieldOfView is not between 0 and pi (180 degrees). Note that fieldOfView should be specified in radians.
  • nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for nearPlaneDistance or farPlaneDistance.
  • nearPlaneDistance is larger than farPlaneDistance. nearPlaneDistance must be smaller than farPlaneDistance.

Expand image Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x- and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreatePerspectiveOffCenter Method

Matrix.CreatePerspectiveOffCenter Method

Builds a customized, perspective projection matrix.

Expand image Overload List

Name | Description
Matrix.CreatePerspectiveOffCenter (Single, Single, Single, Single, Single, Single) | Builds a customized, perspective projection matrix.
Matrix.CreatePerspectiveOffCenter (Single, Single, Single, Single, Single, Single, Matrix) | Builds a customized, perspective projection matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreatePerspectiveOffCenter Method (Single, Single, Single, Single, Single, Single)

Matrix.CreatePerspectiveOffCenter Method (Single, Single, Single, Single, Single, Single)
See Also
CollapseAll image

Builds a customized, perspective projection matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreatePerspectiveOffCenter (
         float left,
         float right,
         float bottom,
         float top,
         float nearPlaneDistance,
         float farPlaneDistance
)

Parameters

left
Minimum x-value of the view volume at the near view plane.
right
Maximum x-value of the view volume at the near view plane.
bottom
Minimum y-value of the view volume at the near view plane.
top
Maximum y-value of the view volume at the near view plane.
nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to of the far view plane.

Return Value

The created projection matrix.

Expand image Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Expand image Exceptions

Exception type Condition
ArgumentOutOfRangeException

One of the following conditions is true:

  • nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for nearPlaneDistance or farPlaneDistance.
  • nearPlaneDistance larger than farPlaneDistance. nearPlaneDistance must be smaller than farPlaneDistance.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreatePerspectiveOffCenter Method (Single, Single, Single, Single, Single, Single, Matrix)

Matrix.CreatePerspectiveOffCenter Method (Single, Single, Single, Single, Single, Single, Matrix)
See Also
CollapseAll image

Builds a customized, perspective projection matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreatePerspectiveOffCenter (
         float left,
         float right,
         float bottom,
         float top,
         float nearPlaneDistance,
         float farPlaneDistance,
         out Matrix result
)

Parameters

left
Minimum x-value of the view volume at the near view plane.
right
Maximum x-value of the view volume at the near view plane.
bottom
Minimum y-value of the view volume at the near view plane.
top
Maximum y-value of the view volume at the near view plane.
nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to of the far view plane.
result
[OutAttribute] The created projection matrix.

Expand image Exceptions

Exception type Condition
ArgumentOutOfRangeException

One of the following conditions is true:

  • nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for nearPlaneDistance or farPlaneDistance.
  • nearPlaneDistance larger than farPlaneDistance. nearPlaneDistance must be smaller than farPlaneDistance.

Expand image Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateReflection Method

Matrix.CreateReflection Method

Creates a Matrix that reflects the coordinate system about a specified Plane.

Expand image Overload List

Name | Description
Matrix.CreateReflection (Plane) | Creates a Matrix that reflects the coordinate system about a specified Plane.
Matrix.CreateReflection (Plane, Matrix) | Fills in an existing Matrix so that it reflects the coordinate system about a specified Plane.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateReflection Method (Plane)

Matrix.CreateReflection Method (Plane)
See Also
CollapseAll image

Creates a Matrix that reflects the coordinate system about a specified Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateReflection (
         Plane value
)

Parameters

value
The Plane about which to create a reflection.

Return Value

A new Matrix expressing the reflection.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateReflection Method (Plane, Matrix)

Matrix.CreateReflection Method (Plane, Matrix)
See Also
CollapseAll image

Fills in an existing Matrix so that it reflects the coordinate system about a specified Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateReflection (
         ref Plane value,
         out Matrix result
)

Parameters

value
The Plane about which to create a reflection.
result
[OutAttribute] A Matrix that creates the reflection.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateRotationX Method

Matrix.CreateRotationX Method

Creates a matrix that can be used to rotate a set of vertices around the x-axis.

Expand image Overload List

Name | Description
Matrix.CreateRotationX (Single) | Returns a matrix that can be used to rotate a set of vertices around the x-axis.
Matrix.CreateRotationX (Single, Matrix) | Populates data into a user-specified matrix that can be used to rotate a set of vertices around the x-axis.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateRotationX Method (Single)

Matrix.CreateRotationX Method (Single)
See Also
CollapseAll image

Returns a matrix that can be used to rotate a set of vertices around the x-axis.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateRotationX (
         float radians
)

Parameters

radians
The amount, in radians, in which to rotate around the x-axis. Note that you can use ToRadians to convert degrees to radians.

Return Value

The rotation matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateRotationX Method (Single, Matrix)

Matrix.CreateRotationX Method (Single, Matrix)
See Also
CollapseAll image

Populates data into a user-specified matrix that can be used to rotate a set of vertices around the x-axis.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateRotationX (
         float radians,
         out Matrix result
)

Parameters

radians
The amount, in radians, in which to rotate around the x-axis. Note that you can use ToRadians to convert degrees to radians.
result
[OutAttribute] The matrix in which to place the calculated data.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateRotationY Method

Matrix.CreateRotationY Method

Creates a matrix that can be used to rotate a set of vertices around the y-axis.

Expand image Overload List

Name | Description
Matrix.CreateRotationY (Single) | Returns a matrix that can be used to rotate a set of vertices around the y-axis.
Matrix.CreateRotationY (Single, Matrix) | Populates data into a user-specified matrix that can be used to rotate a set of vertices around the y-axis.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateRotationY Method (Single)

Matrix.CreateRotationY Method (Single)
See Also
CollapseAll image

Returns a matrix that can be used to rotate a set of vertices around the y-axis.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateRotationY (
         float radians
)

Parameters

radians
The amount, in radians, in which to rotate around the y-axis. Note that you can use ToRadians to convert degrees to radians.

Return Value

The rotation matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateRotationY Method (Single, Matrix)

Matrix.CreateRotationY Method (Single, Matrix)
See Also
CollapseAll image

Populates data into a user-specified matrix that can be used to rotate a set of vertices around the y-axis.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateRotationY (
         float radians,
         out Matrix result
)

Parameters

radians
The amount, in radians, in which to rotate around the y-axis. Note that you can use ToRadians to convert degrees to radians.
result
[OutAttribute] The matrix in which to place the calculated data.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateRotationZ Method

Matrix.CreateRotationZ Method

Creates a matrix that can be used to rotate a set of vertices around the z-axis.

Expand image Overload List

Name | Description
Matrix.CreateRotationZ (Single) | Returns a matrix that can be used to rotate a set of vertices around the z-axis.
Matrix.CreateRotationZ (Single, Matrix) | Populates data into a user-specified matrix that can be used to rotate a set of vertices around the z-axis.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateRotationZ Method (Single)

Matrix.CreateRotationZ Method (Single)
See Also
CollapseAll image

Returns a matrix that can be used to rotate a set of vertices around the z-axis.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateRotationZ (
         float radians
)

Parameters

radians
The amount, in radians, in which to rotate around the z-axis. Note that you can use ToRadians to convert degrees to radians.

Return Value

The rotation matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateRotationZ Method (Single, Matrix)

Matrix.CreateRotationZ Method (Single, Matrix)
See Also
CollapseAll image

Populates data into a user-specified matrix that can be used to rotate a set of vertices around the z-axis.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateRotationZ (
         float radians,
         out Matrix result
)

Parameters

radians
The amount, in radians, in which to rotate around the z-axis. Note that you can use ToRadians to convert degrees to radians.
result
[OutAttribute] The rotation matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateScale Method

Matrix.CreateScale Method

Creates a scaling Matrix.

Expand image Overload List

Name | Description
Matrix.CreateScale (Single) | Creates a scaling Matrix.
Matrix.CreateScale (Single, Matrix) | Creates a scaling Matrix.
Matrix.CreateScale (Single, Single, Single) | Creates a scaling Matrix.
Matrix.CreateScale (Single, Single, Single, Matrix) | Creates a scaling Matrix.
Matrix.CreateScale (Vector3) | Creates a scaling Matrix.
Matrix.CreateScale (Vector3, Matrix) | Creates a scaling Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateScale Method (Single)

Matrix.CreateScale Method (Single)
See Also
CollapseAll image

Creates a scaling Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateScale (
         float scale
)

Parameters

scale
Amount to scale by.

Return Value

The created scaling Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateScale Method (Single, Matrix)

Matrix.CreateScale Method (Single, Matrix)
See Also
CollapseAll image

Creates a scaling Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateScale (
         float scale,
         out Matrix result
)

Parameters

scale
Value to scale by.
result
[OutAttribute] The created scaling Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateScale Method (Single, Single, Single)

Matrix.CreateScale Method (Single, Single, Single)
See Also
CollapseAll image

Creates a scaling Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateScale (
         float xScale,
         float yScale,
         float zScale
)

Parameters

xScale
Value to scale by on the x-axis.
yScale
Value to scale by on the y-axis.
zScale
Value to scale by on the z-axis.

Return Value

The created scaling Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateScale Method (Single, Single, Single, Matrix)

Matrix.CreateScale Method (Single, Single, Single, Matrix)
See Also
CollapseAll image

Creates a scaling Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateScale (
         float xScale,
         float yScale,
         float zScale,
         out Matrix result
)

Parameters

xScale
Value to scale by on the x-axis.
yScale
Value to scale by on the y-axis.
zScale
Value to scale by on the z-axis.
result
[OutAttribute] The created scaling Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateScale Method (Vector3)

Matrix.CreateScale Method (Vector3)
See Also
CollapseAll image

Creates a scaling Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateScale (
         Vector3 scales
)

Parameters

scales
Amounts to scale by on the x, y, and z axes.

Return Value

The created scaling Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateScale Method (Vector3, Matrix)

Matrix.CreateScale Method (Vector3, Matrix)
See Also
CollapseAll image

Creates a scaling Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateScale (
         ref Vector3 scales,
         out Matrix result
)

Parameters

scales
Amounts to scale by on the x, y, and z axes.
result
[OutAttribute] The created scaling Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateShadow Method

Matrix.CreateShadow Method

Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source.

Expand image Overload List

Name | Description
Matrix.CreateShadow (Vector3, Plane) | Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source.
Matrix.CreateShadow (Vector3, Plane, Matrix) | Fills in a Matrix to flatten geometry into a specified Plane as if casting a shadow from a specified light source.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateShadow Method (Vector3, Plane)

Matrix.CreateShadow Method (Vector3, Plane)
See Also
CollapseAll image

Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateShadow (
         Vector3 lightDirection,
         Plane plane
)

Parameters

lightDirection
A Vector3 specifying the direction from which the light that will cast the shadow is coming.
plane
The Plane onto which the new matrix should flatten geometry so as to cast a shadow.

Return Value

A new Matrix that can be used to flatten geometry onto the specified plane from the specified direction.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateShadow Method (Vector3, Plane, Matrix)

Matrix.CreateShadow Method (Vector3, Plane, Matrix)
See Also
CollapseAll image

Fills in a Matrix to flatten geometry into a specified Plane as if casting a shadow from a specified light source.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateShadow (
         ref Vector3 lightDirection,
         ref Plane plane,
         out Matrix result
)

Parameters

lightDirection
A Vector3 specifying the direction from which the light that will cast the shadow is coming.
plane
The Plane onto which the new matrix should flatten geometry so as to cast a shadow.
result
[OutAttribute] A Matrix that can be used to flatten geometry onto the specified plane from the specified direction.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateTranslation Method

Matrix.CreateTranslation Method

Creates a translation Matrix.

Expand image Overload List

Name | Description
Matrix.CreateTranslation (Single, Single, Single) | Creates a translation Matrix.
Matrix.CreateTranslation (Single, Single, Single, Matrix) | Creates a translation Matrix.
Matrix.CreateTranslation (Vector3) | Creates a translation Matrix.
Matrix.CreateTranslation (Vector3, Matrix) | Creates a translation Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateTranslation Method (Single, Single, Single)

Matrix.CreateTranslation Method (Single, Single, Single)
See Also
CollapseAll image

Creates a translation Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateTranslation (
         float xPosition,
         float yPosition,
         float zPosition
)

Parameters

xPosition
Value to translate by on the x-axis.
yPosition
Value to translate by on the y-axis.
zPosition
Value to translate by on the z-axis.

Return Value

The created translation Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateTranslation Method (Single, Single, Single, Matrix)

Matrix.CreateTranslation Method (Single, Single, Single, Matrix)
See Also
CollapseAll image

Creates a translation Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateTranslation (
         float xPosition,
         float yPosition,
         float zPosition,
         out Matrix result
)

Parameters

xPosition
Value to translate by on the x-axis.
yPosition
Value to translate by on the y-axis.
zPosition
Value to translate by on the z-axis.
result
[OutAttribute] The created translation Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateTranslation Method (Vector3)

Matrix.CreateTranslation Method (Vector3)
See Also
CollapseAll image

Creates a translation Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateTranslation (
         Vector3 position
)

Parameters

position
Amounts to translate by on the x, y, and z axes.

Return Value

The created translation Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateTranslation Method (Vector3, Matrix)

Matrix.CreateTranslation Method (Vector3, Matrix)
See Also
CollapseAll image

Creates a translation Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateTranslation (
         ref Vector3 position,
         out Matrix result
)

Parameters

position
Amounts to translate by on the x, y, and z axes.
result
[OutAttribute] The created translation Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateWorld Method

Matrix.CreateWorld Method

Creates a world matrix.

Expand image Overload List

Name | Description
Matrix.CreateWorld (Vector3, Vector3, Vector3) | Creates a world matrix with the specified parameters.
Matrix.CreateWorld (Vector3, Vector3, Vector3, Matrix) | Creates a world matrix with the specified parameters.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.CreateWorld Method (Vector3, Vector3, Vector3)

Matrix.CreateWorld Method (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Creates a world matrix with the specified parameters.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix CreateWorld (
         Vector3 position,
         Vector3 forward,
         Vector3 up
)

Parameters

position
Position of the object. This value is used in translation operations.
forward
Forward direction of the object.
up
Upward direction of the object; usually [0, 1, 0].

Return Value

The created world matrix.

Expand image Remarks

This matrix includes rotation and translation, but not scaling.

Expand image See Also

Reference

Matrix Structure
CreateScale
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.CreateWorld Method (Vector3, Vector3, Vector3, Matrix)

Matrix.CreateWorld Method (Vector3, Vector3, Vector3, Matrix)
See Also
CollapseAll image

Creates a world matrix with the specified parameters.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateWorld (
         ref Vector3 position,
         ref Vector3 forward,
         ref Vector3 up,
         out Matrix result
)

Parameters

position
Position of the object. This value is used in translation operations.
forward
Forward direction of the object.
up
Upward direction of the object; usually [0, 1, 0].
result
[OutAttribute] The created world matrix.

Expand image Remarks

This matrix includes rotation and translation, but not scaling.

Expand image See Also

Reference

Matrix Structure
CreateScale
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Decompose Method

Matrix.Decompose Method
See Also Example
CollapseAll image

Extracts the scalar, translation, and rotation components from a 3D scale/rotate/translate (SRT) Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Decompose (
         out Vector3 scale,
         out Quaternion rotation,
         out Vector3 translation
)

Parameters

scale
[OutAttribute] The scalar component of the transform matrix, expressed as a Vector3.
rotation
[OutAttribute] The rotation component of the transform matrix, expressed as a Quaternion.
translation
[OutAttribute] The translation component of the transform matrix, expressed as a Vector3.

Return Value

true if the Matrix can be decomposed; false otherwise.

Expand image Example

The following example illustrates how to recompose the matrix from the extracted components.
      Matrix m = Matrix.CreateScale(scale) *
                 Matrix.CreateFromQuaternion(rotation) *
                 Matrix.CreateTranslation(translation);

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Determinant Method

Matrix.Determinant Method

Calculates the determinant of the matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Determinant ()

Return Value

The determinant of the matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Divide Method

Matrix.Divide Method

Divides a matrix by a scalar value or the components of another matrix.

Expand image Overload List

Name | Description
Matrix.Divide (Matrix, Matrix) | Divides the components of a matrix by the corresponding components of another matrix.
Matrix.Divide (Matrix, Matrix, Matrix) | Divides the components of a matrix by the corresponding components of another matrix.
Matrix.Divide (Matrix, Single) | Divides the components of a matrix by a scalar.
Matrix.Divide (Matrix, Single, Matrix) | Divides the components of a matrix by a scalar.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.Divide Method (Matrix, Matrix)

Matrix.Divide Method (Matrix, Matrix)
See Also
CollapseAll image

Divides the components of a matrix by the corresponding components of another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Divide (
         Matrix matrix1,
         Matrix matrix2
)

Parameters

matrix1
Source matrix.
matrix2
The divisor.

Return Value

Result of the division.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Divide Method (Matrix, Matrix, Matrix)

Matrix.Divide Method (Matrix, Matrix, Matrix)
See Also
CollapseAll image

Divides the components of a matrix by the corresponding components of another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Divide (
         ref Matrix matrix1,
         ref Matrix matrix2,
         out Matrix result
)

Parameters

matrix1
Source matrix.
matrix2
The divisor.
result
[OutAttribute] Result of the division.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Divide Method (Matrix, Single)

Matrix.Divide Method (Matrix, Single)
See Also
CollapseAll image

Divides the components of a matrix by a scalar.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Divide (
         Matrix matrix1,
         float divider
)

Parameters

matrix1
Source matrix.
divider
The divisor.

Return Value

Resulting matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Divide Method (Matrix, Single, Matrix)

Matrix.Divide Method (Matrix, Single, Matrix)
See Also
CollapseAll image

Divides the components of a matrix by a scalar.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Divide (
         ref Matrix matrix1,
         float divider,
         out Matrix result
)

Parameters

matrix1
Source matrix.
divider
The divisor.
result
[OutAttribute] Result of the division.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Equals Method

Matrix.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Matrix.Equals (Matrix) | Determines whether the specified Object is equal to the Matrix.
Matrix.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.Equals Method (Matrix)

Matrix.Equals Method (Matrix)
See Also
CollapseAll image

Determines whether the specified Object is equal to the Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Matrix other
)

Parameters

other
The Object to compare with the current Matrix.

Return Value

true if the specified Object is equal to the current Matrix; false otherwise.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Equals Method (Object)

Matrix.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.GetHashCode Method

Matrix.GetHashCode Method

Gets the hash code of this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code of this object.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Invert Method

Matrix.Invert Method

Calculates the inverse of a matrix.

Expand image Overload List

Name | Description
Matrix.Invert (Matrix) | Calculates the inverse of a matrix.
Matrix.Invert (Matrix, Matrix) | Calculates the inverse of a matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.Invert Method (Matrix)

Matrix.Invert Method (Matrix)
See Also
CollapseAll image

Calculates the inverse of a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Invert (
         Matrix matrix
)

Parameters

matrix
Source matrix.

Return Value

The inverse of the matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Invert Method (Matrix, Matrix)

Matrix.Invert Method (Matrix, Matrix)
See Also
CollapseAll image

Calculates the inverse of a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Invert (
         ref Matrix matrix,
         out Matrix result
)

Parameters

matrix
The source matrix.
result
[OutAttribute] The inverse of matrix. The same matrix can be used for both arguments.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Lerp Method

Matrix.Lerp Method

Linearly interpolates between the corresponding values of two matrices.

Expand image Overload List

Name | Description
Matrix.Lerp (Matrix, Matrix, Single) | Linearly interpolates between the corresponding values of two matrices.
Matrix.Lerp (Matrix, Matrix, Single, Matrix) | Linearly interpolates between the corresponding values of two matrices.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.Lerp Method (Matrix, Matrix, Single)

Matrix.Lerp Method (Matrix, Matrix, Single)
See Also
CollapseAll image

Linearly interpolates between the corresponding values of two matrices.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Lerp (
         Matrix matrix1,
         Matrix matrix2,
         float amount
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.
amount
Interpolation value.

Return Value

Resulting matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Lerp Method (Matrix, Matrix, Single, Matrix)

Matrix.Lerp Method (Matrix, Matrix, Single, Matrix)
See Also
CollapseAll image

Linearly interpolates between the corresponding values of two matrices.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Lerp (
         ref Matrix matrix1,
         ref Matrix matrix2,
         float amount,
         out Matrix result
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.
amount
Interpolation value.
result
[OutAttribute] Resulting matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Multiply Method

Matrix.Multiply Method

Multiplies a matrix by a scalar value or another matrix.

Expand image Overload List

Name | Description
Matrix.Multiply (Matrix, Matrix) | Multiplies a matrix by another matrix.
Matrix.Multiply (Matrix, Matrix, Matrix) | Multiplies a matrix by another matrix.
Matrix.Multiply (Matrix, Single) | Multiplies a matrix by a scalar value.
Matrix.Multiply (Matrix, Single, Matrix) | Multiplies a matrix by a scalar value.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.Multiply Method (Matrix, Matrix)

Matrix.Multiply Method (Matrix, Matrix)
See Also
CollapseAll image

Multiplies a matrix by another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Multiply (
         Matrix matrix1,
         Matrix matrix2
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Multiply Method (Matrix, Matrix, Matrix)

Matrix.Multiply Method (Matrix, Matrix, Matrix)
See Also
CollapseAll image

Multiplies a matrix by another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Multiply (
         ref Matrix matrix1,
         ref Matrix matrix2,
         out Matrix result
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.
result
[OutAttribute] Result of the multiplication.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Multiply Method (Matrix, Single)

Matrix.Multiply Method (Matrix, Single)
See Also
CollapseAll image

Multiplies a matrix by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Multiply (
         Matrix matrix1,
         float scaleFactor
)

Parameters

matrix1
Source matrix.
scaleFactor
Scalar value.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Multiply Method (Matrix, Single, Matrix)

Matrix.Multiply Method (Matrix, Single, Matrix)
See Also
CollapseAll image

Multiplies a matrix by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Multiply (
         ref Matrix matrix1,
         float scaleFactor,
         out Matrix result
)

Parameters

matrix1
Source matrix.
scaleFactor
Scalar value.
result
[OutAttribute] The result of the multiplication.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Negate Method

Matrix.Negate Method

Negates individual elements of a matrix.

Expand image Overload List

Name | Description
Matrix.Negate (Matrix) | Negates individual elements of a matrix.
Matrix.Negate (Matrix, Matrix) | Negates individual elements of a matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.Negate Method (Matrix)

Matrix.Negate Method (Matrix)
See Also
CollapseAll image

Negates individual elements of a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Negate (
         Matrix matrix
)

Parameters

matrix
Source matrix.

Return Value

Negated matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Negate Method (Matrix, Matrix)

Matrix.Negate Method (Matrix, Matrix)
See Also
CollapseAll image

Negates individual elements of a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Negate (
         ref Matrix matrix,
         out Matrix result
)

Parameters

matrix
Source matrix.
result
[OutAttribute] Negated matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.op_Addition Method

Matrix.op_Addition Method

Adds a matrix to another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix op_Addition (
         Matrix matrix1,
         Matrix matrix2
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.

Return Value

Resulting matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.op_Division Method

Matrix.op_Division Method

Divides a matrix by a scalar value or the components of another matrix.

Expand image Overload List

Name | Description
Matrix.op_Division (Matrix, Matrix) | Divides the components of a matrix by the corresponding components of another matrix.
Matrix.op_Division (Matrix, Single) | Divides the components of a matrix by a scalar.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.op_Division Method (Matrix, Matrix)

Matrix.op_Division Method (Matrix, Matrix)
See Also
CollapseAll image

Divides the components of a matrix by the corresponding components of another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix op_Division (
         Matrix matrix1,
         Matrix matrix2
)

Parameters

matrix1
Source matrix.
matrix2
The divisor.

Return Value

Resulting matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.op_Division Method (Matrix, Single)

Matrix.op_Division Method (Matrix, Single)
See Also
CollapseAll image

Divides the components of a matrix by a scalar.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix op_Division (
         Matrix matrix1,
         float divider
)

Parameters

matrix1
Source matrix.
divider
The divisor.

Return Value

The result of the division.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.op_Equality Method

Matrix.op_Equality Method

Compares a matrix for equality with another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Matrix matrix1,
         Matrix matrix2
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.

Return Value

true if the matrices are equal; false otherwise.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.op_Inequality Method

Matrix.op_Inequality Method

Tests a matrix for inequality with another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Matrix matrix1,
         Matrix matrix2
)

Parameters

matrix1
The matrix on the left of the equal sign.
matrix2
The matrix on the right of the equal sign.

Return Value

true if the matrices are not equal; false otherwise.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.op_Multiply Method

Matrix.op_Multiply Method

Multiplies a matrix by a scalar value or another matrix.

Expand image Overload List

Name | Description
Matrix.op_Multiply (Matrix, Matrix) | Multiplies a matrix by another matrix.
Matrix.op_Multiply (Matrix, Single) | Multiplies a matrix by a scalar value.
Matrix.op_Multiply (Single, Matrix) | Multiplies a matrix by a scalar value.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.op_Multiply Method (Matrix, Matrix)

Matrix.op_Multiply Method (Matrix, Matrix)
See Also
CollapseAll image

Multiplies a matrix by another matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix op_Multiply (
         Matrix matrix1,
         Matrix matrix2
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.op_Multiply Method (Matrix, Single)

Matrix.op_Multiply Method (Matrix, Single)
See Also
CollapseAll image

Multiplies a matrix by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix op_Multiply (
         Matrix matrix,
         float scaleFactor
)

Parameters

matrix
Source matrix.
scaleFactor
Scalar value.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.op_Multiply Method (Single, Matrix)

Matrix.op_Multiply Method (Single, Matrix)
See Also
CollapseAll image

Multiplies a matrix by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix op_Multiply (
         float scaleFactor,
         Matrix matrix
)

Parameters

scaleFactor
Scalar value.
matrix
Source matrix.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.op_Subtraction Method

Matrix.op_Subtraction Method

Subtracts matrices.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix op_Subtraction (
         Matrix matrix1,
         Matrix matrix2
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.

Return Value

Result of the subtraction.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.op_UnaryNegation Method

Matrix.op_UnaryNegation Method

Negates individual elements of a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix op_UnaryNegation (
         Matrix matrix1
)

Parameters

matrix1
Source matrix.

Return Value

Negated matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Subtract Method

Matrix.Subtract Method

Subtracts matrices.

Expand image Overload List

Name | Description
Matrix.Subtract (Matrix, Matrix) | Subtracts matrices.
Matrix.Subtract (Matrix, Matrix, Matrix) | Subtracts matrices.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.Subtract Method (Matrix, Matrix)

Matrix.Subtract Method (Matrix, Matrix)
See Also
CollapseAll image

Subtracts matrices.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Subtract (
         Matrix matrix1,
         Matrix matrix2
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.

Return Value

Result of the subtraction.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Subtract Method (Matrix, Matrix, Matrix)

Matrix.Subtract Method (Matrix, Matrix, Matrix)
See Also
CollapseAll image

Subtracts matrices.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Subtract (
         ref Matrix matrix1,
         ref Matrix matrix2,
         out Matrix result
)

Parameters

matrix1
Source matrix.
matrix2
Source matrix.
result
[OutAttribute] Result of the subtraction.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.ToString Method

Matrix.ToString Method

Retrieves a string representation of the current object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Transform Method

Matrix.Transform Method

Transforms a Matrix by applying a Quaternion rotation.

Expand image Overload List

Name | Description
Matrix.Transform (Matrix, Quaternion) | Transforms a Matrix by applying a Quaternion rotation.
Matrix.Transform (Matrix, Quaternion, Matrix) | Transforms a Matrix by applying a Quaternion rotation.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.Transform Method (Matrix, Quaternion)

Matrix.Transform Method (Matrix, Quaternion)
See Also
CollapseAll image

Transforms a Matrix by applying a Quaternion rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Transform (
         Matrix value,
         Quaternion rotation
)

Parameters

value
The Matrix to transform.
rotation
The rotation to apply, expressed as a Quaternion.

Return Value

A new Matrix that is the result of the transform.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Transform Method (Matrix, Quaternion, Matrix)

Matrix.Transform Method (Matrix, Quaternion, Matrix)
See Also
CollapseAll image

Transforms a Matrix by applying a Quaternion rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Matrix value,
         ref Quaternion rotation,
         out Matrix result
)

Parameters

value
The Matrix to transform.
rotation
The rotation to apply, expressed as a Quaternion.
result
[OutAttribute] An existing Matrix filled in with the result of the transform.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Transpose Method

Matrix.Transpose Method

Transposes the rows and columns of a matrix.

Expand image Overload List

Name | Description
Matrix.Transpose (Matrix) | Transposes the rows and columns of a matrix.
Matrix.Transpose (Matrix, Matrix) | Transposes the rows and columns of a matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace


Matrix.Transpose Method (Matrix)

Matrix.Transpose Method (Matrix)
See Also
CollapseAll image

Transposes the rows and columns of a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Transpose (
         Matrix matrix
)

Parameters

matrix
Source matrix.

Return Value

Transposed matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Transpose Method (Matrix, Matrix)

Matrix.Transpose Method (Matrix, Matrix)
See Also
CollapseAll image

Transposes the rows and columns of a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transpose (
         ref Matrix matrix,
         out Matrix result
)

Parameters

matrix
Source matrix.
result
[OutAttribute] Transposed matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix Properties

Matrix Properties

Expand image Public Properties

 | Name | Description
Public Property | Backward | Gets and sets the backward vector of the Matrix.
Public Property | Down | Gets and sets the down vector of the Matrix.
Public Property | Forward | Gets and sets the forward vector of the Matrix.
 | Identity | Returns an instance of the identity matrix.
Public Property | Left | Gets and sets the left vector of the Matrix.
Public Property | Right | Gets and sets the right vector of the Matrix.
Public Property | Translation | Gets and sets the translation vector of the Matrix.
Public Property | Up | Gets and sets the up vector of the Matrix.

Expand image See Also

Reference

Matrix Structure
Microsoft.Xna.Framework Namespace


Matrix.Backward Property

Matrix.Backward Property

Gets and sets the backward vector of the Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Backward { get; set; }

Property Value

The backward vector of the Matrix.

The default value is composed of the current values for the matrix elements in the third row: M31, M32, and M33.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Down Property

Matrix.Down Property

Gets and sets the down vector of the Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Down { get; set; }

Property Value

The down vector of the Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Forward Property

Matrix.Forward Property

Gets and sets the forward vector of the Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Forward { get; set; }

Property Value

The forward vector of the Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Identity Property

Matrix.Identity Property

Returns an instance of the identity matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Matrix Identity { get; }

Property Value

The identity matrix.

Expand image Remarks

Except for the main diagonal, whose elements are all ones, the identity matrix is a square matrix composed of zeros. Unlike all other matrix multiplications, the multiplication between an identity matrix and another matrix is commutative.

This is useful for initializing a matrix to a known value before you perform additional operations, such as a transformation.

Note
Multiplying a matrix with its inverse results in an identity matrix.

Expand image See Also

Reference

Invert
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Left Property

Matrix.Left Property

Gets and sets the left vector of the Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Left { get; set; }

Property Value

The left vector of the Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Right Property

Matrix.Right Property

Gets and sets the right vector of the Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Right { get; set; }

Property Value

The right vector of the Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Translation Property

Matrix.Translation Property

Gets and sets the translation vector of the Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Translation { get; set; }

Property Value

The translation vector of the Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Matrix.Up Property

Matrix.Up Property

Gets and sets the up vector of the Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Up { get; set; }

Property Value

The up vector of the Matrix.

Expand image See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane Structure

Plane Structure

Defines a plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.PlaneConverter)")]
[SerializableAttribute]
public struct Plane : IEquatable<Plane>

Expand image Remarks

The Plane structure represents a plane using a 3D vector normal and a distance value (stored as a negative value), as the following figure shows.

Expand image See Also

Reference

Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane Members

Plane Members
See Also Constructors Fields Methods
CollapseAll image

The following tables list the members exposed by the Plane type.

Expand image Public Constructors

 | Name | Description
Public Method | Plane | Overloaded. Creates an instance of Plane.

Expand image Public Fields

 | Name | Description
Public Field | D | The distance of the Plane along its normal from the origin.
Public Field | Normal | The normal vector of the Plane.

Expand image Public Methods

Name | Description
Public Method | Dot | Overloaded. Calculates the dot product of a specified Vector4 and this Plane.
Public Method DotCoordinate Overloaded. Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the D constant value of the
Plane
.
Public Method | DotNormal | Overloaded. Returns the dot product of a specified Vector3 and the Normal vector of this Plane.
Public Method | Equals | Overloaded. Determines whether two instances of Plane are equal.
Public Method | GetHashCode | Gets the hash code for this object.
Public Method | GetType | (Inherited from Object.)
Public Method | Intersects | Overloaded. Checks whether a Plane intersects a bounding volume.
Public Method | Normalize | Overloaded. Changes the coefficients of the Normal vector of a Plane to make it of unit length.
op_Equality | Determines whether two instances of Plane are equal.
op_Inequality | Determines whether two instances of Plane are not equal.
Public Method | ToString | Returns a String that represents the current Plane.
Transform | Overloaded. Transforms a normalized Plane by a Matrix or Quaternion.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Plane Structure
Microsoft.Xna.Framework Namespace


Plane Fields

Plane Fields

Expand image Public Fields

 | Name | Description
Public Field | D | The distance of the Plane along its normal from the origin.
Public Field | Normal | The normal vector of the Plane.

Expand image See Also

Reference

Plane Structure
Microsoft.Xna.Framework Namespace


Plane.D Field

Plane.D Field

The distance of the Plane along its normal from the origin.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float D

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Normal Field

Plane.Normal Field

The normal vector of the Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Normal

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane Constructor

Plane Constructor

Creates an instance of Plane.

Expand image Overload List

Name | Description
Plane (Single, Single, Single, Single) | Creates a new instance of Plane.
Plane (Vector3, Single) | Creates a new instance of Plane.
Plane (Vector3, Vector3, Vector3) | Creates a new instance of Plane.
Plane (Vector4) | Creates a new instance of Plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace


Plane Constructor (Single, Single, Single, Single)

Plane Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Creates a new instance of Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Plane (
         float a,
         float b,
         float c,
         float d
)

Parameters

a
X component of the normal defining the Plane.
b
Y component of the normal defining the Plane.
c
Z component of the normal defining the Plane.
d
Distance of the Plane along its normal from the origin.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane Constructor (Vector3, Single)

Plane Constructor (Vector3, Single)
See Also
CollapseAll image

Creates a new instance of Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Plane (
         Vector3 normal,
         float d
)

Parameters

normal
The normal vector to the Plane.
d
The Plane's distance along its normal from the origin.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane Constructor (Vector3, Vector3, Vector3)

Plane Constructor (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Creates a new instance of Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Plane (
         Vector3 point1,
         Vector3 point2,
         Vector3 point3
)

Parameters

point1
One point of a triangle defining the Plane.
point2
One point of a triangle defining the Plane.
point3
One point of a triangle defining the Plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane Constructor (Vector4)

Plane Constructor (Vector4)
See Also
CollapseAll image

Creates a new instance of Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Plane (
         Vector4 value
)

Parameters

value
Vector4 with X, Y, and Z components defining the normal of the Plane. The W component defines the distance of the Plane along the normal from the origin.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane Methods

Plane Methods

Expand image Public Methods

Name | Description
Public Method | Dot | Overloaded. Calculates the dot product of a specified Vector4 and this Plane.
Public Method DotCoordinate Overloaded. Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the D constant value of the
Plane
.
Public Method | DotNormal | Overloaded. Returns the dot product of a specified Vector3 and the Normal vector of this Plane.
Public Method | Equals | Overloaded. Determines whether two instances of Plane are equal.
Public Method | GetHashCode | Gets the hash code for this object.
Public Method | GetType | (Inherited from Object.)
Public Method | Intersects | Overloaded. Checks whether a Plane intersects a bounding volume.
Public Method | Normalize | Overloaded. Changes the coefficients of the Normal vector of a Plane to make it of unit length.
op_Equality | Determines whether two instances of Plane are equal.
op_Inequality | Determines whether two instances of Plane are not equal.
Public Method | ToString | Returns a String that represents the current Plane.
Transform | Overloaded. Transforms a normalized Plane by a Matrix or Quaternion.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Plane Structure
Microsoft.Xna.Framework Namespace


Plane.Dot Method

Plane.Dot Method

Calculates the dot product of a specified Vector4 and this Plane.

Expand image Overload List

Name | Description
Plane.Dot (Vector4) | Calculates the dot product of a specified Vector4 and this Plane.
Plane.Dot (Vector4, Single) | Calculates the dot product of a specified Vector4 and this Plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace


Plane.Dot Method (Vector4)

Plane.Dot Method (Vector4)
See Also
CollapseAll image

Calculates the dot product of a specified Vector4 and this Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Dot (
         Vector4 value
)

Parameters

value
The Vector4 to multiply this Plane by.

Return Value

The dot product of the specified Vector4 and this Plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Dot Method (Vector4, Single)

Plane.Dot Method (Vector4, Single)
See Also
CollapseAll image

Calculates the dot product of a specified Vector4 and this Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dot (
         ref Vector4 value,
         out float result
)

Parameters

value
The Vector4 to multiply this Plane by.
result
[OutAttribute] The dot product of the specified Vector4 and this Plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.DotCoordinate Method

Plane.DotCoordinate Method

Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the D constant value of the Plane.

Expand image Overload List

Name | Description
Plane.DotCoordinate (Vector3) | Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the distance (D) value of the Plane.
Plane.DotCoordinate (Vector3, Single) | Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the distance (D) value of the Plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace


Plane.DotCoordinate Method (Vector3)

Plane.DotCoordinate Method (Vector3)
See Also
CollapseAll image

Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the distance (D) value of the Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float DotCoordinate (
         Vector3 value
)

Parameters

value
The Vector3 to multiply by.

Return Value

The resulting value.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.DotCoordinate Method (Vector3, Single)

Plane.DotCoordinate Method (Vector3, Single)
See Also
CollapseAll image

Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the distance (D) value of the Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void DotCoordinate (
         ref Vector3 value,
         out float result
)

Parameters

value
The Vector3 to multiply by.
result
[OutAttribute] The resulting value.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.DotNormal Method

Plane.DotNormal Method

Returns the dot product of a specified Vector3 and the Normal vector of this Plane.

Expand image Overload List

Name | Description
Plane.DotNormal (Vector3) | Returns the dot product of a specified Vector3 and the Normal vector of this Plane.
Plane.DotNormal (Vector3, Single) | Returns the dot product of a specified Vector3 and the Normal vector of this Plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace


Plane.DotNormal Method (Vector3)

Plane.DotNormal Method (Vector3)
See Also
CollapseAll image

Returns the dot product of a specified Vector3 and the Normal vector of this Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float DotNormal (
         Vector3 value
)

Parameters

value
The Vector3 to multiply by.

Return Value

The resulting dot product.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.DotNormal Method (Vector3, Single)

Plane.DotNormal Method (Vector3, Single)
See Also
CollapseAll image

Returns the dot product of a specified Vector3 and the Normal vector of this Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void DotNormal (
         ref Vector3 value,
         out float result
)

Parameters

value
The Vector3 to multiply by.
result
[OutAttribute] The resulting dot product.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Equals Method

Plane.Equals Method

Determines whether two instances of Plane are equal.

Expand image Overload List

Name | Description
Plane.Equals (Object) | Determines whether the specified Object is equal to the Plane.
Plane.Equals (Plane) | Determines whether the specified Plane is equal to the Plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace


Plane.Equals Method (Object)

Plane.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to the Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current Plane.

Return Value

true if the specified Object is equal to the current Plane; false otherwise.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Equals Method (Plane)

Plane.Equals Method (Plane)
See Also
CollapseAll image

Determines whether the specified Plane is equal to the Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Plane other
)

Parameters

other
The Plane to compare with the current Plane.

Return Value

true if the specified Plane is equal to the current Plane; false otherwise.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.GetHashCode Method

Plane.GetHashCode Method

Gets the hash code for this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

A hash code for the current Plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Intersects Method

Plane.Intersects Method

Checks whether a Plane intersects a bounding volume.

Expand image Overload List

Name | Description
Plane.Intersects (BoundingBox) | Checks whether the current Plane intersects a specified BoundingBox.
Plane.Intersects (BoundingBox, PlaneIntersectionType) | Checks whether the current Plane intersects a BoundingBox.
Plane.Intersects (BoundingFrustum) | Checks whether the current Plane intersects a specified BoundingFrustum.
Plane.Intersects (BoundingSphere) | Checks whether the current Plane intersects a specified BoundingSphere.
Plane.Intersects (BoundingSphere, PlaneIntersectionType) | Checks whether the current Plane intersects a BoundingSphere.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace


Plane.Intersects Method (BoundingBox)

Plane.Intersects Method (BoundingBox)
See Also
CollapseAll image

Checks whether the current Plane intersects a specified BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PlaneIntersectionType Intersects (
         BoundingBox box
)

Parameters

box
The BoundingBox to test for intersection with.

Return Value

An enumeration indicating the relationship between the Plane and the BoundingBox.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Intersects Method (BoundingBox, PlaneIntersectionType)

Plane.Intersects Method (BoundingBox, PlaneIntersectionType)
See Also
CollapseAll image

Checks whether the current Plane intersects a BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref BoundingBox box,
         out PlaneIntersectionType result
)

Parameters

box
The BoundingBox to check for intersection with.
result
[OutAttribute] An enumeration indicating whether the Plane intersects the BoundingBox.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Intersects Method (BoundingFrustum)

Plane.Intersects Method (BoundingFrustum)
See Also
CollapseAll image

Checks whether the current Plane intersects a specified BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PlaneIntersectionType Intersects (
         BoundingFrustum frustum
)

Parameters

frustum
The BoundingFrustum to check for intersection with.

Return Value

An enumeration indicating the relationship between the Plane and the BoundingFrustum.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | frustum is null.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Intersects Method (BoundingSphere)

Plane.Intersects Method (BoundingSphere)
See Also
CollapseAll image

Checks whether the current Plane intersects a specified BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PlaneIntersectionType Intersects (
         BoundingSphere sphere
)

Parameters

sphere
The BoundingSphere to check for intersection with.

Return Value

An enumeration indicating the relationship between the Plane and the BoundingSphere.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Intersects Method (BoundingSphere, PlaneIntersectionType)

Plane.Intersects Method (BoundingSphere, PlaneIntersectionType)
See Also
CollapseAll image

Checks whether the current Plane intersects a BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref BoundingSphere sphere,
         out PlaneIntersectionType result
)

Parameters

sphere
The BoundingSphere to check for intersection with.
result
[OutAttribute] An enumeration indicating whether the Plane intersects the BoundingSphere.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Normalize Method

Plane.Normalize Method

Changes the coefficients of the Normal vector of a Plane to make it of unit length.

Expand image Overload List

Name | Description
Plane.Normalize () | Changes the coefficients of the Normal vector of this Plane to make it of unit length.
Plane.Normalize (Plane) | Changes the coefficients of the Normal vector of a Plane to make it of unit length.
Plane.Normalize (Plane, Plane) | Changes the coefficients of the Normal vector of a Plane to make it of unit length.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace


Plane.Normalize Method ()

Plane.Normalize Method ()
See Also
CollapseAll image

Changes the coefficients of the Normal vector of this Plane to make it of unit length.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Normalize ()

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Normalize Method (Plane)

Plane.Normalize Method (Plane)
See Also
CollapseAll image

Changes the coefficients of the Normal vector of a Plane to make it of unit length.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Plane Normalize (
         Plane value
)

Parameters

value
The Plane to normalize.

Return Value

A new Plane with a normal having unit length.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Normalize Method (Plane, Plane)

Plane.Normalize Method (Plane, Plane)
See Also
CollapseAll image

Changes the coefficients of the Normal vector of a Plane to make it of unit length.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Normalize (
         ref Plane value,
         out Plane result
)

Parameters

value
The Plane to normalize.
result
[OutAttribute] An existing plane Plane filled in with a normalized version of the specified plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.op_Equality Method

Plane.op_Equality Method

Determines whether two instances of Plane are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Plane lhs,
         Plane rhs
)

Parameters

lhs
The object to the left of the equality operator.
rhs
The object to the right of the equality operator.

Return Value

true if left is equal to right; false otherwise.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.op_Inequality Method

Plane.op_Inequality Method

Determines whether two instances of Plane are not equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Plane lhs,
         Plane rhs
)

Parameters

lhs
The object to the left of the inequality operator.
rhs
The object to the right of the inequality operator.

Return Value

true if left is not equal to right; false otherwise.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.ToString Method

Plane.ToString Method

Returns a String that represents the current Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of the current Plane.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Transform Method

Plane.Transform Method

Transforms a normalized Plane by a Matrix or Quaternion.

Expand image Overload List

Name | Description
Plane.Transform (Plane, Matrix) | Transforms a normalized Plane by a Matrix.
Plane.Transform (Plane, Matrix, Plane) | Transforms a normalized Plane by a Matrix.
Plane.Transform (Plane, Quaternion) | Transforms a normalized Plane by a Quaternion rotation.
Plane.Transform (Plane, Quaternion, Plane) | Transforms a normalized Plane by a Quaternion rotation.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace


Plane.Transform Method (Plane, Matrix)

Plane.Transform Method (Plane, Matrix)
See Also
CollapseAll image

Transforms a normalized Plane by a Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Plane Transform (
         Plane plane,
         Matrix matrix
)

Parameters

plane
The normalized Plane to transform. This Plane must already be normalized, so that its Normal vector is of unit length, before this method is called.
matrix
The transform Matrix to apply to the Plane.

Return Value

A new Plane that results from applying the transform.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Transform Method (Plane, Matrix, Plane)

Plane.Transform Method (Plane, Matrix, Plane)
See Also
CollapseAll image

Transforms a normalized Plane by a Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Plane plane,
         ref Matrix matrix,
         out Plane result
)

Parameters

plane
The normalized Plane to transform. This Plane must already be normalized, so that its Normal vector is of unit length, before this method is called.
matrix
The transform Matrix to apply to the Plane.
result
[OutAttribute] An existing Plane filled in with the results of applying the transform.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Transform Method (Plane, Quaternion)

Plane.Transform Method (Plane, Quaternion)
See Also
CollapseAll image

Transforms a normalized Plane by a Quaternion rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Plane Transform (
         Plane plane,
         Quaternion rotation
)

Parameters

plane
The normalized Plane to transform. This Plane must already be normalized, so that its Normal vector is of unit length, before this method is called.
rotation
The Quaternion rotation to apply to the Plane.

Return Value

A new Plane that results from applying the rotation.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Plane.Transform Method (Plane, Quaternion, Plane)

Plane.Transform Method (Plane, Quaternion, Plane)
See Also
CollapseAll image

Transforms a normalized Plane by a Quaternion rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Plane plane,
         ref Quaternion rotation,
         out Plane result
)

Parameters

plane
The normalized Plane to transform. This Plane must already be normalized, so that its Normal vector is of unit length, before this method is called.
rotation
The Quaternion rotation to apply to the Plane.
result
[OutAttribute] An existing Plane filled in with the results of applying the rotation.

Expand image See Also

Reference

Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PlaneIntersectionType Enumeration

PlaneIntersectionType Enumeration

Describes the intersection between a plane and a bounding volume.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum PlaneIntersectionType

Expand image Members

Member name | Description
Back | There is no intersection, and the bounding volume is in the negative half-space of the Plane.
Front | There is no intersection, and the bounding volume is in the positive half-space of the Plane.
Intersecting | The Plane is intersected.

Expand image See Also

Reference

Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PlayerIndex Enumeration

PlayerIndex Enumeration

Specifies the game controller associated with a player.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum PlayerIndex

Expand image Members

Member name | Description
One | The first controller.
Two | The second controller.
Three | The third controller.
Four | The fourth controller.

Expand image See Also

Reference

SignedInGamer.PlayerIndex Property
SignedInGamerCollection.Item Property (PlayerIndex)
GamePad.GetCapabilities Method
GamePad.GetState Method
GamePad.SetVibration Method
Guide.BeginShowKeyboardInput Method
Guide.BeginShowMessageBox Method
Guide.ShowComposeMessage Method
Guide.ShowFriendRequest Method
Guide.ShowFriends Method
Guide.ShowGameInvite Method
Guide.ShowGamerCard Method
Guide.ShowMarketplace Method
Guide.ShowMessages Method
Guide.ShowPlayerReview Method
Guide.ShowPlayers Method
Keyboard.GetState Method
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point Structure

Point Structure

Defines a point in 2D space.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.PointConverter)")]
[SerializableAttribute]
public struct Point : IEquatable<Point>

Expand image See Also

Reference

Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point Members

Point Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the Point type.

Expand image Public Constructors

 | Name | Description
Public Method | Point | Initializes a new instance of Point.

Expand image Public Fields

 | Name | Description
Public Field | X | Specifies the x-coordinate of the Point.
Public Field | Y | Specifies the y-coordinate of the Point.

Expand image Public Properties

Name | Description
Zero | Returns the point (0,0).

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Determines whether two Point instances are equal.
Public Method | GetHashCode | Gets the hash code for this object.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two Point instances are equal.
 | op_Inequality | Determines whether two Point instances are not equal.
Public Method | ToString | Returns a String that represents the current Point.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Point Structure
Microsoft.Xna.Framework Namespace


Point Fields

Point Fields

Expand image Public Fields

 | Name | Description
Public Field | X | Specifies the x-coordinate of the Point.
Public Field | Y | Specifies the y-coordinate of the Point.

Expand image See Also

Reference

Point Structure
Microsoft.Xna.Framework Namespace


Point.X Field

Point.X Field

Specifies the x-coordinate of the Point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int X

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point.Y Field

Point.Y Field

Specifies the y-coordinate of the Point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Y

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point Constructor

Point Constructor

Initializes a new instance of Point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Point (
         int x,
         int y
)

Parameters

x
The x-coordinate of the Point.
y
The y-coordinate of the Point.

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point Methods

Point Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Determines whether two Point instances are equal.
Public Method | GetHashCode | Gets the hash code for this object.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two Point instances are equal.
 | op_Inequality | Determines whether two Point instances are not equal.
Public Method | ToString | Returns a String that represents the current Point.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Point Structure
Microsoft.Xna.Framework Namespace


Point.Equals Method

Point.Equals Method

Determines whether two Point instances are equal.

Expand image Overload List

Name | Description
Point.Equals (Object) | Determines whether two Point instances are equal.
Point.Equals (Point) | Determines whether two Point instances are equal.

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace


Point.Equals Method (Object)

Point.Equals Method (Object)
See Also
CollapseAll image

Determines whether two Point instances are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object to compare this instance to.

Return Value

true if the instances are equal; false otherwise.

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point.Equals Method (Point)

Point.Equals Method (Point)
See Also
CollapseAll image

Determines whether two Point instances are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Point other
)

Parameters

other
The Point to compare this instance to.

Return Value

true if the instances are equal; false otherwise.

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point.GetHashCode Method

Point.GetHashCode Method

Gets the hash code for this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

The hash code for this object.

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point.op_Equality Method

Point.op_Equality Method

Determines whether two Point instances are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Point a,
         Point b
)

Parameters

a
Point on the left side of the equal sign.
b
Point on the right side of the equal sign.

Return Value

true if a and bare equal; false otherwise.

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point.op_Inequality Method

Point.op_Inequality Method

Determines whether two Point instances are not equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Point a,
         Point b
)

Parameters

a
The Point on the left side of the equal sign.
b
The Point on the right side of the equal sign.

Return Value

true if the instances are not equal; false otherwise.

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point.ToString Method

Point.ToString Method

Returns a String that represents the current Point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

A String that represents the current Point.

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Point Properties

Point Properties

Expand image Public Properties

Name | Description
Zero | Returns the point (0,0).

Expand image See Also

Reference

Point Structure
Microsoft.Xna.Framework Namespace


Point.Zero Property

Point.Zero Property

Returns the point (0,0).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Point Zero { get; }

Property Value

The point (0,0).

Expand image See Also

Reference

Point Structure
Point Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PreparingDeviceSettingsEventArgs Class

PreparingDeviceSettingsEventArgs Class
See Also Members
CollapseAll image

Arguments for the GraphicsDeviceManager.PreparingDeviceSettings event.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public class PreparingDeviceSettingsEventArgs : EventArgs

Expand image See Also

Reference

PreparingDeviceSettingsEventArgs Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PreparingDeviceSettingsEventArgs Members

PreparingDeviceSettingsEventArgs Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the PreparingDeviceSettingsEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | PreparingDeviceSettingsEventArgs | Creates a new instance of PreparingDeviceSettingsEventArgs.

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDeviceInformation | Information about the GraphicsDevice.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PreparingDeviceSettingsEventArgs Class
Microsoft.Xna.Framework Namespace


PreparingDeviceSettingsEventArgs Constructor

PreparingDeviceSettingsEventArgs Constructor

Creates a new instance of PreparingDeviceSettingsEventArgs.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public PreparingDeviceSettingsEventArgs (
         GraphicsDeviceInformation graphicsDeviceInformation
)

Parameters

graphicsDeviceInformation
Information about the GraphicsDevice.

Expand image See Also

Reference

PreparingDeviceSettingsEventArgs Class
PreparingDeviceSettingsEventArgs Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PreparingDeviceSettingsEventArgs Methods

PreparingDeviceSettingsEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PreparingDeviceSettingsEventArgs Class
Microsoft.Xna.Framework Namespace


PreparingDeviceSettingsEventArgs Properties

PreparingDeviceSettingsEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDeviceInformation | Information about the GraphicsDevice.

Expand image See Also

Reference

PreparingDeviceSettingsEventArgs Class
Microsoft.Xna.Framework Namespace


PreparingDeviceSettingsEventArgs.GraphicsDeviceInformation Property

PreparingDeviceSettingsEventArgs.GraphicsDeviceInformation Property
See Also
CollapseAll image

Information about the GraphicsDevice.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GraphicsDeviceInformation GraphicsDeviceInformation { get; }

Property Value

Information about the GraphicsDevice.

Expand image See Also

Reference

PreparingDeviceSettingsEventArgs Class
PreparingDeviceSettingsEventArgs Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion Structure

Quaternion Structure

Defines a four-dimensional vector (x,y,z,w), which is used to efficiently rotate an object about the (x, y, z) vector by the angle theta, where w = cos(theta/2).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.QuaternionConverter)")]
[SerializableAttribute]
public struct Quaternion : IEquatable<Quaternion>

Expand image Remarks

Quaternions represent a rotation. Typically, they are used for smooth interpolation between two angles, and for avoiding the gimbal lock problem that can occur with euler angles.

Expand image See Also

Reference

Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion Members

Quaternion Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the Quaternion type.

Expand image Public Constructors

 | Name | Description
Public Method | Quaternion | Overloaded. Initializes a new instance of Quaternion.

Expand image Public Fields

 | Name | Description
Public Field | W | Specifies the rotation component of the quaternion.
Public Field | X | Specifies the x-value of the vector component of the quaternion.
Public Field | Y | Specifies the y-value of the vector component of the quaternion.
Public Field | Z | Specifies the z-value of the vector component of the quaternion.

Expand image Public Properties

Name | Description
Identity | Returns a Quaternion representing no rotation.

Expand image Public Methods

 | Name | Description
 | Add | Overloaded. Adds two Quaternions.
 | Concatenate | Overloaded. Concatenates two Quaternions; the result represents the first rotation followed by the second rotation.
Public Method | Conjugate | Overloaded. Calculates the conjugate of a Quaternion.
 | CreateFromAxisAngle | Overloaded. Creates a Quaternion from a vector and an angle to rotate about the vector.
 | CreateFromRotationMatrix | Overloaded. Creates a Quaternion from a rotation Matrix.
 | CreateFromYawPitchRoll | Overloaded. Creates a new Quaternion from specified yaw, pitch, and roll angles.
 | Divide | Overloaded. Divides a Quaternion by another Quaternion.
 | Dot | Overloaded. Calculates the dot product of two Quaternions.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Get the hash code of this object.
Public Method | GetType | (Inherited from Object.)
 | Inverse | Overloaded. Returns the inverse of a Quaternion.
Public Method | Length | Calculates the length of a Quaternion.
Public Method | LengthSquared | Calculates the length squared of a Quaternion.
 | Lerp | Overloaded. Linearly interpolates between two quaternions.
 | Multiply | Overloaded. Multiplies a quaternion by a scalar or another quaternion.
 | Negate | Overloaded. Flips the sign of each component of the quaternion.
Public Method | Normalize | Overloaded. Divides each component of a quaternion by the length of the quaternion.
 | op_Addition | Adds two Quaternions.
 | op_Division | Divides a Quaternion by another Quaternion.
 | op_Equality | Compares two Quaternions for equality.
 | op_Inequality | Compare two Quaternions for inequality.
 | op_Multiply | Overloaded. Multiplies a quaternion by a scalar or another quaternion.
 | op_Subtraction | Subtracts a quaternion from another quaternion.
 | op_UnaryNegation | Flips the sign of each component of the quaternion.
 | Slerp | Overloaded. Interpolates between two quaternions, using spherical linear interpolation.
 | Subtract | Overloaded. Subtracts a quaternion from another quaternion.
Public Method | ToString | Retireves a string representation of the current object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Quaternion Structure
Microsoft.Xna.Framework Namespace


Quaternion Fields

Quaternion Fields

Expand image Public Fields

 | Name | Description
Public Field | W | Specifies the rotation component of the quaternion.
Public Field | X | Specifies the x-value of the vector component of the quaternion.
Public Field | Y | Specifies the y-value of the vector component of the quaternion.
Public Field | Z | Specifies the z-value of the vector component of the quaternion.

Expand image See Also

Reference

Quaternion Structure
Microsoft.Xna.Framework Namespace


Quaternion.W Field

Quaternion.W Field

Specifies the rotation component of the quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float W

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.X Field

Quaternion.X Field

Specifies the x-value of the vector component of the quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float X

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Y Field

Quaternion.Y Field

Specifies the y-value of the vector component of the quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Y

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Z Field

Quaternion.Z Field

Specifies the z-value of the vector component of the quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Z

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion Constructor

Quaternion Constructor

Initializes a new instance of Quaternion.

Expand image Overload List

Name | Description
Quaternion (Single, Single, Single, Single) | Initializes a new instance of Quaternion.
Quaternion (Vector3, Single) | Initializes a new instance of Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion Constructor (Single, Single, Single, Single)

Quaternion Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Quaternion (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
The x-value of the quaternion.
y
The y-value of the quaternion.
z
The z-value of the quaternion.
w
The w-value of the quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion Constructor (Vector3, Single)

Quaternion Constructor (Vector3, Single)
See Also
CollapseAll image

Initializes a new instance of Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Quaternion (
         Vector3 vectorPart,
         float scalarPart
)

Parameters

vectorPart
The vector component of the quaternion.
scalarPart
The rotation component of the quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion Methods

Quaternion Methods

Expand image Public Methods

 | Name | Description
 | Add | Overloaded. Adds two Quaternions.
 | Concatenate | Overloaded. Concatenates two Quaternions; the result represents the first rotation followed by the second rotation.
Public Method | Conjugate | Overloaded. Calculates the conjugate of a Quaternion.
 | CreateFromAxisAngle | Overloaded. Creates a Quaternion from a vector and an angle to rotate about the vector.
 | CreateFromRotationMatrix | Overloaded. Creates a Quaternion from a rotation Matrix.
 | CreateFromYawPitchRoll | Overloaded. Creates a new Quaternion from specified yaw, pitch, and roll angles.
 | Divide | Overloaded. Divides a Quaternion by another Quaternion.
 | Dot | Overloaded. Calculates the dot product of two Quaternions.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Get the hash code of this object.
Public Method | GetType | (Inherited from Object.)
 | Inverse | Overloaded. Returns the inverse of a Quaternion.
Public Method | Length | Calculates the length of a Quaternion.
Public Method | LengthSquared | Calculates the length squared of a Quaternion.
 | Lerp | Overloaded. Linearly interpolates between two quaternions.
 | Multiply | Overloaded. Multiplies a quaternion by a scalar or another quaternion.
 | Negate | Overloaded. Flips the sign of each component of the quaternion.
Public Method | Normalize | Overloaded. Divides each component of a quaternion by the length of the quaternion.
 | op_Addition | Adds two Quaternions.
 | op_Division | Divides a Quaternion by another Quaternion.
 | op_Equality | Compares two Quaternions for equality.
 | op_Inequality | Compare two Quaternions for inequality.
 | op_Multiply | Overloaded. Multiplies a quaternion by a scalar or another quaternion.
 | op_Subtraction | Subtracts a quaternion from another quaternion.
 | op_UnaryNegation | Flips the sign of each component of the quaternion.
 | Slerp | Overloaded. Interpolates between two quaternions, using spherical linear interpolation.
 | Subtract | Overloaded. Subtracts a quaternion from another quaternion.
Public Method | ToString | Retireves a string representation of the current object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Quaternion Structure
Microsoft.Xna.Framework Namespace


Quaternion.Add Method

Quaternion.Add Method

Adds two Quaternions.

Expand image Overload List

Name | Description
Quaternion.Add (Quaternion, Quaternion) | Adds two Quaternions.
Quaternion.Add (Quaternion, Quaternion, Quaternion) | Adds two Quaternions.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Add Method (Quaternion, Quaternion)

Quaternion.Add Method (Quaternion, Quaternion)
See Also
CollapseAll image

Adds two Quaternions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Add (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
Quaternion to add.
quaternion2
Quaternion to add.

Return Value

Result of adding the Quaternions.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Add Method (Quaternion, Quaternion, Quaternion)

Quaternion.Add Method (Quaternion, Quaternion, Quaternion)
See Also
CollapseAll image

Adds two Quaternions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Add (
         ref Quaternion quaternion1,
         ref Quaternion quaternion2,
         out Quaternion result
)

Parameters

quaternion1
Quaternion to add.
quaternion2
Quaternion to add.
result
[OutAttribute] Result of adding the Quaternions.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Concatenate Method

Quaternion.Concatenate Method

Concatenates two Quaternions; the result represents the first rotation followed by the second rotation.

Expand image Overload List

Name | Description
Quaternion.Concatenate (Quaternion, Quaternion) | Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.
Quaternion.Concatenate (Quaternion, Quaternion, Quaternion) | Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Concatenate Method (Quaternion, Quaternion)

Quaternion.Concatenate Method (Quaternion, Quaternion)
See Also
CollapseAll image

Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Concatenate (
         Quaternion value1,
         Quaternion value2
)

Parameters

value1
The first Quaternion rotation in the series.
value2
The second Quaternion rotation in the series.

Return Value

A new Quaternion representing the concatenation of the value1 rotation followed by the value2 rotation.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Concatenate Method (Quaternion, Quaternion, Quaternion)

Quaternion.Concatenate Method (Quaternion, Quaternion, Quaternion)
See Also
CollapseAll image

Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Concatenate (
         ref Quaternion value1,
         ref Quaternion value2,
         out Quaternion result
)

Parameters

value1
The first Quaternion rotation in the series.
value2
The second Quaternion rotation in the series.
result
[OutAttribute] The Quaternion rotation representing the concatenation of value1 followed by value2.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Conjugate Method

Quaternion.Conjugate Method

Calculates the conjugate of a Quaternion.

Expand image Overload List

Name | Description
Quaternion.Conjugate () | Transforms this Quaternion into its conjugate.
Quaternion.Conjugate (Quaternion) | Returns the conjugate of a specified Quaternion.
Quaternion.Conjugate (Quaternion, Quaternion) | Returns the conjugate of a specified Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Conjugate Method ()

Quaternion.Conjugate Method ()
See Also
CollapseAll image

Transforms this Quaternion into its conjugate.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Conjugate ()

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Conjugate Method (Quaternion)

Quaternion.Conjugate Method (Quaternion)
See Also
CollapseAll image

Returns the conjugate of a specified Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Conjugate (
         Quaternion value
)

Parameters

value
The Quaternion of which to return the conjugate.

Return Value

A new Quaternion that is the conjugate of the specified one.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Conjugate Method (Quaternion, Quaternion)

Quaternion.Conjugate Method (Quaternion, Quaternion)
See Also
CollapseAll image

Returns the conjugate of a specified Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Conjugate (
         ref Quaternion value,
         out Quaternion result
)

Parameters

value
The Quaternion of which to return the conjugate.
result
[OutAttribute] An existing Quaternion filled in to be the conjugate of the specified one.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.CreateFromAxisAngle Method

Quaternion.CreateFromAxisAngle Method

Creates a Quaternion from a vector and an angle to rotate about the vector.

Expand image Overload List

Name | Description
Quaternion.CreateFromAxisAngle (Vector3, Single) | Creates a Quaternion from a vector and an angle to rotate about the vector.
Quaternion.CreateFromAxisAngle (Vector3, Single, Quaternion) | Creates a Quaternion from a vector and an angle to rotate about the vector.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.CreateFromAxisAngle Method (Vector3, Single)

Quaternion.CreateFromAxisAngle Method (Vector3, Single)
See Also
CollapseAll image

Creates a Quaternion from a vector and an angle to rotate about the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion CreateFromAxisAngle (
         Vector3 axis,
         float angle
)

Parameters

axis
The vector to rotate around.
angle
The angle to rotate around the vector.

Return Value

The created Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.CreateFromAxisAngle Method (Vector3, Single, Quaternion)

Quaternion.CreateFromAxisAngle Method (Vector3, Single, Quaternion)
See Also
CollapseAll image

Creates a Quaternion from a vector and an angle to rotate about the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateFromAxisAngle (
         ref Vector3 axis,
         float angle,
         out Quaternion result
)

Parameters

axis
The vector to rotate around.
angle
The angle to rotate around the vector.
result
[OutAttribute] The created Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.CreateFromRotationMatrix Method

Quaternion.CreateFromRotationMatrix Method

Creates a Quaternion from a rotation Matrix.

Expand image Overload List

Name | Description
Quaternion.CreateFromRotationMatrix (Matrix) | Creates a Quaternion from a rotation Matrix.
Quaternion.CreateFromRotationMatrix (Matrix, Quaternion) | Creates a Quaternion from a rotation Matrix.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.CreateFromRotationMatrix Method (Matrix)

Quaternion.CreateFromRotationMatrix Method (Matrix)
See Also
CollapseAll image

Creates a Quaternion from a rotation Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion CreateFromRotationMatrix (
         Matrix matrix
)

Parameters

matrix
The rotation Matrix to create the Quaternion from.

Return Value

The created Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.CreateFromRotationMatrix Method (Matrix, Quaternion)

Quaternion.CreateFromRotationMatrix Method (Matrix, Quaternion)
See Also
CollapseAll image

Creates a Quaternion from a rotation Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateFromRotationMatrix (
         ref Matrix matrix,
         out Quaternion result
)

Parameters

matrix
The rotation Matrix to create the Quaternion from.
result
[OutAttribute] The created Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.CreateFromYawPitchRoll Method

Quaternion.CreateFromYawPitchRoll Method

Creates a new Quaternion from specified yaw, pitch, and roll angles.

Expand image Overload List

Name | Description
Quaternion.CreateFromYawPitchRoll (Single, Single, Single) | Creates a new Quaternion from specified yaw, pitch, and roll angles.
Quaternion.CreateFromYawPitchRoll (Single, Single, Single, Quaternion) | Creates a new Quaternion from specified yaw, pitch, and roll angles.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.CreateFromYawPitchRoll Method (Single, Single, Single)

Quaternion.CreateFromYawPitchRoll Method (Single, Single, Single)
See Also
CollapseAll image

Creates a new Quaternion from specified yaw, pitch, and roll angles.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion CreateFromYawPitchRoll (
         float yaw,
         float pitch,
         float roll
)

Parameters

yaw
The yaw angle, in radians, around the y-axis.
pitch
The pitch angle, in radians, around the x-axis.
roll
The roll angle, in radians, around the z-axis.

Return Value

A new Quaternion expressing the specified yaw, pitch, and roll angles.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.CreateFromYawPitchRoll Method (Single, Single, Single, Quaternion)

Quaternion.CreateFromYawPitchRoll Method (Single, Single, Single, Quaternion)
See Also
CollapseAll image

Creates a new Quaternion from specified yaw, pitch, and roll angles.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CreateFromYawPitchRoll (
         float yaw,
         float pitch,
         float roll,
         out Quaternion result
)

Parameters

yaw
The yaw angle, in radians, around the y-axis.
pitch
The pitch angle, in radians, around the x-axis.
roll
The roll angle, in radians, around the z-axis.
result
[OutAttribute] An existing Quaternion filled in to express the specified yaw, pitch, and roll angles.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Divide Method

Quaternion.Divide Method

Divides a Quaternion by another Quaternion.

Expand image Overload List

Name | Description
Quaternion.Divide (Quaternion, Quaternion) | Divides a Quaternion by another Quaternion.
Quaternion.Divide (Quaternion, Quaternion, Quaternion) | Divides a Quaternion by another Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Divide Method (Quaternion, Quaternion)

Quaternion.Divide Method (Quaternion, Quaternion)
See Also
CollapseAll image

Divides a Quaternion by another Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Divide (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
Source Quaternion.
quaternion2
The divisor.

Return Value

Result of the division.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Divide Method (Quaternion, Quaternion, Quaternion)

Quaternion.Divide Method (Quaternion, Quaternion, Quaternion)
See Also
CollapseAll image

Divides a Quaternion by another Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Divide (
         ref Quaternion quaternion1,
         ref Quaternion quaternion2,
         out Quaternion result
)

Parameters

quaternion1
Source Quaternion.
quaternion2
The divisor.
result
[OutAttribute] Result of the division.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Dot Method

Quaternion.Dot Method

Calculates the dot product of two Quaternions.

Expand image Overload List

Name | Description
Quaternion.Dot (Quaternion, Quaternion) | Calculates the dot product of two Quaternions.
Quaternion.Dot (Quaternion, Quaternion, Single) | Calculates the dot product of two Quaternions.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Dot Method (Quaternion, Quaternion)

Quaternion.Dot Method (Quaternion, Quaternion)
See Also
CollapseAll image

Calculates the dot product of two Quaternions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Dot (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
Source Quaternion.
quaternion2
Source Quaternion.

Return Value

Dot product of the Quaternions.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Dot Method (Quaternion, Quaternion, Single)

Quaternion.Dot Method (Quaternion, Quaternion, Single)
See Also
CollapseAll image

Calculates the dot product of two Quaternions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Dot (
         ref Quaternion quaternion1,
         ref Quaternion quaternion2,
         out float result
)

Parameters

quaternion1
Source Quaternion.
quaternion2
Source Quaternion.
result
[OutAttribute] Dot product of the Quaternions.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Equals Method

Quaternion.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Quaternion.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.
Quaternion.Equals (Quaternion) | Determines whether the specified Object is equal to the Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Equals Method (Object)

Quaternion.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to make the comparison with.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Equals Method (Quaternion)

Quaternion.Equals Method (Quaternion)
See Also
CollapseAll image

Determines whether the specified Object is equal to the Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Quaternion other
)

Parameters

other
The Quaternion to compare with the current Quaternion.

Return Value

true if the specified Object is equal to the current Quaternion; false otherwise.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.GetHashCode Method

Quaternion.GetHashCode Method

Get the hash code of this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

The hash code for this object.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Inverse Method

Quaternion.Inverse Method

Returns the inverse of a Quaternion.

Expand image Overload List

Name | Description
Quaternion.Inverse (Quaternion) | Returns the inverse of a Quaternion.
Quaternion.Inverse (Quaternion, Quaternion) | Returns the inverse of a Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Inverse Method (Quaternion)

Quaternion.Inverse Method (Quaternion)
See Also
CollapseAll image

Returns the inverse of a Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Inverse (
         Quaternion quaternion
)

Parameters

quaternion
Source Quaternion.

Return Value

The inverse of the Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Inverse Method (Quaternion, Quaternion)

Quaternion.Inverse Method (Quaternion, Quaternion)
See Also
CollapseAll image

Returns the inverse of a Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Inverse (
         ref Quaternion quaternion,
         out Quaternion result
)

Parameters

quaternion
Source Quaternion.
result
[OutAttribute] The inverse of the Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Length Method

Quaternion.Length Method

Calculates the length of a Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Length ()

Return Value

The length of the Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.LengthSquared Method

Quaternion.LengthSquared Method

Calculates the length squared of a Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float LengthSquared ()

Return Value

The length squared of the Quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Lerp Method

Quaternion.Lerp Method

Linearly interpolates between two quaternions.

Expand image Overload List

Name | Description
Quaternion.Lerp (Quaternion, Quaternion, Single) | Linearly interpolates between two quaternions.
Quaternion.Lerp (Quaternion, Quaternion, Single, Quaternion) | Linearly interpolates between two quaternions.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Lerp Method (Quaternion, Quaternion, Single)

Quaternion.Lerp Method (Quaternion, Quaternion, Single)
See Also
CollapseAll image

Linearly interpolates between two quaternions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Lerp (
         Quaternion quaternion1,
         Quaternion quaternion2,
         float amount
)

Parameters

quaternion1
Source quaternion.
quaternion2
Source quaternion.
amount
Value indicating how far to interpolate between the quaternions.

Return Value

The resulting quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Lerp Method (Quaternion, Quaternion, Single, Quaternion)

Quaternion.Lerp Method (Quaternion, Quaternion, Single, Quaternion)
See Also
CollapseAll image

Linearly interpolates between two quaternions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Lerp (
         ref Quaternion quaternion1,
         ref Quaternion quaternion2,
         float amount,
         out Quaternion result
)

Parameters

quaternion1
Source quaternion.
quaternion2
Source quaternion.
amount
Value indicating how far to interpolate between the quaternions.
result
[OutAttribute] The resulting quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Multiply Method

Quaternion.Multiply Method

Multiplies a quaternion by a scalar or another quaternion.

Expand image Overload List

Name | Description
Quaternion.Multiply (Quaternion, Quaternion) | Multiplies two quaternions.
Quaternion.Multiply (Quaternion, Quaternion, Quaternion) | Multiplies two quaternions.
Quaternion.Multiply (Quaternion, Single) | Multiplies a quaternion by a scalar value.
Quaternion.Multiply (Quaternion, Single, Quaternion) | Multiplies a quaternion by a scalar value.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Multiply Method (Quaternion, Quaternion)

Quaternion.Multiply Method (Quaternion, Quaternion)
See Also
CollapseAll image

Multiplies two quaternions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Multiply (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
The quaternion on the left of the multiplication.
quaternion2
The quaternion on the right of the multiplication.

Return Value

The result of the multiplication.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Multiply Method (Quaternion, Quaternion, Quaternion)

Quaternion.Multiply Method (Quaternion, Quaternion, Quaternion)
See Also
CollapseAll image

Multiplies two quaternions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Multiply (
         ref Quaternion quaternion1,
         ref Quaternion quaternion2,
         out Quaternion result
)

Parameters

quaternion1
The quaternion on the left of the multiplication.
quaternion2
The quaternion on the right of the multiplication.
result
[OutAttribute] The result of the multiplication.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Multiply Method (Quaternion, Single)

Quaternion.Multiply Method (Quaternion, Single)
See Also
CollapseAll image

Multiplies a quaternion by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Multiply (
         Quaternion quaternion1,
         float scaleFactor
)

Parameters

quaternion1
Source quaternion.
scaleFactor
Scalar value.

Return Value

The result of the multiplication.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Multiply Method (Quaternion, Single, Quaternion)

Quaternion.Multiply Method (Quaternion, Single, Quaternion)
See Also
CollapseAll image

Multiplies a quaternion by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Multiply (
         ref Quaternion quaternion1,
         float scaleFactor,
         out Quaternion result
)

Parameters

quaternion1
Source quaternion.
scaleFactor
Scalar value.
result
[OutAttribute] The result of the multiplication.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Negate Method

Quaternion.Negate Method

Flips the sign of each component of the quaternion.

Expand image Overload List

Name | Description
Quaternion.Negate (Quaternion) | Flips the sign of each component of the quaternion.
Quaternion.Negate (Quaternion, Quaternion) | Flips the sign of each component of the quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Negate Method (Quaternion)

Quaternion.Negate Method (Quaternion)
See Also
CollapseAll image

Flips the sign of each component of the quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Negate (
         Quaternion quaternion
)

Parameters

quaternion
Source quaternion.

Return Value

Negated quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Negate Method (Quaternion, Quaternion)

Quaternion.Negate Method (Quaternion, Quaternion)
See Also
CollapseAll image

Flips the sign of each component of the quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Negate (
         ref Quaternion quaternion,
         out Quaternion result
)

Parameters

quaternion
Source quaternion.
result
[OutAttribute] Negated quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Normalize Method

Quaternion.Normalize Method

Divides each component of a quaternion by the length of the quaternion.

Expand image Overload List

Name | Description
Quaternion.Normalize () | Divides each component of the quaternion by the length of the quaternion.
Quaternion.Normalize (Quaternion) | Divides each component of the quaternion by the length of the quaternion.
Quaternion.Normalize (Quaternion, Quaternion) | Divides each component of the quaternion by the length of the quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Normalize Method ()

Quaternion.Normalize Method ()
See Also
CollapseAll image

Divides each component of the quaternion by the length of the quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Normalize ()

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Normalize Method (Quaternion)

Quaternion.Normalize Method (Quaternion)
See Also
CollapseAll image

Divides each component of the quaternion by the length of the quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Normalize (
         Quaternion quaternion
)

Parameters

quaternion
Source quaternion.

Return Value

Normalized quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Normalize Method (Quaternion, Quaternion)

Quaternion.Normalize Method (Quaternion, Quaternion)
See Also
CollapseAll image

Divides each component of the quaternion by the length of the quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Normalize (
         ref Quaternion quaternion,
         out Quaternion result
)

Parameters

quaternion
Source quaternion.
result
[OutAttribute] Normalized quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.op_Addition Method

Quaternion.op_Addition Method

Adds two Quaternions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion op_Addition (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
Quaternion to add.
quaternion2
Quaternion to add.

Return Value

Result of adding the Quaternions.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.op_Division Method

Quaternion.op_Division Method

Divides a Quaternion by another Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion op_Division (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
Source Quaternion.
quaternion2
The divisor.

Return Value

Result of the division.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.op_Equality Method

Quaternion.op_Equality Method

Compares two Quaternions for equality.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
Source Quaternion.
quaternion2
Source Quaternion.

Return Value

true if the Quaternions are equal, false otherwise.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.op_Inequality Method

Quaternion.op_Inequality Method

Compare two Quaternions for inequality.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
Source Quaternion.
quaternion2
Source Quaternion.

Return Value

true if the Quaternions are not equal; false otherwise.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.op_Multiply Method

Quaternion.op_Multiply Method

Multiplies a quaternion by a scalar or another quaternion.

Expand image Overload List

Name | Description
Quaternion.op_Multiply (Quaternion, Quaternion) | Multiplies two quaternions.
Quaternion.op_Multiply (Quaternion, Single) | Multiplies a quaternion by a scalar value.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.op_Multiply Method (Quaternion, Quaternion)

Quaternion.op_Multiply Method (Quaternion, Quaternion)
See Also
CollapseAll image

Multiplies two quaternions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion op_Multiply (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
Source quaternion.
quaternion2
Source quaternion.

Return Value

The result of the multiplication.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.op_Multiply Method (Quaternion, Single)

Quaternion.op_Multiply Method (Quaternion, Single)
See Also
CollapseAll image

Multiplies a quaternion by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion op_Multiply (
         Quaternion quaternion1,
         float scaleFactor
)

Parameters

quaternion1
Source quaternion.
scaleFactor
Scalar value.

Return Value

The result of the multiplication.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.op_Subtraction Method

Quaternion.op_Subtraction Method

Subtracts a quaternion from another quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion op_Subtraction (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
Source quaternion.
quaternion2
Source quaternion.

Return Value

Result of the subtraction.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.op_UnaryNegation Method

Quaternion.op_UnaryNegation Method

Flips the sign of each component of the quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion op_UnaryNegation (
         Quaternion quaternion
)

Parameters

quaternion
Source quaternion.

Return Value

Negated quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Slerp Method

Quaternion.Slerp Method

Interpolates between two quaternions, using spherical linear interpolation.

Expand image Overload List

Name | Description
Quaternion.Slerp (Quaternion, Quaternion, Single) | Interpolates between two quaternions, using spherical linear interpolation.
Quaternion.Slerp (Quaternion, Quaternion, Single, Quaternion) | Interpolates between two quaternions, using spherical linear interpolation.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Slerp Method (Quaternion, Quaternion, Single)

Quaternion.Slerp Method (Quaternion, Quaternion, Single)
See Also
CollapseAll image

Interpolates between two quaternions, using spherical linear interpolation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Slerp (
         Quaternion quaternion1,
         Quaternion quaternion2,
         float amount
)

Parameters

quaternion1
Source quaternion.
quaternion2
Source quaternion.
amount
Value that indicates how far to interpolate between the quaternions.

Return Value

Result of the interpolation.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Slerp Method (Quaternion, Quaternion, Single, Quaternion)

Quaternion.Slerp Method (Quaternion, Quaternion, Single, Quaternion)
See Also
CollapseAll image

Interpolates between two quaternions, using spherical linear interpolation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Slerp (
         ref Quaternion quaternion1,
         ref Quaternion quaternion2,
         float amount,
         out Quaternion result
)

Parameters

quaternion1
Source quaternion.
quaternion2
Source quaternion.
amount
Value that indicates how far to interpolate between the quaternions.
result
[OutAttribute] Result of the interpolation.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Subtract Method

Quaternion.Subtract Method

Subtracts a quaternion from another quaternion.

Expand image Overload List

Name | Description
Quaternion.Subtract (Quaternion, Quaternion) | Subtracts a quaternion from another quaternion.
Quaternion.Subtract (Quaternion, Quaternion, Quaternion) | Subtracts a quaternion from another quaternion.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace


Quaternion.Subtract Method (Quaternion, Quaternion)

Quaternion.Subtract Method (Quaternion, Quaternion)
See Also
CollapseAll image

Subtracts a quaternion from another quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Subtract (
         Quaternion quaternion1,
         Quaternion quaternion2
)

Parameters

quaternion1
Source quaternion.
quaternion2
Source quaternion.

Return Value

Result of the subtraction.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.Subtract Method (Quaternion, Quaternion, Quaternion)

Quaternion.Subtract Method (Quaternion, Quaternion, Quaternion)
See Also
CollapseAll image

Subtracts a quaternion from another quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Subtract (
         ref Quaternion quaternion1,
         ref Quaternion quaternion2,
         out Quaternion result
)

Parameters

quaternion1
Source quaternion.
quaternion2
Source quaternion.
result
[OutAttribute] Result of the subtraction.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion.ToString Method

Quaternion.ToString Method

Retireves a string representation of the current object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Quaternion Properties

Quaternion Properties

Expand image Public Properties

Name | Description
Identity | Returns a Quaternion representing no rotation.

Expand image See Also

Reference

Quaternion Structure
Microsoft.Xna.Framework Namespace


Quaternion.Identity Property

Quaternion.Identity Property

Returns a Quaternion representing no rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Quaternion Identity { get; }

Property Value

The identity Quaternion (0,0,0,1).

Expand image See Also

Reference

Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray Structure

Ray Structure

Defines a ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.RayConverter)")]
[SerializableAttribute()]
public struct Ray : IEquatable<Ray>

Expand image See Also

Reference

Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray Members

Ray Members
See Also Constructors Fields Methods
CollapseAll image

The following tables list the members exposed by the Ray type.

Expand image Public Constructors

 | Name | Description
Public Method | Ray | Creates a new instance of Ray.

Expand image Public Fields

 | Name | Description
Public Field | Direction | Unit vector specifying the direction the Ray is pointing.
Public Field | Position | Specifies the starting point of the Ray.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Determines whether two instances of Ray are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
Public Method | Intersects | Overloaded. Checks whether the Ray intersects a specified plane or bounding volume.
 | op_Equality | Determines whether two instances of Ray are equal.
 | op_Inequality | Determines whether two instances of Ray are not equal.
Public Method | ToString | Returns a String that represents the current Ray.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Ray Structure
Microsoft.Xna.Framework Namespace


Ray Fields

Ray Fields

Expand image Public Fields

 | Name | Description
Public Field | Direction | Unit vector specifying the direction the Ray is pointing.
Public Field | Position | Specifies the starting point of the Ray.

Expand image See Also

Reference

Ray Structure
Microsoft.Xna.Framework Namespace


Ray.Direction Field

Ray.Direction Field

Unit vector specifying the direction the Ray is pointing.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Direction

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.Position Field

Ray.Position Field

Specifies the starting point of the Ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Position

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray Constructor

Ray Constructor

Creates a new instance of Ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Ray (
         Vector3 position,
         Vector3 direction
)

Parameters

position
The starting point of the Ray.
direction
Unit vector describing the direction of the Ray.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray Methods

Ray Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Determines whether two instances of Ray are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
Public Method | Intersects | Overloaded. Checks whether the Ray intersects a specified plane or bounding volume.
 | op_Equality | Determines whether two instances of Ray are equal.
 | op_Inequality | Determines whether two instances of Ray are not equal.
Public Method | ToString | Returns a String that represents the current Ray.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Ray Structure
Microsoft.Xna.Framework Namespace


Ray.Equals Method

Ray.Equals Method

Determines whether two instances of Ray are equal.

Expand image Overload List

Name | Description
Ray.Equals (Object) | Determines whether two instances of Ray are equal.
Ray.Equals (Ray) | Determines whether the specified Ray is equal to the current Ray.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace


Ray.Equals Method (Object)

Ray.Equals Method (Object)
See Also
CollapseAll image

Determines whether two instances of Ray are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current Ray.

Return Value

true if the specified Object is equal to the current Ray; false otherwise.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.Equals Method (Ray)

Ray.Equals Method (Ray)
See Also
CollapseAll image

Determines whether the specified Ray is equal to the current Ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Ray other
)

Parameters

other
The Ray to compare with the current Ray.

Return Value

true if the specified Ray is equal to the current Ray; false otherwise.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.GetHashCode Method

Ray.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

A hash code for the current Ray.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.Intersects Method

Ray.Intersects Method

Checks whether the Ray intersects a specified plane or bounding volume.

Expand image Overload List

Name | Description
Ray.Intersects (BoundingBox) | Checks whether the Ray intersects a specified BoundingBox.
Ray.Intersects (BoundingBox, Nullable<Single>) | Checks whether the current Ray intersects a BoundingBox.
Ray.Intersects (BoundingFrustum) | Checks whether the Ray intersects a specified BoundingFrustum.
Ray.Intersects (BoundingSphere) | Checks whether the Ray intersects a specified BoundingSphere.
Ray.Intersects (BoundingSphere, Nullable<Single>) | Checks whether the current Ray intersects a BoundingSphere.
Ray.Intersects (Plane) | Determines whether this Ray intersects a specified Plane.
Ray.Intersects (Plane, Nullable<Single>) | Determines whether this Ray intersects a specified Plane.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace


Ray.Intersects Method (BoundingBox)

Ray.Intersects Method (BoundingBox)
See Also
CollapseAll image

Checks whether the Ray intersects a specified BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Nullable<float> Intersects (
         BoundingBox box
)

Parameters

box
The BoundingBox to check for intersection with the Ray.

Return Value

Distance at which the ray intersects the BoundingBox or null if there is no intersection.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.Intersects Method (BoundingBox, Nullable<Single>)

Ray.Intersects Method (BoundingBox, Nullable<Single>)
See Also
CollapseAll image

Checks whether the current Ray intersects a BoundingBox.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref BoundingBox box,
         out Nullable<float> result
)

Parameters

box
The BoundingBox to check for intersection with.
result
[OutAttribute] Distance at which the ray intersects the BoundingBox or null if there is no intersection.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.Intersects Method (BoundingFrustum)

Ray.Intersects Method (BoundingFrustum)
See Also
CollapseAll image

Checks whether the Ray intersects a specified BoundingFrustum.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Nullable<float> Intersects (
         BoundingFrustum frustum
)

Parameters

frustum
The BoundingFrustum to check for intersection with the Ray.

Return Value

Distance at which the ray intersects the BoundingFrustum or null if there is no intersection.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | frustum is null.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.Intersects Method (BoundingSphere)

Ray.Intersects Method (BoundingSphere)
See Also
CollapseAll image

Checks whether the Ray intersects a specified BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Nullable<float> Intersects (
         BoundingSphere sphere
)

Parameters

sphere
The BoundingSphere to check for intersection with the Ray.

Return Value

Distance at which the ray intersects the BoundingSphere or null if there is no intersection.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.Intersects Method (BoundingSphere, Nullable<Single>)

Ray.Intersects Method (BoundingSphere, Nullable<Single>)
See Also
CollapseAll image

Checks whether the current Ray intersects a BoundingSphere.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref BoundingSphere sphere,
         out Nullable<float> result
)

Parameters

sphere
The BoundingSphere to check for intersection with.
result
[OutAttribute] Distance at which the ray intersects the BoundingSphere or null if there is no intersection.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.Intersects Method (Plane)

Ray.Intersects Method (Plane)
See Also
CollapseAll image

Determines whether this Ray intersects a specified Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Nullable<float> Intersects (
         Plane plane
)

Parameters

plane
The Plane with which to calculate this Ray's intersection.

Return Value

The distance at which this Ray intersects the specified Plane, or null if there is no intersection.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.Intersects Method (Plane, Nullable<Single>)

Ray.Intersects Method (Plane, Nullable<Single>)
See Also
CollapseAll image

Determines whether this Ray intersects a specified Plane.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref Plane plane,
         out Nullable<float> result
)

Parameters

plane
The Plane with which to calculate this Ray's intersection.
result
[OutAttribute] The distance at which this Ray intersects the specified Plane, or null if there is no intersection.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.op_Equality Method

Ray.op_Equality Method

Determines whether two instances of Ray are equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Ray a,
         Ray b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if left is equal to right; false otherwise.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.op_Inequality Method

Ray.op_Inequality Method

Determines whether two instances of Ray are not equal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Ray a,
         Ray b
)

Parameters

a
The object to the left of the inequality operator.
b
The object to the right of the inequality operator.

Return Value

true if left is not equal to right; false otherwise.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Ray.ToString Method

Ray.ToString Method

Returns a String that represents the current Ray.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of the current Ray.

Expand image See Also

Reference

Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle Structure

Rectangle Structure

Defines a rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.RectangleConverter)")]
[SerializableAttribute]
public struct Rectangle : IEquatable<Rectangle>

Expand image See Also

Reference

Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle Members

Rectangle Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the Rectangle type.

Expand image Public Constructors

 | Name | Description
Public Method | Rectangle | Initializes a new instance of Rectangle.

Expand image Public Fields

 | Name | Description
Public Field | Height | Specifies the height of the rectangle.
Public Field | Width | Specifies the width of the rectangle.
Public Field | X | Specifies the x-coordinate of the rectangle.
Public Field | Y | Specifies the y-coordinate of the rectangle.

Expand image Public Properties

 | Name | Description
Public Property | Bottom | Returns the y-coordinate of the bottom of the rectangle.
Public Property | Center | Gets the Point that specifies the center of the rectangle.
 | Empty | Returns a Rectangle with all of its values set to zero.
Public Property | IsEmpty | Gets a value that indicates whether the Rectangle is empty.
Public Property | Left | Returns the x-coordinate of the left side of the rectangle.
Public Property | Location | Gets or sets the upper-left value of the Rectangle.
Public Property | Right | Returns the x-coordinate of the right side of the rectangle.
Public Property | Top | Returns the y-coordinate of the top of the rectangle.

Expand image Public Methods

 | Name | Description
Public Method | Contains | Overloaded. Determines whether this Rectangle contains a specified point or Rectangle.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this object.
Public Method | GetType | (Inherited from Object.)
Public Method | Inflate | Pushes the edges of the Rectangle out by the horizontal and vertical values specified.
 | Intersect | Overloaded. Creates a Rectangle defining the area where one rectangle overlaps another rectangle.
Public Method | Intersects | Overloaded. Determines whether a specified Rectangle intersects with this Rectangle.
Public Method | Offset | Overloaded. Changes the position of the Rectangle.
 | op_Equality | Compares two rectangles for equality.
 | op_Inequality | Compares two rectangles for inequality.
Public Method | ToString | Retrieves a string representation of the current object.
 | Union | Overloaded. Creates a new Rectangle that exactly contains two other rectangles.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Rectangle Structure
Microsoft.Xna.Framework Namespace


Rectangle Fields

Rectangle Fields

Expand image Public Fields

 | Name | Description
Public Field | Height | Specifies the height of the rectangle.
Public Field | Width | Specifies the width of the rectangle.
Public Field | X | Specifies the x-coordinate of the rectangle.
Public Field | Y | Specifies the y-coordinate of the rectangle.

Expand image See Also

Reference

Rectangle Structure
Microsoft.Xna.Framework Namespace


Rectangle.Height Field

Rectangle.Height Field

Specifies the height of the rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Height

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Width Field

Rectangle.Width Field

Specifies the width of the rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Width

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.X Field

Rectangle.X Field

Specifies the x-coordinate of the rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int X

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Y Field

Rectangle.Y Field

Specifies the y-coordinate of the rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Y

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle Constructor

Rectangle Constructor

Initializes a new instance of Rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Rectangle (
         int x,
         int y,
         int width,
         int height
)

Parameters

x
The x-coordinate of the rectangle.
y
The y-coordinate of the rectangle.
width
Width of the rectangle.
height
Height of the rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle Methods

Rectangle Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | Overloaded. Determines whether this Rectangle contains a specified point or Rectangle.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this object.
Public Method | GetType | (Inherited from Object.)
Public Method | Inflate | Pushes the edges of the Rectangle out by the horizontal and vertical values specified.
 | Intersect | Overloaded. Creates a Rectangle defining the area where one rectangle overlaps another rectangle.
Public Method | Intersects | Overloaded. Determines whether a specified Rectangle intersects with this Rectangle.
Public Method | Offset | Overloaded. Changes the position of the Rectangle.
 | op_Equality | Compares two rectangles for equality.
 | op_Inequality | Compares two rectangles for inequality.
Public Method | ToString | Retrieves a string representation of the current object.
 | Union | Overloaded. Creates a new Rectangle that exactly contains two other rectangles.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Rectangle Structure
Microsoft.Xna.Framework Namespace


Rectangle.Contains Method

Rectangle.Contains Method

Determines whether this Rectangle contains a specified point or Rectangle.

Expand image Overload List

Name | Description
Rectangle.Contains (Int32, Int32) | Determines whether this Rectangle contains a specified point represented by its x- and y-coordinates.
Rectangle.Contains (Point) | Determines whether this Rectangle contains a specified Point.
Rectangle.Contains (Point, Boolean) | Determines whether this Rectangle contains a specified Point.
Rectangle.Contains (Rectangle) | Determines whether this Rectangle entirely contains a specified Rectangle.
Rectangle.Contains (Rectangle, Boolean) | Determines whether this Rectangle entirely contains a specified Rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace


Rectangle.Contains Method (Int32, Int32)

Rectangle.Contains Method (Int32, Int32)
See Also
CollapseAll image

Determines whether this Rectangle contains a specified point represented by its x- and y-coordinates.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Contains (
         int x,
         int y
)

Parameters

x
The x-coordinate of the specified point.
y
The y-coordinate of the specified point.

Return Value

true if the specified point is contained within this Rectangle; false otherwise.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Contains Method (Point)

Rectangle.Contains Method (Point)
See Also
CollapseAll image

Determines whether this Rectangle contains a specified Point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Contains (
         Point value
)

Parameters

value
The Point to evaluate.

Return Value

true if the specified Point is contained within this Rectangle; false otherwise.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Contains Method (Point, Boolean)

Rectangle.Contains Method (Point, Boolean)
See Also
CollapseAll image

Determines whether this Rectangle contains a specified Point.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref Point value,
         out bool result
)

Parameters

value
The Point to evaluate.
result
[OutAttribute] true if the specified Point is contained within this Rectangle; false otherwise.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Contains Method (Rectangle)

Rectangle.Contains Method (Rectangle)
See Also
CollapseAll image

Determines whether this Rectangle entirely contains a specified Rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Contains (
         Rectangle value
)

Parameters

value
The Rectangle to evaluate.

Return Value

true if this Rectangle entirely contains the specified Rectangle; false otherwise.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Contains Method (Rectangle, Boolean)

Rectangle.Contains Method (Rectangle, Boolean)
See Also
CollapseAll image

Determines whether this Rectangle entirely contains a specified Rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Contains (
         ref Rectangle value,
         out bool result
)

Parameters

value
The Rectangle to evaluate.
result
[OutAttribute] On exit, is true if this Rectangle entirely contains the specified Rectangle, or false if not.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Equals Method

Rectangle.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Rectangle.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.
Rectangle.Equals (Rectangle) | Determines whether the specified Object is equal to the Rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace


Rectangle.Equals Method (Object)

Rectangle.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to make the comparison with.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Equals Method (Rectangle)

Rectangle.Equals Method (Rectangle)
See Also
CollapseAll image

Determines whether the specified Object is equal to the Rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Rectangle other
)

Parameters

other
The Object to compare with the current Rectangle.

Return Value

true if the specified Object is equal to the current Rectangle; false otherwise.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.GetHashCode Method

Rectangle.GetHashCode Method

Gets the hash code for this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Inflate Method

Rectangle.Inflate Method

Pushes the edges of the Rectangle out by the horizontal and vertical values specified.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Inflate (
         int horizontalAmount,
         int verticalAmount
)

Parameters

horizontalAmount
Value to push the sides out by.
verticalAmount
Value to push the top and bottom out by.

Expand image Remarks

Each corner of the Rectangle is pushed away from the center of the rectangle by the specified amounts. This results in the width and height of the Rectangle increasing by twice the values provided.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Intersect Method

Rectangle.Intersect Method

Creates a Rectangle defining the area where one rectangle overlaps another rectangle.

Expand image Overload List

Name | Description
Rectangle.Intersect (Rectangle, Rectangle) | Creates a Rectangle defining the area where one rectangle overlaps with another rectangle.
Rectangle.Intersect (Rectangle, Rectangle, Rectangle) | Creates a Rectangle defining the area where one rectangle overlaps with another rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace


Rectangle.Intersect Method (Rectangle, Rectangle)

Rectangle.Intersect Method (Rectangle, Rectangle)
See Also
CollapseAll image

Creates a Rectangle defining the area where one rectangle overlaps with another rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Rectangle Intersect (
         Rectangle value1,
         Rectangle value2
)

Parameters

value1
The first Rectangle to compare.
value2
The second Rectangle to compare.

Return Value

The area where the two parameters overlap.

Expand image Remarks

If the two rectangles do not overlap, the resulting Rectangle will be empty.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Intersect Method (Rectangle, Rectangle, Rectangle)

Rectangle.Intersect Method (Rectangle, Rectangle, Rectangle)
See Also
CollapseAll image

Creates a Rectangle defining the area where one rectangle overlaps with another rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Intersect (
         ref Rectangle value1,
         ref Rectangle value2,
         out Rectangle result
)

Parameters

value1
The first Rectangle to compare.
value2
The second Rectangle to compare.
result
[OutAttribute] The area where the two first parameters overlap.

Expand image Remarks

If the two rectangles do not overlap, the resulting Rectangle will be empty.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Intersects Method

Rectangle.Intersects Method

Determines whether a specified Rectangle intersects with this Rectangle.

Expand image Overload List

Name | Description
Rectangle.Intersects (Rectangle) | Determines whether a specified Rectangle intersects with this Rectangle.
Rectangle.Intersects (Rectangle, Boolean) | Determines whether a specified Rectangle intersects with this Rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace


Rectangle.Intersects Method (Rectangle)

Rectangle.Intersects Method (Rectangle)
See Also
CollapseAll image

Determines whether a specified Rectangle intersects with this Rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Intersects (
         Rectangle value
)

Parameters

value
The Rectangle to evaluate.

Return Value

true if the specified Rectangle intersects with this one; false otherwise.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Intersects Method (Rectangle, Boolean)

Rectangle.Intersects Method (Rectangle, Boolean)
See Also
CollapseAll image

Determines whether a specified Rectangle intersects with this Rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Intersects (
         ref Rectangle value,
         out bool result
)

Parameters

value
The Rectangle to evaluate
result
[OutAttribute] true if the specified Rectangle intersects with this one; false otherwise.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Offset Method

Rectangle.Offset Method

Changes the position of the Rectangle.

Expand image Overload List

Name | Description
Rectangle.Offset (Int32, Int32) | Changes the position of the Rectangle.
Rectangle.Offset (Point) | Changes the position of the Rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace


Rectangle.Offset Method (Int32, Int32)

Rectangle.Offset Method (Int32, Int32)
See Also
CollapseAll image

Changes the position of the Rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Offset (
         int offsetX,
         int offsetY
)

Parameters

offsetX
Change in the x-position.
offsetY
Change in the y-position.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Offset Method (Point)

Rectangle.Offset Method (Point)
See Also
CollapseAll image

Changes the position of the Rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Offset (
         Point amount
)

Parameters

amount
The values to adjust the position of the Rectangle by.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.op_Equality Method

Rectangle.op_Equality Method

Compares two rectangles for equality.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Rectangle a,
         Rectangle b
)

Parameters

a
Source rectangle.
b
Source rectangle.

Return Value

true if the rectangles are equal; false otherwise.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.op_Inequality Method

Rectangle.op_Inequality Method

Compares two rectangles for inequality.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Rectangle a,
         Rectangle b
)

Parameters

a
Source rectangle.
b
Source rectangle.

Return Value

true if the rectangles are not equal; false otherwise.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.ToString Method

Rectangle.ToString Method

Retrieves a string representation of the current object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Union Method

Rectangle.Union Method

Creates a new Rectangle that exactly contains two other rectangles.

Expand image Overload List

Name | Description
Rectangle.Union (Rectangle, Rectangle) | Creates a new Rectangle that exactly contains two other rectangles.
Rectangle.Union (Rectangle, Rectangle, Rectangle) | Creates a new Rectangle that exactly contains two other rectangles.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace


Rectangle.Union Method (Rectangle, Rectangle)

Rectangle.Union Method (Rectangle, Rectangle)
See Also
CollapseAll image

Creates a new Rectangle that exactly contains two other rectangles.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Rectangle Union (
         Rectangle value1,
         Rectangle value2
)

Parameters

value1
The first Rectangle to contain.
value2
The second Rectangle to contain.

Return Value

The union of the two Rectangle parameters.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Union Method (Rectangle, Rectangle, Rectangle)

Rectangle.Union Method (Rectangle, Rectangle, Rectangle)
See Also
CollapseAll image

Creates a new Rectangle that exactly contains two other rectangles.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Union (
         ref Rectangle value1,
         ref Rectangle value2,
         out Rectangle result
)

Parameters

value1
The first Rectangle to contain.
value2
The second Rectangle to contain.
result
[OutAttribute] The Rectangle that must be the union of the first two rectangles.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle Properties

Rectangle Properties

Expand image Public Properties

 | Name | Description
Public Property | Bottom | Returns the y-coordinate of the bottom of the rectangle.
Public Property | Center | Gets the Point that specifies the center of the rectangle.
 | Empty | Returns a Rectangle with all of its values set to zero.
Public Property | IsEmpty | Gets a value that indicates whether the Rectangle is empty.
Public Property | Left | Returns the x-coordinate of the left side of the rectangle.
Public Property | Location | Gets or sets the upper-left value of the Rectangle.
Public Property | Right | Returns the x-coordinate of the right side of the rectangle.
Public Property | Top | Returns the y-coordinate of the top of the rectangle.

Expand image See Also

Reference

Rectangle Structure
Microsoft.Xna.Framework Namespace


Rectangle.Bottom Property

Rectangle.Bottom Property

Returns the y-coordinate of the bottom of the rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Bottom { get; }

Property Value

The y-coordinate of the bottom of the rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Center Property

Rectangle.Center Property

Gets the Point that specifies the center of the rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Point Center { get; }

Property Value

The center of the rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Empty Property

Rectangle.Empty Property

Returns a Rectangle with all of its values set to zero.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Rectangle Empty { get; }

Property Value

An empty Rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.IsEmpty Property

Rectangle.IsEmpty Property

Gets a value that indicates whether the Rectangle is empty.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsEmpty { get; }

Property Value

true if the rectangle is empty, otherwise false.

Expand image Remarks

An empty rectangle has all its values set to 0.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Left Property

Rectangle.Left Property

Returns the x-coordinate of the left side of the rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Left { get; }

Property Value

The x-coordinate of the left side of the rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Location Property

Rectangle.Location Property

Gets or sets the upper-left value of the Rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Point Location { get; set; }

Property Value

The new upper-left corner of the Rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Right Property

Rectangle.Right Property

Returns the x-coordinate of the right side of the rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Right { get; }

Property Value

The x-coordinate of the right side of the rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rectangle.Top Property

Rectangle.Top Property

Returns the y-coordinate of the top of the rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Top { get; }

Property Value

The y-coordinate of the top of the rectangle.

Expand image See Also

Reference

Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TitleContainer Class

TitleContainer Class
See Also Members
CollapseAll image

Provides file stream access to the title's default storage location.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static class TitleContainer

Expand image See Also

Reference

TitleContainer Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TitleContainer Members

TitleContainer Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the TitleContainer type.

Expand image Public Methods

Name | Description
OpenStream | Returns a stream to an existing file in the default title storage location.

Expand image See Also

Reference

TitleContainer Class
Microsoft.Xna.Framework Namespace


TitleContainer Methods

TitleContainer Methods

Expand image Public Methods

Name | Description
OpenStream | Returns a stream to an existing file in the default title storage location.

Expand image See Also

Reference

TitleContainer Class
Microsoft.Xna.Framework Namespace


TitleContainer.OpenStream Method

TitleContainer.OpenStream Method

Returns a stream to an existing file in the default title storage location.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Stream OpenStream (
         string name
)

Parameters

name
The name of the file to open.

Return Value

The file stream that can be used to read the file's data.

Expand image Remarks

The stream returned is read-only. The file to be read must already exist, or this method will fail.

Expand image See Also

Reading Game Data from Title Storage

Reference

TitleContainer Class
TitleContainer Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2 Structure

Vector2 Structure

Defines a vector with two components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.Vector2Converter)")]
[SerializableAttribute]
public struct Vector2 : IEquatable<Vector2>

Expand image See Also

Reference

Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2 Members

Vector2 Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the Vector2 type.

Expand image Public Constructors

 | Name | Description
Public Method | Vector2 | Overloaded. Initializes a new instance of Vector2.

Expand image Public Fields

 | Name | Description
Public Field | X | Gets or sets the x-component of the vector.
Public Field | Y | Gets or sets the y-component of the vector.

Expand image Public Properties

Name | Description
One | Returns a Vector2 with both of its components set to one.
UnitX | Returns the unit vector for the x-axis.
UnitY | Returns the unit vector for the y-axis.
Zero | Returns a Vector2 with all of its components set to zero.

Expand image Public Methods

 | Name | Description
 | Add | Overloaded. Adds two vectors.
 | Barycentric | Overloaded. Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in 2D barycentric (areal) coordinates.
 | CatmullRom | Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
 | Clamp | Overloaded. Restricts a value to be within a specified range.
 | Distance | Overloaded. Calculates the distance between two vectors.
 | DistanceSquared | Overloaded. Calculates the distance between two vectors squared.
 | Divide | Overloaded. Divides a vector by a scalar or another vector.
 | Dot | Overloaded. Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code of the vector object.
Public Method | GetType | (Inherited from Object.)
 | Hermite | Overloaded. Performs a Hermite spline interpolation.
Public Method | Length | Calculates the length of the vector.
Public Method | LengthSquared | Calculates the length of the vector squared.
 | Lerp | Overloaded. Performs a linear interpolation between two vectors.
 | Max | Overloaded. Returns a vector that contains the highest value from each matching pair of components.
 | Min | Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
 | Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | Negate | Overloaded. Returns a vector pointing in the opposite direction.
Public Method | Normalize | Overloaded. Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
 | op_Addition | Adds two vectors.
 | op_Division | Overloaded. Divide a vector by a scalar or another vector.
 | op_Equality | Tests vectors for equality.
 | op_Inequality | Tests vectors for inequality.
 | op_Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | op_Subtraction | Subtracts a vector from a vector.
 | op_UnaryNegation | Returns a vector pointing in the opposite direction.
 | Reflect | Overloaded. Determines the reflect vector of the given vector and normal.
 | SmoothStep | Overloaded. Interpolates between two values using a cubic equation.
 | Subtract | Overloaded. Subtracts a vector from a vector.
Public Method | ToString | Retrieves a string representation of the current object.
 | Transform | Overloaded. Transforms one or more Vector2s by a Matrix or Quaternion.
 | TransformNormal | Overloaded. Transforms a vector normal or array of vector normals by a matrix.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Vector2 Structure
Microsoft.Xna.Framework Namespace


Vector2 Fields

Vector2 Fields

Expand image Public Fields

 | Name | Description
Public Field | X | Gets or sets the x-component of the vector.
Public Field | Y | Gets or sets the y-component of the vector.

Expand image See Also

Reference

Vector2 Structure
Microsoft.Xna.Framework Namespace


Vector2.X Field

Vector2.X Field

Gets or sets the x-component of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float X

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Y Field

Vector2.Y Field

Gets or sets the y-component of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Y

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2 Constructor

Vector2 Constructor

Initializes a new instance of Vector2.

Expand image Overload List

Name | Description
Vector2 (Single) | Creates a new instance of Vector2.
Vector2 (Single, Single) | Initializes a new instance of Vector2.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2 Constructor (Single)

Vector2 Constructor (Single)
See Also
CollapseAll image

Creates a new instance of Vector2.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 (
         float value
)

Parameters

value
Value to initialize both components to.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2 Constructor (Single, Single)

Vector2 Constructor (Single, Single)
See Also
CollapseAll image

Initializes a new instance of Vector2.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 (
         float x,
         float y
)

Parameters

x
Initial value for the x-component of the vector.
y
Initial value for the y-component of the vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2 Methods

Vector2 Methods

Expand image Public Methods

 | Name | Description
 | Add | Overloaded. Adds two vectors.
 | Barycentric | Overloaded. Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in 2D barycentric (areal) coordinates.
 | CatmullRom | Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
 | Clamp | Overloaded. Restricts a value to be within a specified range.
 | Distance | Overloaded. Calculates the distance between two vectors.
 | DistanceSquared | Overloaded. Calculates the distance between two vectors squared.
 | Divide | Overloaded. Divides a vector by a scalar or another vector.
 | Dot | Overloaded. Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code of the vector object.
Public Method | GetType | (Inherited from Object.)
 | Hermite | Overloaded. Performs a Hermite spline interpolation.
Public Method | Length | Calculates the length of the vector.
Public Method | LengthSquared | Calculates the length of the vector squared.
 | Lerp | Overloaded. Performs a linear interpolation between two vectors.
 | Max | Overloaded. Returns a vector that contains the highest value from each matching pair of components.
 | Min | Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
 | Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | Negate | Overloaded. Returns a vector pointing in the opposite direction.
Public Method | Normalize | Overloaded. Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
 | op_Addition | Adds two vectors.
 | op_Division | Overloaded. Divide a vector by a scalar or another vector.
 | op_Equality | Tests vectors for equality.
 | op_Inequality | Tests vectors for inequality.
 | op_Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | op_Subtraction | Subtracts a vector from a vector.
 | op_UnaryNegation | Returns a vector pointing in the opposite direction.
 | Reflect | Overloaded. Determines the reflect vector of the given vector and normal.
 | SmoothStep | Overloaded. Interpolates between two values using a cubic equation.
 | Subtract | Overloaded. Subtracts a vector from a vector.
Public Method | ToString | Retrieves a string representation of the current object.
 | Transform | Overloaded. Transforms one or more Vector2s by a Matrix or Quaternion.
 | TransformNormal | Overloaded. Transforms a vector normal or array of vector normals by a matrix.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Vector2 Structure
Microsoft.Xna.Framework Namespace


Vector2.Add Method

Vector2.Add Method

Adds two vectors.

Expand image Overload List

Name | Description
Vector2.Add (Vector2, Vector2) | Adds two vectors.
Vector2.Add (Vector2, Vector2, Vector2) | Adds two vectors.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Add Method (Vector2, Vector2)

Vector2.Add Method (Vector2, Vector2)
See Also
CollapseAll image

Adds two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Add (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Sum of the source vectors.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Add Method (Vector2, Vector2, Vector2)

Vector2.Add Method (Vector2, Vector2, Vector2)
See Also
CollapseAll image

Adds two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Add (
         ref Vector2 value1,
         ref Vector2 value2,
         out Vector2 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] Sum of the source vectors.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Barycentric Method

Vector2.Barycentric Method

Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in 2D barycentric (areal) coordinates.

Expand image Overload List

Name | Description
Vector2.Barycentric (Vector2, Vector2, Vector2, Single, Single) | Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.
Vector2.Barycentric (Vector2, Vector2, Vector2, Single, Single, Vector2) | Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Barycentric Method (Vector2, Vector2, Vector2, Single, Single)

Vector2.Barycentric Method (Vector2, Vector2, Vector2, Single, Single)
See Also
CollapseAll image

Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Barycentric (
         Vector2 value1,
         Vector2 value2,
         Vector2 value3,
         float amount1,
         float amount2
)

Parameters

value1
A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).

Return Value

A new Vector2 containing the 2D Cartesian coordinates of the specified point.

Expand image Remarks

About Barycentric Coordinates

Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to the location of the point, as specified in the following formulas.

    Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
    Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);

Such triple weighting factors b1, b2, and b3 are called barycentric coordinates.

Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same point as b1, b2, and b3 for any positive value of k.

If a set of barycentric coordinates is normalized so that b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3, since b1 equals (1 − b2 − b3).

What Vector2 Barycentric Does

The Vector2 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument, and b3 is the amount2 argument). The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.

Barycentric then calculates the Cartesian coordinate of P as follows:

    Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
    Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);

Thus, to calculate the 2D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric together with the appropropriate normalized barycentric coordinates of P.

The following relationships may be useful.

  • If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle defined by value1, value2, and value3.
  • If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value3.
  • If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value2.
  • If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by value2 and value3.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Barycentric Method (Vector2, Vector2, Vector2, Single, Single, Vector2)

Vector2.Barycentric Method (Vector2, Vector2, Vector2, Single, Single, Vector2)
See Also
CollapseAll image

Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Barycentric (
         ref Vector2 value1,
         ref Vector2 value2,
         ref Vector2 value3,
         float amount1,
         float amount2,
         out Vector2 result
)

Parameters

value1
A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
result
[OutAttribute] The 2D Cartesian coordinates of the specified point are placed in this Vector2 on exit.

Expand image Remarks

About Barycentric Coordinates

Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to the location of the point, as specified in the following formulas.

    Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
    Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);

Such triple weighting factors b1, b2, and b3 are called barycentric coordinates.

Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same point as b1, b2, and b3 for any positive value of k.

If a set of barycentric coordinates is normalized so that b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3, since b1 equals (1 − b2 − b3).

What Vector2 Barycentric Does

The Vector2 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument, and b3 is the amount2 argument). The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.

Barycentric then calculates the Cartesian coordinate of P as follows:

    Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
    Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);

Thus, to calculate the 2D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric together with the appropropriate normalized barycentric coordinates of P.

The following relationships may be useful.

  • If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle defined by value1, value2, and value3.
  • If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value3.
  • If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value2.
  • If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by value2 and value3.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.CatmullRom Method

Vector2.CatmullRom Method

Performs a Catmull-Rom interpolation using the specified positions.

Expand image Overload List

Name | Description
Vector2.CatmullRom (Vector2, Vector2, Vector2, Vector2, Single) | Performs a Catmull-Rom interpolation using the specified positions.
Vector2.CatmullRom (Vector2, Vector2, Vector2, Vector2, Single, Vector2) | Performs a Catmull-Rom interpolation using the specified positions.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.CatmullRom Method (Vector2, Vector2, Vector2, Vector2, Single)

Vector2.CatmullRom Method (Vector2, Vector2, Vector2, Vector2, Single)
See Also
CollapseAll image

Performs a Catmull-Rom interpolation using the specified positions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 CatmullRom (
         Vector2 value1,
         Vector2 value2,
         Vector2 value3,
         Vector2 value4,
         float amount
)

Parameters

value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.

Return Value

A vector that is the result of the Catmull-Rom interpolation.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.CatmullRom Method (Vector2, Vector2, Vector2, Vector2, Single, Vector2)

Vector2.CatmullRom Method (Vector2, Vector2, Vector2, Vector2, Single, Vector2)
See Also
CollapseAll image

Performs a Catmull-Rom interpolation using the specified positions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CatmullRom (
         ref Vector2 value1,
         ref Vector2 value2,
         ref Vector2 value3,
         ref Vector2 value4,
         float amount,
         out Vector2 result
)

Parameters

value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.
result
[OutAttribute] A vector that is the result of the Catmull-Rom interpolation.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Clamp Method

Vector2.Clamp Method

Restricts a value to be within a specified range.

Expand image Overload List

Name | Description
Vector2.Clamp (Vector2, Vector2, Vector2) | Restricts a value to be within a specified range.
Vector2.Clamp (Vector2, Vector2, Vector2, Vector2) | Restricts a value to be within a specified range.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Clamp Method (Vector2, Vector2, Vector2)

Vector2.Clamp Method (Vector2, Vector2, Vector2)
See Also
CollapseAll image

Restricts a value to be within a specified range.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Clamp (
         Vector2 value1,
         Vector2 min,
         Vector2 max
)

Parameters

value1
The value to clamp.
min
The minimum value.
max
The maximum value.

Return Value

The clamped value.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Clamp Method (Vector2, Vector2, Vector2, Vector2)

Vector2.Clamp Method (Vector2, Vector2, Vector2, Vector2)
See Also
CollapseAll image

Restricts a value to be within a specified range.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Clamp (
         ref Vector2 value1,
         ref Vector2 min,
         ref Vector2 max,
         out Vector2 result
)

Parameters

value1
The value to clamp.
min
The minimum value.
max
The maximum value.
result
[OutAttribute] The clamped value.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Distance Method

Vector2.Distance Method

Calculates the distance between two vectors.

Expand image Overload List

Name | Description
Vector2.Distance (Vector2, Vector2) | Calculates the distance between two vectors.
Vector2.Distance (Vector2, Vector2, Single) | Calculates the distance between two vectors.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Distance Method (Vector2, Vector2)

Vector2.Distance Method (Vector2, Vector2)
See Also
CollapseAll image

Calculates the distance between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Distance (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Distance between the two vectors.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Distance Method (Vector2, Vector2, Single)

Vector2.Distance Method (Vector2, Vector2, Single)
See Also
CollapseAll image

Calculates the distance between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Distance (
         ref Vector2 value1,
         ref Vector2 value2,
         out float result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the vectors.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.DistanceSquared Method

Vector2.DistanceSquared Method

Calculates the distance between two vectors squared.

Expand image Overload List

Name | Description
Vector2.DistanceSquared (Vector2, Vector2) | Calculates the distance between two vectors squared.
Vector2.DistanceSquared (Vector2, Vector2, Single) | Calculates the distance between two vectors squared.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.DistanceSquared Method (Vector2, Vector2)

Vector2.DistanceSquared Method (Vector2, Vector2)
See Also
CollapseAll image

Calculates the distance between two vectors squared.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float DistanceSquared (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

The distance between the source vectors squared.

Expand image Remarks

Distance is calculated with the formula:

Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A, compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square roots, which are computationally expensive. However, using distance squared provides the same information and avoids calculating two square roots.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.DistanceSquared Method (Vector2, Vector2, Single)

Vector2.DistanceSquared Method (Vector2, Vector2, Single)
See Also
CollapseAll image

Calculates the distance between two vectors squared.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void DistanceSquared (
         ref Vector2 value1,
         ref Vector2 value2,
         out float result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the vectors squared.

Expand image Remarks

Distance is calculated with the formula:

Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A, compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square roots, which are computationally expensive. However, using distance squared provides the same information and avoids calculating two square roots.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Divide Method

Vector2.Divide Method

Divides a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector2.Divide (Vector2, Single) | Divides a vector by a scalar value.
Vector2.Divide (Vector2, Single, Vector2) | Divides a vector by a scalar value.
Vector2.Divide (Vector2, Vector2) | Divides the components of a vector by the components of another vector.
Vector2.Divide (Vector2, Vector2, Vector2) | Divides the components of a vector by the components of another vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Divide Method (Vector2, Single)

Vector2.Divide Method (Vector2, Single)
See Also
CollapseAll image

Divides a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Divide (
         Vector2 value1,
         float divider
)

Parameters

value1
Source vector.
divider
The divisor.

Return Value

The result of the division.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Divide Method (Vector2, Single, Vector2)

Vector2.Divide Method (Vector2, Single, Vector2)
See Also
CollapseAll image

Divides a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Divide (
         ref Vector2 value1,
         float divider,
         out Vector2 result
)

Parameters

value1
Source vector.
divider
The divisor.
result
[OutAttribute] The result of the division.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Divide Method (Vector2, Vector2)

Vector2.Divide Method (Vector2, Vector2)
See Also
CollapseAll image

Divides the components of a vector by the components of another vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Divide (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Divisor vector.

Return Value

The result of dividing the vectors.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Divide Method (Vector2, Vector2, Vector2)

Vector2.Divide Method (Vector2, Vector2, Vector2)
See Also
CollapseAll image

Divides the components of a vector by the components of another vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Divide (
         ref Vector2 value1,
         ref Vector2 value2,
         out Vector2 result
)

Parameters

value1
Source vector.
value2
The divisor.
result
[OutAttribute] The result of the division.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Dot Method

Vector2.Dot Method

Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Expand image Overload List

Name | Description
Vector2.Dot (Vector2, Vector2) | Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
Vector2.Dot (Vector2, Vector2, Single) | Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Expand image Remarks

The dot product is also known as the inner product.

For any two vectors, the dot product is defined as:

(vector1.X * vector2.X) + (vector1.Y * vector2.Y)

The result of this calculation, plus or minus some margin to account for floating point error, is equal to:

Length( vector1 ) * Length( vector2 ) * System.Math.Cos( theta )

Here, theta is the angle between the two vectors.

If vector1 and vector2 are unit vectors, the length of each vector will be equal to 1. So, when vector1 and vector2 are unit vectors, the dot product is simply equal to the cosine of the angle between the two vectors. The following calculation:

Vector2.Dot( vector1.Normalize(), vector2.Normalize() )

Is equivalent to:

System.Math.Cos( theta )

Therefore, if vector1 and vector2 are unit vectors (i.e., we've called Normalize on each vector to make it a unit vector), without knowing the value of theta or using a potentially processor-intensive trigonometric function, the dot product can tell us the following things:

  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) > 0 , the angle between the two vectors is less than 90 degrees.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) < 0 , the angle between the two vectors is more than 90 degrees.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) == 0, the angle between the two vectors is 90 degrees; that is, the vectors are orthogonal.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) == 1, the angle between the two vectors is 0 degrees; that is, the vectors point in the same direction and are parallel.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) == -1, the angle between the two vectors is 180 degrees; that is, the vectors point in opposite directions and are parallel.
Caution
Because of floating point error, two orthogonal vectors may not return a dot product that is exactly zero. It might be zero plus some amount of floating point error. In your code, you will want to determine what amount of error is acceptable in your calculation, and take that into account when you do your comparisons.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Dot Method (Vector2, Vector2)

Vector2.Dot Method (Vector2, Vector2)
See Also
CollapseAll image

Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Dot (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

The dot product of the two vectors.

Expand image Remarks

The dot product is also known as the inner product.

For any two vectors, the dot product is defined as:

(vector1.X * vector2.X) + (vector1.Y * vector2.Y)

The result of this calculation, plus or minus some margin to account for floating point error, is equal to:

Length( vector1 ) * Length( vector2 ) * System.Math.Cos( theta )

Here, theta is the angle between the two vectors.

If vector1 and vector2 are unit vectors, the length of each vector will be equal to 1. So, when vector1 and vector2 are unit vectors, the dot product is simply equal to the cosine of the angle between the two vectors. The following calculation:

Vector2.Dot( vector1.Normalize(), vector2.Normalize() )

Is equivalent to:

System.Math.Cos( theta )

Therefore, if vector1 and vector2 are unit vectors (i.e., we've called Normalize on each vector to make it a unit vector), without knowing the value of theta or using a potentially processor-intensive trigonometric function, the dot product can tell us the following things:

  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) > 0 , the angle between the two vectors is less than 90 degrees.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) < 0 , the angle between the two vectors is more than 90 degrees.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) == 0, the angle between the two vectors is 90 degrees; that is, the vectors are orthogonal.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) == 1, the angle between the two vectors is 0 degrees; that is, the vectors point in the same direction and are parallel.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) == -1, the angle between the two vectors is 180 degrees; that is, the vectors point in opposite directions and are parallel.
Caution
Because of floating point error, two orthogonal vectors may not return a dot product that is exactly zero. It might be zero plus some amount of floating point error. In your code, you will want to determine what amount of error is acceptable in your calculation, and take that into account when you do your comparisons.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Dot Method (Vector2, Vector2, Single)

Vector2.Dot Method (Vector2, Vector2, Single)
See Also
CollapseAll image

Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Dot (
         ref Vector2 value1,
         ref Vector2 value2,
         out float result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The dot product of the two vectors.

Expand image Remarks

The dot product is also known as the inner product.

For any two vectors, the dot product is defined as:

(vector1.X * vector2.X) + (vector1.Y * vector2.Y)

The result of this calculation, plus or minus some margin to account for floating point error, is equal to:

Length( vector1 ) * Length( vector2 ) * System.Math.Cos( theta )

Here, theta is the angle between the two vectors.

If vector1 and vector2 are unit vectors, the length of each vector will be equal to 1. So, when vector1 and vector2 are unit vectors, the dot product is simply equal to the cosine of the angle between the two vectors. The following calculation:

Vector2.Dot( vector1.Normalize(), vector2.Normalize() )

Is equivalent to:

System.Math.Cos( theta )

Therefore, if vector1 and vector2 are unit vectors (i.e., we've called Normalize on each vector to make it a unit vector), without knowing the value of theta or using a potentially processor-intensive trigonometric function, the dot product can tell us the following things:

  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) > 0 , the angle between the two vectors is less than 90 degrees.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) < 0 , the angle between the two vectors is more than 90 degrees.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) == 0, the angle between the two vectors is 90 degrees; that is, the vectors are orthogonal.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) == 1, the angle between the two vectors is 0 degrees; that is, the vectors point in the same direction and are parallel.
  • If Vector2.Dot( vector1.Normalize(), vector2.Normalize() ) == -1, the angle between the two vectors is 180 degrees; that is, the vectors point in opposite directions and are parallel.
Caution
Because of floating point error, two orthogonal vectors may not return a dot product that is exactly zero. It might be zero plus some amount of floating point error. In your code, you will want to determine what amount of error is acceptable in your calculation, and take that into account when you do your comparisons.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Equals Method

Vector2.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Vector2.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.
Vector2.Equals (Vector2) | Determines whether the specified Object is equal to the Vector2.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Equals Method (Object)

Vector2.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to make the comparison with.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Equals Method (Vector2)

Vector2.Equals Method (Vector2)
See Also
CollapseAll image

Determines whether the specified Object is equal to the Vector2.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Vector2 other
)

Parameters

other
The Object to compare with the current Vector2.

Return Value

true if the specified Object is equal to the current Vector2; false otherwise.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.GetHashCode Method

Vector2.GetHashCode Method

Gets the hash code of the vector object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code of the vector object.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Hermite Method

Vector2.Hermite Method

Performs a Hermite spline interpolation.

Expand image Overload List

Name | Description
Vector2.Hermite (Vector2, Vector2, Vector2, Vector2, Single) | Performs a Hermite spline interpolation.
Vector2.Hermite (Vector2, Vector2, Vector2, Vector2, Single, Vector2) | Performs a Hermite spline interpolation.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Hermite Method (Vector2, Vector2, Vector2, Vector2, Single)

Vector2.Hermite Method (Vector2, Vector2, Vector2, Vector2, Single)
See Also
CollapseAll image

Performs a Hermite spline interpolation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Hermite (
         Vector2 value1,
         Vector2 tangent1,
         Vector2 value2,
         Vector2 tangent2,
         float amount
)

Parameters

value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.

Return Value

The result of the Hermite spline interpolation.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Hermite Method (Vector2, Vector2, Vector2, Vector2, Single, Vector2)

Vector2.Hermite Method (Vector2, Vector2, Vector2, Vector2, Single, Vector2)
See Also
CollapseAll image

Performs a Hermite spline interpolation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Hermite (
         ref Vector2 value1,
         ref Vector2 tangent1,
         ref Vector2 value2,
         ref Vector2 tangent2,
         float amount,
         out Vector2 result
)

Parameters

value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.
result
[OutAttribute] The result of the Hermite spline interpolation.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Length Method

Vector2.Length Method

Calculates the length of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Length ()

Return Value

Length of the vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.LengthSquared Method

Vector2.LengthSquared Method

Calculates the length of the vector squared.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float LengthSquared ()

Return Value

The length of the vector squared.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Lerp Method

Vector2.Lerp Method

Performs a linear interpolation between two vectors.

Expand image Overload List

Name | Description
Vector2.Lerp (Vector2, Vector2, Single) | Performs a linear interpolation between two vectors.
Vector2.Lerp (Vector2, Vector2, Single, Vector2) | Performs a linear interpolation between two vectors.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Lerp Method (Vector2, Vector2, Single)

Vector2.Lerp Method (Vector2, Vector2, Single)
See Also
CollapseAll image

Performs a linear interpolation between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Lerp (
         Vector2 value1,
         Vector2 value2,
         float amount
)

Parameters

value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.

Return Value

The linear interpolation of the two vectors.

Expand image Remarks

This method performs the linear interpolation based on the following formula.

value1 + (value2 - value1) * amount

Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Lerp Method (Vector2, Vector2, Single, Vector2)

Vector2.Lerp Method (Vector2, Vector2, Single, Vector2)
See Also
CollapseAll image

Performs a linear interpolation between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Lerp (
         ref Vector2 value1,
         ref Vector2 value2,
         float amount,
         out Vector2 result
)

Parameters

value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.
result
[OutAttribute] The result of the interpolation.

Expand image Remarks

This method performs the linear interpolation based on the following formula.

value1 + (value2 - value1) * amount

Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Max Method

Vector2.Max Method

Returns a vector that contains the highest value from each matching pair of components.

Expand image Overload List

Name | Description
Vector2.Max (Vector2, Vector2) | Returns a vector that contains the highest value from each matching pair of components.
Vector2.Max (Vector2, Vector2, Vector2) | Returns a vector that contains the highest value from each matching pair of components.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Max Method (Vector2, Vector2)

Vector2.Max Method (Vector2, Vector2)
See Also
CollapseAll image

Returns a vector that contains the highest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Max (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

The maximized vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Max Method (Vector2, Vector2, Vector2)

Vector2.Max Method (Vector2, Vector2, Vector2)
See Also
CollapseAll image

Returns a vector that contains the highest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Max (
         ref Vector2 value1,
         ref Vector2 value2,
         out Vector2 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The maximized vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Min Method

Vector2.Min Method

Returns a vector that contains the lowest value from each matching pair of components.

Expand image Overload List

Name | Description
Vector2.Min (Vector2, Vector2) | Returns a vector that contains the lowest value from each matching pair of components.
Vector2.Min (Vector2, Vector2, Vector2) | Returns a vector that contains the lowest value from each matching pair of components.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Min Method (Vector2, Vector2)

Vector2.Min Method (Vector2, Vector2)
See Also
CollapseAll image

Returns a vector that contains the lowest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Min (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

The minimized vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Min Method (Vector2, Vector2, Vector2)

Vector2.Min Method (Vector2, Vector2, Vector2)
See Also
CollapseAll image

Returns a vector that contains the lowest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Min (
         ref Vector2 value1,
         ref Vector2 value2,
         out Vector2 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The minimized vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Multiply Method

Vector2.Multiply Method

Multiplies a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector2.Multiply (Vector2, Single) | Multiplies a vector by a scalar value.
Vector2.Multiply (Vector2, Single, Vector2) | Multiplies a vector by a scalar value.
Vector2.Multiply (Vector2, Vector2) | Multiplies the components of two vectors by each other.
Vector2.Multiply (Vector2, Vector2, Vector2) | Multiplies the components of two vectors by each other.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Multiply Method (Vector2, Single)

Vector2.Multiply Method (Vector2, Single)
See Also
CollapseAll image

Multiplies a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Multiply (
         Vector2 value1,
         float scaleFactor
)

Parameters

value1
Source vector.
scaleFactor
Scalar value.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Multiply Method (Vector2, Single, Vector2)

Vector2.Multiply Method (Vector2, Single, Vector2)
See Also
CollapseAll image

Multiplies a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Multiply (
         ref Vector2 value1,
         float scaleFactor,
         out Vector2 result
)

Parameters

value1
Source vector.
scaleFactor
Scalar value.
result
[OutAttribute] The result of the multiplication.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Multiply Method (Vector2, Vector2)

Vector2.Multiply Method (Vector2, Vector2)
See Also
CollapseAll image

Multiplies the components of two vectors by each other.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Multiply (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the multiplication.

Expand image Remarks

Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the corresponding components of each vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Multiply Method (Vector2, Vector2, Vector2)

Vector2.Multiply Method (Vector2, Vector2, Vector2)
See Also
CollapseAll image

Multiplies the components of two vectors by each other.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Multiply (
         ref Vector2 value1,
         ref Vector2 value2,
         out Vector2 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the multiplication.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Negate Method

Vector2.Negate Method

Returns a vector pointing in the opposite direction.

Expand image Overload List

Name | Description
Vector2.Negate (Vector2) | Returns a vector pointing in the opposite direction.
Vector2.Negate (Vector2, Vector2) | Returns a vector pointing in the opposite direction.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Negate Method (Vector2)

Vector2.Negate Method (Vector2)
See Also
CollapseAll image

Returns a vector pointing in the opposite direction.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Negate (
         Vector2 value
)

Parameters

value
Source vector.

Return Value

Vector pointing in the opposite direction.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Negate Method (Vector2, Vector2)

Vector2.Negate Method (Vector2, Vector2)
See Also
CollapseAll image

Returns a vector pointing in the opposite direction.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Negate (
         ref Vector2 value,
         out Vector2 result
)

Parameters

value
Source vector.
result
[OutAttribute] Vector pointing in the opposite direction.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Normalize Method

Vector2.Normalize Method

Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.

Expand image Overload List

Name | Description
Vector2.Normalize () | Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector.
Vector2.Normalize (Vector2) | Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
Vector2.Normalize (Vector2, Vector2) | Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Normalize Method ()

Vector2.Normalize Method ()
See Also
CollapseAll image

Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Normalize ()

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Normalize Method (Vector2)

Vector2.Normalize Method (Vector2)
See Also
CollapseAll image

Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Normalize (
         Vector2 value
)

Parameters

value
Source Vector2.

Return Value

The created unit vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Normalize Method (Vector2, Vector2)

Vector2.Normalize Method (Vector2, Vector2)
See Also
CollapseAll image

Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Normalize (
         ref Vector2 value,
         out Vector2 result
)

Parameters

value
Source vector.
result
[OutAttribute] Normalized vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.op_Addition Method

Vector2.op_Addition Method

Adds two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 op_Addition (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Sum of the source vectors.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.op_Division Method

Vector2.op_Division Method

Divide a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector2.op_Division (Vector2, Single) | Divides a vector by a scalar value.
Vector2.op_Division (Vector2, Vector2) | Divides the components of a vector by the components of another vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.op_Division Method (Vector2, Single)

Vector2.op_Division Method (Vector2, Single)
See Also
CollapseAll image

Divides a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 op_Division (
         Vector2 value1,
         float divider
)

Parameters

value1
Source vector.
divider
The divisor.

Return Value

The source vector divided by b.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.op_Division Method (Vector2, Vector2)

Vector2.op_Division Method (Vector2, Vector2)
See Also
CollapseAll image

Divides the components of a vector by the components of another vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 op_Division (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Divisor vector.

Return Value

The result of dividing the vectors.

Expand image Remarks

Division of a vector by another vector is not mathematically defined. This method simply divides each component of a by the matching component of b.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.op_Equality Method

Vector2.op_Equality Method

Tests vectors for equality.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

true if the vectors are equal; false otherwise.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.op_Inequality Method

Vector2.op_Inequality Method

Tests vectors for inequality.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Vector to compare.
value2
Vector to compare.

Return Value

Returns true if the vectors are not equal, false otherwise.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.op_Multiply Method

Vector2.op_Multiply Method

Multiplies a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector2.op_Multiply (Single, Vector2) | Multiplies a vector by a scalar value.
Vector2.op_Multiply (Vector2, Single) | Multiplies a vector by a scalar value.
Vector2.op_Multiply (Vector2, Vector2) | Multiplies the components of two vectors by each other.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.op_Multiply Method (Single, Vector2)

Vector2.op_Multiply Method (Single, Vector2)
See Also
CollapseAll image

Multiplies a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 op_Multiply (
         float scaleFactor,
         Vector2 value
)

Parameters

scaleFactor
Scalar value.
value
Source vector.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.op_Multiply Method (Vector2, Single)

Vector2.op_Multiply Method (Vector2, Single)
See Also
CollapseAll image

Multiplies a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 op_Multiply (
         Vector2 value,
         float scaleFactor
)

Parameters

value
Source vector.
scaleFactor
Scalar value.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.op_Multiply Method (Vector2, Vector2)

Vector2.op_Multiply Method (Vector2, Vector2)
See Also
CollapseAll image

Multiplies the components of two vectors by each other.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 op_Multiply (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the multiplication.

Expand image Remarks

Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the corresponding components of each vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.op_Subtraction Method

Vector2.op_Subtraction Method

Subtracts a vector from a vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 op_Subtraction (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
source vector.

Return Value

Result of the subtraction.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.op_UnaryNegation Method

Vector2.op_UnaryNegation Method

Returns a vector pointing in the opposite direction.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 op_UnaryNegation (
         Vector2 value
)

Parameters

value
Source vector.

Return Value

Vector pointing in the opposite direction.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Reflect Method

Vector2.Reflect Method

Determines the reflect vector of the given vector and normal.

Expand image Overload List

Name | Description
Vector2.Reflect (Vector2, Vector2) | Determines the reflect vector of the given vector and normal.
Vector2.Reflect (Vector2, Vector2, Vector2) | Determines the reflect vector of the given vector and normal.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Reflect Method (Vector2, Vector2)

Vector2.Reflect Method (Vector2, Vector2)
See Also
CollapseAll image

Determines the reflect vector of the given vector and normal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Reflect (
         Vector2 vector,
         Vector2 normal
)

Parameters

vector
Source vector.
normal
Normal of vector.

Return Value

Resulting reflect vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Reflect Method (Vector2, Vector2, Vector2)

Vector2.Reflect Method (Vector2, Vector2, Vector2)
See Also
CollapseAll image

Determines the reflect vector of the given vector and normal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Reflect (
         ref Vector2 vector,
         ref Vector2 normal,
         out Vector2 result
)

Parameters

vector
Source vector.
normal
Normal of vector.
result
[OutAttribute] The created reflect vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.SmoothStep Method

Vector2.SmoothStep Method

Interpolates between two values using a cubic equation.

Expand image Overload List

Name | Description
Vector2.SmoothStep (Vector2, Vector2, Single) | Interpolates between two values using a cubic equation.
Vector2.SmoothStep (Vector2, Vector2, Single, Vector2) | Interpolates between two values using a cubic equation.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.SmoothStep Method (Vector2, Vector2, Single)

Vector2.SmoothStep Method (Vector2, Vector2, Single)
See Also
CollapseAll image

Interpolates between two values using a cubic equation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 SmoothStep (
         Vector2 value1,
         Vector2 value2,
         float amount
)

Parameters

value1
Source value.
value2
Source value.
amount
Weighting value.

Return Value

Interpolated value.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.SmoothStep Method (Vector2, Vector2, Single, Vector2)

Vector2.SmoothStep Method (Vector2, Vector2, Single, Vector2)
See Also
CollapseAll image

Interpolates between two values using a cubic equation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void SmoothStep (
         ref Vector2 value1,
         ref Vector2 value2,
         float amount,
         out Vector2 result
)

Parameters

value1
Source value.
value2
Source value.
amount
Weighting value.
result
[OutAttribute] The interpolated value.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Subtract Method

Vector2.Subtract Method

Subtracts a vector from a vector.

Expand image Overload List

Name | Description
Vector2.Subtract (Vector2, Vector2) | Subtracts a vector from a vector.
Vector2.Subtract (Vector2, Vector2, Vector2) | Subtracts a vector from a vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Subtract Method (Vector2, Vector2)

Vector2.Subtract Method (Vector2, Vector2)
See Also
CollapseAll image

Subtracts a vector from a vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Subtract (
         Vector2 value1,
         Vector2 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the subtraction.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Subtract Method (Vector2, Vector2, Vector2)

Vector2.Subtract Method (Vector2, Vector2, Vector2)
See Also
CollapseAll image

Subtracts a vector from a vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Subtract (
         ref Vector2 value1,
         ref Vector2 value2,
         out Vector2 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the subtraction.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.ToString Method

Vector2.ToString Method

Retrieves a string representation of the current object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Transform Method

Vector2.Transform Method

Transforms one or more Vector2s by a Matrix or Quaternion.

Expand image Overload List

Name | Description
Vector2.Transform (Vector2, Matrix) | Transforms the vector (x, y, 0, 1) by the specified matrix.
Vector2.Transform (Vector2, Matrix, Vector2) | Transforms a Vector2 by the given Matrix.
Vector2.Transform (Vector2, Quaternion) | Transforms a single Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.
Vector2.Transform (Vector2, Quaternion, Vector2) | Transforms a Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.
Vector2.Transform (Vector2[], Int32, Matrix, Vector2[], Int32, Int32) | Transforms a specified range in an array of Vector2s by a specified Matrix and places the results in a specified range in a destination array.
Vector2.Transform (Vector2[], Int32, Quaternion, Vector2[], Int32, Int32) | Transforms a specified range in an array of Vector2s by a specified Quaternion and places the results in a specified range in a destination array.
Vector2.Transform (Vector2[], Matrix, Vector2[]) | Transforms an array of Vector2s by a specified Matrix.
Vector2.Transform (Vector2[], Quaternion, Vector2[]) | Transforms an array of Vector2s by a specified Quaternion.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.Transform Method (Vector2, Matrix)

Vector2.Transform Method (Vector2, Matrix)
See Also
CollapseAll image

Transforms the vector (x, y, 0, 1) by the specified matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Transform (
         Vector2 position,
         Matrix matrix
)

Parameters

position
The source vector.
matrix
The transformation matrix.

Return Value

The transformed vector.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Transform Method (Vector2, Matrix, Vector2)

Vector2.Transform Method (Vector2, Matrix, Vector2)
See Also
CollapseAll image

Transforms a Vector2 by the given Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Vector2 position,
         ref Matrix matrix,
         out Vector2 result
)

Parameters

position
The source Vector2.
matrix
The transformation Matrix.
result
[OutAttribute] The Vector2 resulting from the transformation.

Expand image Exceptions

Exception type | Condition
ArgumentException | The target array size must be equal or larger than the source array size.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Transform Method (Vector2, Quaternion)

Vector2.Transform Method (Vector2, Quaternion)
See Also
CollapseAll image

Transforms a single Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Transform (
         Vector2 value,
         Quaternion rotation
)

Parameters

value
The vector to rotate.
rotation
The Quaternion rotation to apply.

Return Value

Returns a new Vector2 containing the result of the rotation.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Transform Method (Vector2, Quaternion, Vector2)

Vector2.Transform Method (Vector2, Quaternion, Vector2)
See Also
CollapseAll image

Transforms a Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Vector2 value,
         ref Quaternion rotation,
         out Vector2 result
)

Parameters

value
The vector to rotate.
rotation
The Quaternion rotation to apply.
result
[OutAttribute] An existing Vector2 filled in with the result of the rotation.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Transform Method (Vector2[], Int32, Matrix, Vector2[], Int32, Int32)

Vector2.Transform Method (Vector2[], Int32, Matrix, Vector2[], Int32, Int32)
See Also
CollapseAll image

Transforms a specified range in an array of Vector2s by a specified Matrix and places the results in a specified range in a destination array.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector2[] sourceArray,
         int sourceIndex,
         ref Matrix matrix,
         Vector2[] destinationArray,
         int destinationIndex,
         int length
)

Parameters

sourceArray
The source array.
sourceIndex
The index of the first Vector2 to transform in the source array.
matrix
The Matrix to transform by.
destinationArray
The destination array into which the resulting Vector2s will be written.
destinationIndex
The index of the position in the destination array where the first result Vector2 should be written.
length
The number of Vector2s to be transformed.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result or the combination of sourceIndex and length was greater than sourceArray.Length.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Transform Method (Vector2[], Int32, Quaternion, Vector2[], Int32, Int32)

Vector2.Transform Method (Vector2[], Int32, Quaternion, Vector2[], Int32, Int32)
See Also
CollapseAll image

Transforms a specified range in an array of Vector2s by a specified Quaternion and places the results in a specified range in a destination array.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector2[] sourceArray,
         int sourceIndex,
         ref Quaternion rotation,
         Vector2[] destinationArray,
         int destinationIndex,
         int length
)

Parameters

sourceArray
The source array.
sourceIndex
The index of the first Vector2 to transform in the source array.
rotation
The Quaternion rotation to apply.
destinationArray
The destination array into which the resulting Vector2s are written.
destinationIndex
The index of the position in the destination array where the first result Vector2 should be written.
length
The number of Vector2s to be transformed.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result or the combination of sourceIndex and length was greater than sourceArray.Length.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Transform Method (Vector2[], Matrix, Vector2[])

Vector2.Transform Method (Vector2[], Matrix, Vector2[])
See Also
CollapseAll image

Transforms an array of Vector2s by a specified Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector2[] sourceArray,
         ref Matrix matrix,
         Vector2[] destinationArray
)

Parameters

sourceArray
The array of Vector2s to transform.
matrix
The transform Matrix to apply.
destinationArray
An existing array into which the transformed Vector2s are written.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Transform Method (Vector2[], Quaternion, Vector2[])

Vector2.Transform Method (Vector2[], Quaternion, Vector2[])
See Also
CollapseAll image

Transforms an array of Vector2s by a specified Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector2[] sourceArray,
         ref Quaternion rotation,
         Vector2[] destinationArray
)

Parameters

sourceArray
The array of Vector2s to transform.
rotation
The transform Matrix to use.
destinationArray
An existing array into which the transformed Vector2s are written.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.TransformNormal Method

Vector2.TransformNormal Method

Transforms a vector normal or array of vector normals by a matrix.

Expand image Overload List

Name | Description
Vector2.TransformNormal (Vector2, Matrix) | Transforms a 2D vector normal by a matrix.
Vector2.TransformNormal (Vector2, Matrix, Vector2) | Transforms a vector normal by a matrix.
Vector2.TransformNormal (Vector2[], Int32, Matrix, Vector2[], Int32, Int32) | Transforms a specified range in an array of Vector2 vector normals by a specified Matrix and places the results in a specified range in a destination array.
Vector2.TransformNormal (Vector2[], Matrix, Vector2[]) | Transforms an array of Vector2 vector normals by a specified Matrix.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace


Vector2.TransformNormal Method (Vector2, Matrix)

Vector2.TransformNormal Method (Vector2, Matrix)
See Also
CollapseAll image

Transforms a 2D vector normal by a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 TransformNormal (
         Vector2 normal,
         Matrix matrix
)

Parameters

normal
The source vector.
matrix
The transformation matrix.

Return Value

The transformed normal.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.TransformNormal Method (Vector2, Matrix, Vector2)

Vector2.TransformNormal Method (Vector2, Matrix, Vector2)
See Also
CollapseAll image

Transforms a vector normal by a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void TransformNormal (
         ref Vector2 normal,
         ref Matrix matrix,
         out Vector2 result
)

Parameters

normal
The source vector.
matrix
The transformation matrix.
result
[OutAttribute] The Vector2 resulting from the transformation.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.TransformNormal Method (Vector2[], Int32, Matrix, Vector2[], Int32, Int32)

Vector2.TransformNormal Method (Vector2[], Int32, Matrix, Vector2[], Int32, Int32)
See Also
CollapseAll image

Transforms a specified range in an array of Vector2 vector normals by a specified Matrix and places the results in a specified range in a destination array.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void TransformNormal (
         Vector2[] sourceArray,
         int sourceIndex,
         ref Matrix matrix,
         Vector2[] destinationArray,
         int destinationIndex,
         int length
)

Parameters

sourceArray
The source array.
sourceIndex
The index of the first Vector2 to transform in the source array.
matrix
The Matrix to apply.
destinationArray
The destination array into which the resulting Vector2s are written.
destinationIndex
The index of the position in the destination array where the first result Vector2 should be written.
length
The number of vector normals to be transformed.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result or the combination of sourceIndex and length was greater than sourceArray.Length.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.TransformNormal Method (Vector2[], Matrix, Vector2[])

Vector2.TransformNormal Method (Vector2[], Matrix, Vector2[])
See Also
CollapseAll image

Transforms an array of Vector2 vector normals by a specified Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void TransformNormal (
         Vector2[] sourceArray,
         ref Matrix matrix,
         Vector2[] destinationArray
)

Parameters

sourceArray
The array of vector normals to transform.
matrix
The transform Matrix to apply.
destinationArray
An existing array into which the transformed vector normals are written.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2 Properties

Vector2 Properties

Expand image Public Properties

Name | Description
One | Returns a Vector2 with both of its components set to one.
UnitX | Returns the unit vector for the x-axis.
UnitY | Returns the unit vector for the y-axis.
Zero | Returns a Vector2 with all of its components set to zero.

Expand image See Also

Reference

Vector2 Structure
Microsoft.Xna.Framework Namespace


Vector2.One Property

Vector2.One Property

Returns a Vector2 with both of its components set to one.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 One { get; }

Property Value

Vector2 with both of its components set to one.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.UnitX Property

Vector2.UnitX Property

Returns the unit vector for the x-axis.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 UnitX { get; }

Property Value

The unit vector for the x-axis.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.UnitY Property

Vector2.UnitY Property

Returns the unit vector for the y-axis.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 UnitY { get; }

Property Value

The unit vector for the y-axis.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector2.Zero Property

Vector2.Zero Property

Returns a Vector2 with all of its components set to zero.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector2 Zero { get; }

Property Value

A Vector2 with all of its components set to zero.

Expand image See Also

Reference

Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3 Structure

Vector3 Structure

Defines a vector with three components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.Vector3Converter)")]
[SerializableAttribute]
public struct Vector3 : IEquatable<Vector3>

Expand image See Also

Reference

Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3 Members

Vector3 Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the Vector3 type.

Expand image Public Constructors

 | Name | Description
Public Method | Vector3 | Overloaded. Initializes a new instance of Vector3.

Expand image Public Fields

 | Name | Description
Public Field | X | Gets or sets the x-component of the vector.
Public Field | Y | Gets or sets the y-component of the vector.
Public Field | Z | Gets or sets the z-component of the vector.

Expand image Public Properties

Name | Description
Backward | Returns a unit Vector3 designating backward in a right-handed coordinate system (0, 0, 1).
Down | Returns a unit Vector3 designating down (0, −1, 0).
Forward | Returns a unit Vector3 designating forward in a right-handed coordinate system(0, 0, −1).
Left | Returns a unit Vector3 designating left (−1, 0, 0).
One | Returns a Vector3 with ones in all of its components.
Right | Returns a unit Vector3 pointing to the right (1, 0, 0).
UnitX | Returns the x unit Vector3 (1, 0, 0).
UnitY | Returns the y unit Vector3 (0, 1, 0).
UnitZ | Returns the z unit Vector3 (0, 0, 1).
Up | Returns a unit vector designating up (0, 1, 0).
Zero | Returns a Vector3 with all of its components set to zero.

Expand image Public Methods

 | Name | Description
 | Add | Overloaded. Adds two vectors.
 | Barycentric | Overloaded. Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.
 | CatmullRom | Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
 | Clamp | Overloaded. Restricts a value to be within a specified range.
 | Cross | Overloaded. Calculates the cross product of two vectors.
 | Distance | Overloaded. Calculates the distance between two vectors.
 | DistanceSquared | Overloaded. Calculates the distance between two vectors squared.
 | Divide | Overloaded. Divide a vector by a scalar or another vector.
 | Dot | Overloaded. Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code of the vector object.
Public Method | GetType | (Inherited from Object.)
 | Hermite | Overloaded. Performs a Hermite spline interpolation.
Public Method | Length | Calculates the length of the vector.
Public Method | LengthSquared | Calculates the length of the vector squared.
 | Lerp | Overloaded. Performs a linear interpolation between two vectors.
 | Max | Overloaded. Returns a vector that contains the highest value from each matching pair of components.
 | Min | Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
 | Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | Negate | Overloaded. Returns a vector pointing in the opposite direction.
Public Method | Normalize | Overloaded. Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
 | op_Addition | Adds two vectors.
 | op_Division | Overloaded. Divides a vector by a scalar or another vector.
 | op_Equality | Tests vectors for equality.
 | op_Inequality | Tests vectors for inequality.
 | op_Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | op_Subtraction | Subtracts a vector from a vector.
 | op_UnaryNegation | Returns a vector pointing in the opposite direction.
 | Reflect | Overloaded. Returns the reflection of a vector off a surface that has the specified normal.
 | SmoothStep | Overloaded. Interpolates between two values using a cubic equation.
 | Subtract | Overloaded. Subtracts a vector from a vector.
Public Method | ToString | Retrieves a string representation of the current object.
 | Transform | Overloaded. Transforms a Vector3 or array of Vector3s by a specified Matrix or Quaternion.
 | TransformNormal | Overloaded. Transforms a vector normal by a matrix.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Vector3 Structure
Microsoft.Xna.Framework Namespace


Vector3 Fields

Vector3 Fields

Expand image Public Fields

 | Name | Description
Public Field | X | Gets or sets the x-component of the vector.
Public Field | Y | Gets or sets the y-component of the vector.
Public Field | Z | Gets or sets the z-component of the vector.

Expand image See Also

Reference

Vector3 Structure
Microsoft.Xna.Framework Namespace


Vector3.X Field

Vector3.X Field

Gets or sets the x-component of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float X

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Y Field

Vector3.Y Field

Gets or sets the y-component of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Y

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Z Field

Vector3.Z Field

Gets or sets the z-component of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Z

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3 Constructor

Vector3 Constructor

Initializes a new instance of Vector3.

Expand image Overload List

Name | Description
Vector3 (Single) | Creates a new instance of Vector3.
Vector3 (Single, Single, Single) | Initializes a new instance of Vector3.
Vector3 (Vector2, Single) | Initializes a new instance of Vector3.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3 Constructor (Single)

Vector3 Constructor (Single)
See Also
CollapseAll image

Creates a new instance of Vector3.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 (
         float value
)

Parameters

value
Value to initialize each component to.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3 Constructor (Single, Single, Single)

Vector3 Constructor (Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of Vector3.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 (
         float x,
         float y,
         float z
)

Parameters

x
Initial value for the x-component of the vector.
y
Initial value for the y-component of the vector.
z
Initial value for the z-component of the vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3 Constructor (Vector2, Single)

Vector3 Constructor (Vector2, Single)
See Also
CollapseAll image

Initializes a new instance of Vector3.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 (
         Vector2 value,
         float z
)

Parameters

value
A vector containing the values to initialize x and y components with.
z
Initial value for the z-component of the vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3 Methods

Vector3 Methods

Expand image Public Methods

 | Name | Description
 | Add | Overloaded. Adds two vectors.
 | Barycentric | Overloaded. Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.
 | CatmullRom | Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
 | Clamp | Overloaded. Restricts a value to be within a specified range.
 | Cross | Overloaded. Calculates the cross product of two vectors.
 | Distance | Overloaded. Calculates the distance between two vectors.
 | DistanceSquared | Overloaded. Calculates the distance between two vectors squared.
 | Divide | Overloaded. Divide a vector by a scalar or another vector.
 | Dot | Overloaded. Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code of the vector object.
Public Method | GetType | (Inherited from Object.)
 | Hermite | Overloaded. Performs a Hermite spline interpolation.
Public Method | Length | Calculates the length of the vector.
Public Method | LengthSquared | Calculates the length of the vector squared.
 | Lerp | Overloaded. Performs a linear interpolation between two vectors.
 | Max | Overloaded. Returns a vector that contains the highest value from each matching pair of components.
 | Min | Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
 | Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | Negate | Overloaded. Returns a vector pointing in the opposite direction.
Public Method | Normalize | Overloaded. Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
 | op_Addition | Adds two vectors.
 | op_Division | Overloaded. Divides a vector by a scalar or another vector.
 | op_Equality | Tests vectors for equality.
 | op_Inequality | Tests vectors for inequality.
 | op_Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | op_Subtraction | Subtracts a vector from a vector.
 | op_UnaryNegation | Returns a vector pointing in the opposite direction.
 | Reflect | Overloaded. Returns the reflection of a vector off a surface that has the specified normal.
 | SmoothStep | Overloaded. Interpolates between two values using a cubic equation.
 | Subtract | Overloaded. Subtracts a vector from a vector.
Public Method | ToString | Retrieves a string representation of the current object.
 | Transform | Overloaded. Transforms a Vector3 or array of Vector3s by a specified Matrix or Quaternion.
 | TransformNormal | Overloaded. Transforms a vector normal by a matrix.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Vector3 Structure
Microsoft.Xna.Framework Namespace


Vector3.Add Method

Vector3.Add Method

Adds two vectors.

Expand image Overload List

Name | Description
Vector3.Add (Vector3, Vector3) | Adds two vectors.
Vector3.Add (Vector3, Vector3, Vector3) | Adds two vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Add Method (Vector3, Vector3)

Vector3.Add Method (Vector3, Vector3)
See Also
CollapseAll image

Adds two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Add (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Sum of the source vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Add Method (Vector3, Vector3, Vector3)

Vector3.Add Method (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Adds two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Add (
         ref Vector3 value1,
         ref Vector3 value2,
         out Vector3 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] Sum of the source vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Barycentric Method

Vector3.Barycentric Method

Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.

Expand image Overload List

Name | Description
Vector3.Barycentric (Vector3, Vector3, Vector3, Single, Single) | Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.
Vector3.Barycentric (Vector3, Vector3, Vector3, Single, Single, Vector3) | Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 3D triangle.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Barycentric Method (Vector3, Vector3, Vector3, Single, Single)

Vector3.Barycentric Method (Vector3, Vector3, Vector3, Single, Single)
See Also
CollapseAll image

Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Barycentric (
         Vector3 value1,
         Vector3 value2,
         Vector3 value3,
         float amount1,
         float amount2
)

Parameters

value1
A Vector3 containing the 3D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector3 containing the 3D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector3 containing the 3D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).

Return Value

A new Vector3 containing the 3D Cartesian coordinates of the specified point.

Expand image Remarks

About Barycentric Coordinates

Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by 3 weighting factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to the location of the point, as specified in the following formulas:

    Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
    Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
    Pz = (b1 * V1z) + (b2 * V2z) + (b3 * V3z);

Such triple weighting factors b1, b2, and b3 are called Barycentric coordinates.

Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same point as b1, b2, and b3 for any positive value of k.

If a set of Barycentric coordinates is normalized so that: b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3, since b1 equals (1 - b2 - b3).

What Vector3 Barycentric Does

The Vector3 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument and b3 is the amount2 argument). The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.

Barycentric then calculates the Cartesian coordinate of P as follows:

    Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
    Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);
    Pz = ( (1 - b2 - b3) * V1z ) + (b2 * V2z) + (b3 * V3z);

Thus, to calculate the 3D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric together with the appropropriate normalized Barycentric (areal) coordinates of P.

The following relationships may be useful:

  • If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle defined by value1, value2, and value3.
  • If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value3.
  • If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value2.
  • If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by value2 and value3.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Barycentric Method (Vector3, Vector3, Vector3, Single, Single, Vector3)

Vector3.Barycentric Method (Vector3, Vector3, Vector3, Single, Single, Vector3)
See Also
CollapseAll image

Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 3D triangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Barycentric (
         ref Vector3 value1,
         ref Vector3 value2,
         ref Vector3 value3,
         float amount1,
         float amount2,
         out Vector3 result
)

Parameters

value1
A Vector3 containing the 3D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector3 containing the 3D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector3 containing the 3D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
result
[OutAttribute] The 3D Cartesian coordinates of the specified point are placed in this Vector3 on exit.

Expand image Remarks

About Barycentric Coordinates

Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to the location of the point, as specified in the following formulas:

    Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
    Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
    Pz = (b1 * V1z) + (b2 * V2z) + (b3 * V3z);

Such triple weighting factors b1, b2, and b3 are called barycentric coordinates.

Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same point as b1, b2, and b3 for any positive value of k.

If a set of barycentric coordinates is normalized so that b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3, since b1 equals (1 − b2 − b3).

What Vector3 Barycentric Does

The Vector3 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument and b3 is the amount2 argument). The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.

Barycentric then calculates the Cartesian coordinate of P as follows:

    Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
    Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);
    Pz = ( (1 - b2 - b3) * V1z ) + (b2 * V2z) + (b3 * V3z);

Thus, to calculate the 3D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric together with the appropropriate normalized Barycentric (areal) coordinates of P.

The following relationships may be useful.

  • If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle defined by value1, value2, and value3.
  • If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value3.
  • If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value2.
  • If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by value2 and value3.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.CatmullRom Method

Vector3.CatmullRom Method

Performs a Catmull-Rom interpolation using the specified positions.

Expand image Overload List

Name | Description
Vector3.CatmullRom (Vector3, Vector3, Vector3, Vector3, Single) | Performs a Catmull-Rom interpolation using the specified positions.
Vector3.CatmullRom (Vector3, Vector3, Vector3, Vector3, Single, Vector3) | Performs a Catmull-Rom interpolation using the specified positions.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.CatmullRom Method (Vector3, Vector3, Vector3, Vector3, Single)

Vector3.CatmullRom Method (Vector3, Vector3, Vector3, Vector3, Single)
See Also
CollapseAll image

Performs a Catmull-Rom interpolation using the specified positions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 CatmullRom (
         Vector3 value1,
         Vector3 value2,
         Vector3 value3,
         Vector3 value4,
         float amount
)

Parameters

value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.

Return Value

A vector that is the result of the Catmull-Rom interpolation.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.CatmullRom Method (Vector3, Vector3, Vector3, Vector3, Single, Vector3)

Vector3.CatmullRom Method (Vector3, Vector3, Vector3, Vector3, Single, Vector3)
See Also
CollapseAll image

Performs a Catmull-Rom interpolation using the specified positions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CatmullRom (
         ref Vector3 value1,
         ref Vector3 value2,
         ref Vector3 value3,
         ref Vector3 value4,
         float amount,
         out Vector3 result
)

Parameters

value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.
result
[OutAttribute] A vector that is the result of the Catmull-Rom interpolation.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Clamp Method

Vector3.Clamp Method

Restricts a value to be within a specified range.

Expand image Overload List

Name | Description
Vector3.Clamp (Vector3, Vector3, Vector3) | Restricts a value to be within a specified range.
Vector3.Clamp (Vector3, Vector3, Vector3, Vector3) | Restricts a value to be within a specified range.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Clamp Method (Vector3, Vector3, Vector3)

Vector3.Clamp Method (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Restricts a value to be within a specified range.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Clamp (
         Vector3 value1,
         Vector3 min,
         Vector3 max
)

Parameters

value1
The value to clamp.
min
The minimum value.
max
The maximum value.

Return Value

The clamped value.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Clamp Method (Vector3, Vector3, Vector3, Vector3)

Vector3.Clamp Method (Vector3, Vector3, Vector3, Vector3)
See Also
CollapseAll image

Restricts a value to be within a specified range.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Clamp (
         ref Vector3 value1,
         ref Vector3 min,
         ref Vector3 max,
         out Vector3 result
)

Parameters

value1
The value to clamp.
min
The minimum value.
max
The maximum value.
result
[OutAttribute] The clamped value.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Cross Method

Vector3.Cross Method

Calculates the cross product of two vectors.

Expand image Overload List

Name | Description
Vector3.Cross (Vector3, Vector3) | Calculates the cross product of two vectors.
Vector3.Cross (Vector3, Vector3, Vector3) | Calculates the cross product of two vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Cross Method (Vector3, Vector3)

Vector3.Cross Method (Vector3, Vector3)
See Also
CollapseAll image

Calculates the cross product of two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Cross (
         Vector3 vector1,
         Vector3 vector2
)

Parameters

vector1
Source vector.
vector2
Source vector.

Return Value

Cross product of the source vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Cross Method (Vector3, Vector3, Vector3)

Vector3.Cross Method (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Calculates the cross product of two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Cross (
         ref Vector3 vector1,
         ref Vector3 vector2,
         out Vector3 result
)

Parameters

vector1
Source vector.
vector2
Source vector.
result
[OutAttribute] The cross product of the vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Distance Method

Vector3.Distance Method

Calculates the distance between two vectors.

Expand image Overload List

Name | Description
Vector3.Distance (Vector3, Vector3) | Calculates the distance between two vectors.
Vector3.Distance (Vector3, Vector3, Single) | Calculates the distance between two vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Distance Method (Vector3, Vector3)

Vector3.Distance Method (Vector3, Vector3)
See Also
CollapseAll image

Calculates the distance between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Distance (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Distance between the source vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Distance Method (Vector3, Vector3, Single)

Vector3.Distance Method (Vector3, Vector3, Single)
See Also
CollapseAll image

Calculates the distance between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Distance (
         ref Vector3 value1,
         ref Vector3 value2,
         out float result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.DistanceSquared Method

Vector3.DistanceSquared Method

Calculates the distance between two vectors squared.

Expand image Overload List

Name | Description
Vector3.DistanceSquared (Vector3, Vector3) | Calculates the distance between two vectors squared.
Vector3.DistanceSquared (Vector3, Vector3, Single) | Calculates the distance between two vectors squared.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.DistanceSquared Method (Vector3, Vector3)

Vector3.DistanceSquared Method (Vector3, Vector3)
See Also
CollapseAll image

Calculates the distance between two vectors squared.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float DistanceSquared (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

The distance between the source vectors squared.

Expand image Remarks

Distance is calculated with the following formula:

Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A, compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square roots, which are computationally expensive. However, using distance squared provides the same information and avoids calculating two square roots.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.DistanceSquared Method (Vector3, Vector3, Single)

Vector3.DistanceSquared Method (Vector3, Vector3, Single)
See Also
CollapseAll image

Calculates the distance between two vectors squared.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void DistanceSquared (
         ref Vector3 value1,
         ref Vector3 value2,
         out float result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the two vectors squared.

Expand image Remarks

Distance is calculated with the formula:

Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A, compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square roots, which are computationally expensive. However, using distance squared provides the same information and avoids calculating two square roots.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Divide Method

Vector3.Divide Method

Divide a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector3.Divide (Vector3, Single) | Divides a vector by a scalar value.
Vector3.Divide (Vector3, Single, Vector3) | Divides a vector by a scalar value.
Vector3.Divide (Vector3, Vector3) | Divides the components of a vector by the components of another vector.
Vector3.Divide (Vector3, Vector3, Vector3) | Divides the components of a vector by the components of another vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Divide Method (Vector3, Single)

Vector3.Divide Method (Vector3, Single)
See Also
CollapseAll image

Divides a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Divide (
         Vector3 value1,
         float value2
)

Parameters

value1
Source vector.
value2
The divisor.

Return Value

The source vector divided by b.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Divide Method (Vector3, Single, Vector3)

Vector3.Divide Method (Vector3, Single, Vector3)
See Also
CollapseAll image

Divides a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Divide (
         ref Vector3 value1,
         float value2,
         out Vector3 result
)

Parameters

value1
Source vector.
value2
The divisor.
result
[OutAttribute] The result of the division.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Divide Method (Vector3, Vector3)

Vector3.Divide Method (Vector3, Vector3)
See Also
CollapseAll image

Divides the components of a vector by the components of another vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Divide (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Divisor vector.

Return Value

The result of dividing the vectors.

Expand image Remarks

Division of a vector by another vector is not mathematically defined. This method simply divides each component of a by the matching component of b.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Divide Method (Vector3, Vector3, Vector3)

Vector3.Divide Method (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Divides the components of a vector by the components of another vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Divide (
         ref Vector3 value1,
         ref Vector3 value2,
         out Vector3 result
)

Parameters

value1
Source vector.
value2
The divisor.
result
[OutAttribute] The result of the division.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Dot Method

Vector3.Dot Method

Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Expand image Overload List

Name | Description
Vector3.Dot (Vector3, Vector3) | Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
Vector3.Dot (Vector3, Vector3, Single) | Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Expand image Remarks

The dot product is also known as the inner product.

For any two vectors, the dot product is defined as:

Vector3.Dot( vector1, vector2 ) == (vector1.X * vector2.X) + (vector1.Y * vector2.Y) + (vector1.Z * vector2.Z)

The result of this calculation, plus or minus some margin to account for floating point error, is equal to:

Length( vector1 ) * Length( vector2 ) * System.Math.Cos( theta )

Here, theta is the angle between the two vectors.

If vector1 and vector2 are unit vectors, the length of each vector will be equal to 1. So, when vector1 and vector2 are unit vectors, the dot product is simply equal to the cosine of the angle between the two vectors. The following calculation:

Vector3.Dot( vector1.Normalize(), vector2.Normalize() )

Is equivalent to:

System.Math.Cos( theta )

Therefore, if vector1 and vector2 are unit vectors (i.e., we've called Normalize on each vector to make it a unit vector), without knowing the value of theta or using a potentially processor-intensive trigonometric function, the dot product can tell us the following things:

  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) > 0, the angle between the two vectors is less than 90 degrees.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) < 0, the angle between the two vectors is more than 90 degrees.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) == 0, the angle between the two vectors is 90 degrees; that is, the vectors are orthogonal.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) == 1, the angle between the two vectors is 0 degrees; that is, the vectors point in the same direction and are parallel.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) == -1, the angle between the two vectors is 180 degrees; that is, the vectors point in opposite directions and are parallel.
Caution
Because of floating point error, two orthogonal vectors may not return a dot product that is exactly zero. It might be zero plus some amount of floating point error. In your code, you will want to determine what amount of error is acceptable in your calculation, and take that into account when you do your comparisons.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Dot Method (Vector3, Vector3)

Vector3.Dot Method (Vector3, Vector3)
See Also
CollapseAll image

Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Dot (
         Vector3 vector1,
         Vector3 vector2
)

Parameters

vector1
Source vector.
vector2
Source vector.

Return Value

The dot product of the two vectors.

Expand image Remarks

The dot product is also known as the inner product.

For any two vectors, the dot product is defined as:

Vector3.Dot( vector1, vector2 ) == (vector1.X * vector2.X) + (vector1.Y * vector2.Y) + (vector1.Z * vector2.Z)

The result of this calculation, plus or minus some margin to account for floating point error, is equal to:

Length( vector1 ) * Length( vector2 ) * System.Math.Cos( theta )

Here, theta is the angle between the two vectors.

If vector1 and vector2 are unit vectors, the length of each vector will be equal to 1. So, when vector1 and vector2 are unit vectors, the dot product is simply equal to the cosine of the angle between the two vectors. The following calculation:

Vector3.Dot( vector1.Normalize(), vector2.Normalize() )

Is equivalent to:

System.Math.Cos( theta )

Therefore, if vector1 and vector2 are unit vectors (i.e., we've called Normalize on each vector to make it a unit vector), without knowing the value of theta or using a potentially processor-intensive trigonometric function, the dot product can tell us the following things:

  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) > 0, the angle between the two vectors is less than 90 degrees.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) < 0, the angle between the two vectors is more than 90 degrees.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) == 0, the angle between the two vectors is 90 degrees; that is, the vectors are orthogonal.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) == 1, the angle between the two vectors is 0 degrees; that is, the vectors point in the same direction and are parallel.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) == -1, the angle between the two vectors is 180 degrees; that is, the vectors point in opposite directions and are parallel.
Caution
Because of floating point error, two orthogonal vectors may not return a dot product that is exactly zero. It might be zero plus some amount of floating point error. In your code, you will want to determine what amount of error is acceptable in your calculation, and take that into account when you do your comparisons.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Dot Method (Vector3, Vector3, Single)

Vector3.Dot Method (Vector3, Vector3, Single)
See Also
CollapseAll image

Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Dot (
         ref Vector3 vector1,
         ref Vector3 vector2,
         out float result
)

Parameters

vector1
Source vector.
vector2
Source vector.
result
[OutAttribute] The dot product of the two vectors.

Expand image Remarks

The dot product is also known as the inner product.

For any two vectors, the dot product is defined as:

Vector3.Dot( vector1, vector2 ) == (vector1.X * vector2.X) + (vector1.Y * vector2.Y) + (vector1.Z * vector2.Z)

The result of this calculation, plus or minus some margin to account for floating point error, is equal to:

Length( vector1 ) * Length( vector2 ) * System.Math.Cos( theta )

Here, theta is the angle between the two vectors.

If vector1 and vector2 are unit vectors, the length of each vector will be equal to 1. So, when vector1 and vector2 are unit vectors, the dot product is simply equal to the cosine of the angle between the two vectors. The following calculation:

Vector3.Dot( vector1.Normalize(), vector2.Normalize() )

Is equivalent to:

System.Math.Cos( theta )

Therefore, if vector1 and vector2 are unit vectors (i.e., we've called Normalize on each vector to make it a unit vector), without knowing the value of theta or using a potentially processor-intensive trigonometric function, the dot product can tell us the following things:

  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) > 0, the angle between the two vectors is less than 90 degrees.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) < 0, the angle between the two vectors is more than 90 degrees.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) == 0, the angle between the two vectors is 90 degrees; that is, the vectors are orthogonal.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) == 1, the angle between the two vectors is 0 degrees; that is, the vectors point in the same direction and are parallel.
  • If Vector3.Dot( vector1.Normalize(), vector2.Normalize() ) == -1, the angle between the two vectors is 180 degrees; that is, the vectors point in opposite directions and are parallel.
Caution
Because of floating point error, two orthogonal vectors may not return a dot product that is exactly zero. It might be zero plus some amount of floating point error. In your code, you will want to determine what amount of error is acceptable in your calculation, and take that into account when you do your comparisons.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Equals Method

Vector3.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Vector3.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.
Vector3.Equals (Vector3) | Determines whether the specified Object is equal to the Vector3.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Equals Method (Object)

Vector3.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to make the comparison with.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Equals Method (Vector3)

Vector3.Equals Method (Vector3)
See Also
CollapseAll image

Determines whether the specified Object is equal to the Vector3.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Vector3 other
)

Parameters

other
The Vector3 to compare with the current Vector3.

Return Value

true if the specified Vector3 is equal to the current Vector3; false otherwise.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.GetHashCode Method

Vector3.GetHashCode Method

Gets the hash code of the vector object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code of the vector object.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Hermite Method

Vector3.Hermite Method

Performs a Hermite spline interpolation.

Expand image Overload List

Name | Description
Vector3.Hermite (Vector3, Vector3, Vector3, Vector3, Single) | Performs a Hermite spline interpolation.
Vector3.Hermite (Vector3, Vector3, Vector3, Vector3, Single, Vector3) | Performs a Hermite spline interpolation.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Hermite Method (Vector3, Vector3, Vector3, Vector3, Single)

Vector3.Hermite Method (Vector3, Vector3, Vector3, Vector3, Single)
See Also
CollapseAll image

Performs a Hermite spline interpolation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Hermite (
         Vector3 value1,
         Vector3 tangent1,
         Vector3 value2,
         Vector3 tangent2,
         float amount
)

Parameters

value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.

Return Value

The result of the Hermite spline interpolation.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Hermite Method (Vector3, Vector3, Vector3, Vector3, Single, Vector3)

Vector3.Hermite Method (Vector3, Vector3, Vector3, Vector3, Single, Vector3)
See Also
CollapseAll image

Performs a Hermite spline interpolation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Hermite (
         ref Vector3 value1,
         ref Vector3 tangent1,
         ref Vector3 value2,
         ref Vector3 tangent2,
         float amount,
         out Vector3 result
)

Parameters

value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.
result
[OutAttribute] The result of the Hermite spline interpolation.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Length Method

Vector3.Length Method

Calculates the length of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Length ()

Return Value

The length of the vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.LengthSquared Method

Vector3.LengthSquared Method

Calculates the length of the vector squared.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float LengthSquared ()

Return Value

The length of the vector squared.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Lerp Method

Vector3.Lerp Method

Performs a linear interpolation between two vectors.

Expand image Overload List

Name | Description
Vector3.Lerp (Vector3, Vector3, Single) | Performs a linear interpolation between two vectors.
Vector3.Lerp (Vector3, Vector3, Single, Vector3) | Performs a linear interpolation between two vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Lerp Method (Vector3, Vector3, Single)

Vector3.Lerp Method (Vector3, Vector3, Single)
See Also
CollapseAll image

Performs a linear interpolation between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Lerp (
         Vector3 value1,
         Vector3 value2,
         float amount
)

Parameters

value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.

Return Value

The linear interpolation of the two vectors.

Expand image Remarks

This method performs the linear interpolation based on the following formula.

value1 + (value2 - value1) * amount

Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Lerp Method (Vector3, Vector3, Single, Vector3)

Vector3.Lerp Method (Vector3, Vector3, Single, Vector3)
See Also
CollapseAll image

Performs a linear interpolation between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Lerp (
         ref Vector3 value1,
         ref Vector3 value2,
         float amount,
         out Vector3 result
)

Parameters

value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.
result
[OutAttribute] The result of the interpolation.

Expand image Remarks

This method performs the linear interpolation based on the following formula.

value1 + (value2 - value1) * amount

Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Max Method

Vector3.Max Method

Returns a vector that contains the highest value from each matching pair of components.

Expand image Overload List

Name | Description
Vector3.Max (Vector3, Vector3) | Returns a vector that contains the highest value from each matching pair of components.
Vector3.Max (Vector3, Vector3, Vector3) | Returns a vector that contains the highest value from each matching pair of components.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Max Method (Vector3, Vector3)

Vector3.Max Method (Vector3, Vector3)
See Also
CollapseAll image

Returns a vector that contains the highest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Max (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

The maximized vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Max Method (Vector3, Vector3, Vector3)

Vector3.Max Method (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Returns a vector that contains the highest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Max (
         ref Vector3 value1,
         ref Vector3 value2,
         out Vector3 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The maximized vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Min Method

Vector3.Min Method

Returns a vector that contains the lowest value from each matching pair of components.

Expand image Overload List

Name | Description
Vector3.Min (Vector3, Vector3) | Returns a vector that contains the lowest value from each matching pair of components.
Vector3.Min (Vector3, Vector3, Vector3) | Returns a vector that contains the lowest value from each matching pair of components.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Min Method (Vector3, Vector3)

Vector3.Min Method (Vector3, Vector3)
See Also
CollapseAll image

Returns a vector that contains the lowest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Min (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

The minimized vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Min Method (Vector3, Vector3, Vector3)

Vector3.Min Method (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Returns a vector that contains the lowest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Min (
         ref Vector3 value1,
         ref Vector3 value2,
         out Vector3 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The minimized vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Multiply Method

Vector3.Multiply Method

Multiplies a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector3.Multiply (Vector3, Single) | Multiplies a vector by a scalar value.
Vector3.Multiply (Vector3, Single, Vector3) | Multiplies a vector by a scalar value.
Vector3.Multiply (Vector3, Vector3) | Multiplies the components of two vectors by each other.
Vector3.Multiply (Vector3, Vector3, Vector3) | Multiplies the components of two vectors by each other.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Multiply Method (Vector3, Single)

Vector3.Multiply Method (Vector3, Single)
See Also
CollapseAll image

Multiplies a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Multiply (
         Vector3 value1,
         float scaleFactor
)

Parameters

value1
Source vector.
scaleFactor
Scalar value.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Multiply Method (Vector3, Single, Vector3)

Vector3.Multiply Method (Vector3, Single, Vector3)
See Also
CollapseAll image

Multiplies a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Multiply (
         ref Vector3 value1,
         float scaleFactor,
         out Vector3 result
)

Parameters

value1
Source vector.
scaleFactor
Scalar value.
result
[OutAttribute] The result of the multiplication.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Multiply Method (Vector3, Vector3)

Vector3.Multiply Method (Vector3, Vector3)
See Also
CollapseAll image

Multiplies the components of two vectors by each other.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Multiply (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the multiplication.

Expand image Remarks

Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the corresponding components of each vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Multiply Method (Vector3, Vector3, Vector3)

Vector3.Multiply Method (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Multiplies the components of two vectors by each other.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Multiply (
         ref Vector3 value1,
         ref Vector3 value2,
         out Vector3 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the multiplication.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Negate Method

Vector3.Negate Method

Returns a vector pointing in the opposite direction.

Expand image Overload List

Name | Description
Vector3.Negate (Vector3) | Returns a vector pointing in the opposite direction.
Vector3.Negate (Vector3, Vector3) | Returns a vector pointing in the opposite direction.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Negate Method (Vector3)

Vector3.Negate Method (Vector3)
See Also
CollapseAll image

Returns a vector pointing in the opposite direction.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Negate (
         Vector3 value
)

Parameters

value
Source vector.

Return Value

Vector pointing in the opposite direction.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Negate Method (Vector3, Vector3)

Vector3.Negate Method (Vector3, Vector3)
See Also
CollapseAll image

Returns a vector pointing in the opposite direction.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Negate (
         ref Vector3 value,
         out Vector3 result
)

Parameters

value
Source vector.
result
[OutAttribute] Vector pointing in the opposite direction.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Normalize Method

Vector3.Normalize Method

Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.

Expand image Overload List

Name | Description
Vector3.Normalize () | Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector.
Vector3.Normalize (Vector3) | Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
Vector3.Normalize (Vector3, Vector3) | Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Normalize Method ()

Vector3.Normalize Method ()
See Also
CollapseAll image

Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Normalize ()

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Normalize Method (Vector3)

Vector3.Normalize Method (Vector3)
See Also
CollapseAll image

Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Normalize (
         Vector3 value
)

Parameters

value
The source Vector3.

Return Value

The created unit vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Normalize Method (Vector3, Vector3)

Vector3.Normalize Method (Vector3, Vector3)
See Also
CollapseAll image

Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Normalize (
         ref Vector3 value,
         out Vector3 result
)

Parameters

value
Source vector.
result
[OutAttribute] The normalized vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.op_Addition Method

Vector3.op_Addition Method

Adds two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 op_Addition (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Sum of the vectors.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.op_Division Method

Vector3.op_Division Method

Divides a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector3.op_Division (Vector3, Single) | Divides a vector by a scalar value.
Vector3.op_Division (Vector3, Vector3) | Divides the components of a vector by the components of another vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.op_Division Method (Vector3, Single)

Vector3.op_Division Method (Vector3, Single)
See Also
CollapseAll image

Divides a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 op_Division (
         Vector3 value,
         float divider
)

Parameters

value
Source vector.
divider
The divisor.

Return Value

The source vector divided by div.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.op_Division Method (Vector3, Vector3)

Vector3.op_Division Method (Vector3, Vector3)
See Also
CollapseAll image

Divides the components of a vector by the components of another vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 op_Division (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Divisor vector.

Return Value

The result of dividing the vectors.

Expand image Remarks

Division of a vector by another vector is not mathematically defined. This method simply divides each component of a by the matching component of b.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.op_Equality Method

Vector3.op_Equality Method

Tests vectors for equality.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

true if the vectors are equal; false otherwise.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.op_Inequality Method

Vector3.op_Inequality Method

Tests vectors for inequality.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Vector to compare.
value2
Vector to compare.

Return Value

true if the vectors are not equal; false otherwise.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.op_Multiply Method

Vector3.op_Multiply Method

Multiplies a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector3.op_Multiply (Single, Vector3) | Multiplies a vector by a scalar value.
Vector3.op_Multiply (Vector3, Single) | Multiplies a vector by a scalar value.
Vector3.op_Multiply (Vector3, Vector3) | Multiplies the components of two vectors by each other.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.op_Multiply Method (Single, Vector3)

Vector3.op_Multiply Method (Single, Vector3)
See Also
CollapseAll image

Multiplies a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 op_Multiply (
         float scaleFactor,
         Vector3 value
)

Parameters

scaleFactor
Scalar value.
value
Source vector.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.op_Multiply Method (Vector3, Single)

Vector3.op_Multiply Method (Vector3, Single)
See Also
CollapseAll image

Multiplies a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 op_Multiply (
         Vector3 value,
         float scaleFactor
)

Parameters

value
Source vector.
scaleFactor
Scalar value.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.op_Multiply Method (Vector3, Vector3)

Vector3.op_Multiply Method (Vector3, Vector3)
See Also
CollapseAll image

Multiplies the components of two vectors by each other.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 op_Multiply (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the multiplication.

Expand image Remarks

Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the corresponding components of each vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.op_Subtraction Method

Vector3.op_Subtraction Method

Subtracts a vector from a vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 op_Subtraction (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the subtraction.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.op_UnaryNegation Method

Vector3.op_UnaryNegation Method

Returns a vector pointing in the opposite direction.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 op_UnaryNegation (
         Vector3 value
)

Parameters

value
Source vector.

Return Value

Vector pointing in the opposite direction.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Reflect Method

Vector3.Reflect Method

Returns the reflection of a vector off a surface that has the specified normal.

Expand image Overload List

Name | Description
Vector3.Reflect (Vector3, Vector3) | Returns the reflection of a vector off a surface that has the specified normal.
Vector3.Reflect (Vector3, Vector3, Vector3) | Returns the reflection of a vector off a surface that has the specified normal.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Reflect Method (Vector3, Vector3)

Vector3.Reflect Method (Vector3, Vector3)
See Also Example
CollapseAll image

Returns the reflection of a vector off a surface that has the specified normal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Reflect (
         Vector3 vector,
         Vector3 normal
)

Parameters

vector
Source vector.
normal
Normal of the surface.

Return Value

The reflected vector.

Expand image Remarks

Reflect only gives the direction of a reflection off a surface, it does not determine whether the original vector was close enough to the surface to hit it.

Expand image Example

Determining the position of a moving particle taking into account a surface being struck.
C#
static Nullable<float> RayPlaneIntersection(
    ref Ray ray, ref Plane plane)
{
    Vector3 PointOnPlane = plane.D * plane.Normal;
    float DotNormalDir = Vector3.Dot(plane.Normal, ray.Direction);
    if (DotNormalDir == 0) return null;
    float d = Vector3.Dot(plane.Normal, PointOnPlane - ray.Position) /
        DotNormalDir;
    return d;
}

// Set the position of the particle.
Vector3 position = new Vector3(-19, 0, -3);
// Set the direction in which the particle is moving.
Vector3 direction = new Vector3(1, 0, 0);
// Set the speed at which the particle is moving.
float speed = 4.0f;

//Define a plane with a slope of -1 with respect to the xz-axis
//and passing through (-5, 0, -5).
Plane surface = new Plane(new Vector3(-1f / (float)Math.Sqrt(2), 0,
    -1f / (float)Math.Sqrt(2)), 5f * (float)Math.Sqrt(2));

void MoveParticle()
{
    Ray ray = new Ray(position, direction);

    bool intersected = true;

    Nullable<float> collisionDistance =
        RayPlaneIntersection(ref ray, ref surface);

    // The direction of movement is parallel to the plane.
    if (collisionDistance.HasValue == false)
    {
        intersected = false;
    }
    // The intersection is opposite the direction of movement.
    else if ((collisionDistance.Value <= 0 && speed > 0) ||
        (collisionDistance.Value > 0 && speed <= 0))
    {
        intersected = false;
    }
    // The intersection is further away than the distance moved.
    else if (Math.Abs(collisionDistance.Value) > Math.Abs(speed))
    {
        intersected = false;
    }

    // The particle hit the surface, so reflect it off the surface.
    if (intersected == true)
    {
        // If the vector position + direction * speed passes through
        // the plane, calculate the reflection.
        Vector3 reflectionVector =
            Vector3.Reflect(direction, surface.Normal);

        // Calculate the distance left to move after hitting the surface
        float lengthOfReflection = (speed - collisionDistance.Value);
        Vector3 newPosition = position + direction *
            collisionDistance.Value + lengthOfReflection *
            reflectionVector;
        position = newPosition;
        direction = reflectionVector;
    }
    else // There is no intersection, so just move normally.
    {
        position += direction * speed;
    }
}

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Reflect Method (Vector3, Vector3, Vector3)

Vector3.Reflect Method (Vector3, Vector3, Vector3)
See Also Example
CollapseAll image

Returns the reflection of a vector off a surface that has the specified normal.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Reflect (
         ref Vector3 vector,
         ref Vector3 normal,
         out Vector3 result
)

Parameters

vector
Source vector.
normal
Normal of the surface.
result
[OutAttribute] The reflected vector.

Expand image Remarks

Reflect only gives the direction of a reflection off a surface, it does not determine whether the original vector was close enough to the surface to hit it.

Expand image Example

Determining the position of a moving particle taking into account a surface being struck.
C#
static Nullable<float> RayPlaneIntersection(
    ref Ray ray, ref Plane plane)
{
    Vector3 PointOnPlane = plane.D * plane.Normal;
    float DotNormalDir = Vector3.Dot(plane.Normal, ray.Direction);
    if (DotNormalDir == 0) return null;
    float d = Vector3.Dot(plane.Normal, PointOnPlane - ray.Position) /
        DotNormalDir;
    return d;
}

// Set the position of the particle.
Vector3 position = new Vector3(-19, 0, -3);
// Set the direction in which the particle is moving.
Vector3 direction = new Vector3(1, 0, 0);
// Set the speed at which the particle is moving.
float speed = 4.0f;

//Define a plane with a slope of -1 with respect to the xz-axis
//and passing through (-5, 0, -5).
Plane surface = new Plane(new Vector3(-1f / (float)Math.Sqrt(2), 0,
    -1f / (float)Math.Sqrt(2)), 5f * (float)Math.Sqrt(2));

void MoveParticle()
{
    Ray ray = new Ray(position, direction);

    bool intersected = true;

    Nullable<float> collisionDistance =
        RayPlaneIntersection(ref ray, ref surface);

    // The direction of movement is parallel to the plane.
    if (collisionDistance.HasValue == false)
    {
        intersected = false;
    }
    // The intersection is opposite the direction of movement.
    else if ((collisionDistance.Value <= 0 && speed > 0) ||
        (collisionDistance.Value > 0 && speed <= 0))
    {
        intersected = false;
    }
    // The intersection is further away than the distance moved.
    else if (Math.Abs(collisionDistance.Value) > Math.Abs(speed))
    {
        intersected = false;
    }

    // The particle hit the surface, so reflect it off the surface.
    if (intersected == true)
    {
        // If the vector position + direction * speed passes through
        // the plane, calculate the reflection.
        Vector3 reflectionVector =
            Vector3.Reflect(direction, surface.Normal);

        // Calculate the distance left to move after hitting the surface
        float lengthOfReflection = (speed - collisionDistance.Value);
        Vector3 newPosition = position + direction *
            collisionDistance.Value + lengthOfReflection *
            reflectionVector;
        position = newPosition;
        direction = reflectionVector;
    }
    else // There is no intersection, so just move normally.
    {
        position += direction * speed;
    }
}

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.SmoothStep Method

Vector3.SmoothStep Method

Interpolates between two values using a cubic equation.

Expand image Overload List

Name | Description
Vector3.SmoothStep (Vector3, Vector3, Single) | Interpolates between two values using a cubic equation.
Vector3.SmoothStep (Vector3, Vector3, Single, Vector3) | Interpolates between two values using a cubic equation.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.SmoothStep Method (Vector3, Vector3, Single)

Vector3.SmoothStep Method (Vector3, Vector3, Single)
See Also
CollapseAll image

Interpolates between two values using a cubic equation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 SmoothStep (
         Vector3 value1,
         Vector3 value2,
         float amount
)

Parameters

value1
Source value.
value2
Source value.
amount
Weighting value.

Return Value

Interpolated value.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.SmoothStep Method (Vector3, Vector3, Single, Vector3)

Vector3.SmoothStep Method (Vector3, Vector3, Single, Vector3)
See Also
CollapseAll image

Interpolates between two values using a cubic equation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void SmoothStep (
         ref Vector3 value1,
         ref Vector3 value2,
         float amount,
         out Vector3 result
)

Parameters

value1
Source vector.
value2
Source vector.
amount
Weighting value.
result
[OutAttribute] The interpolated value.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Subtract Method

Vector3.Subtract Method

Subtracts a vector from a vector.

Expand image Overload List

Name | Description
Vector3.Subtract (Vector3, Vector3) | Subtracts a vector from a vector.
Vector3.Subtract (Vector3, Vector3, Vector3) | Subtracts a vector from a vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Subtract Method (Vector3, Vector3)

Vector3.Subtract Method (Vector3, Vector3)
See Also
CollapseAll image

Subtracts a vector from a vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Subtract (
         Vector3 value1,
         Vector3 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the subtraction.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Subtract Method (Vector3, Vector3, Vector3)

Vector3.Subtract Method (Vector3, Vector3, Vector3)
See Also
CollapseAll image

Subtracts a vector from a vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Subtract (
         ref Vector3 value1,
         ref Vector3 value2,
         out Vector3 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the subtraction.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.ToString Method

Vector3.ToString Method

Retrieves a string representation of the current object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Transform Method

Vector3.Transform Method

Transforms a Vector3 or array of Vector3s by a specified Matrix or Quaternion.

Expand image Overload List

Name | Description
Vector3.Transform (Vector3, Matrix) | Transforms a 3D vector by the given matrix.
Vector3.Transform (Vector3, Matrix, Vector3) | Transforms a Vector3 by the given Matrix.
Vector3.Transform (Vector3, Quaternion) | Transforms a Vector3 by a specified Quaternion rotation.
Vector3.Transform (Vector3, Quaternion, Vector3) | Transforms a Vector3 by a specified Quaternion rotation.
Vector3.Transform (Vector3[], Int32, Matrix, Vector3[], Int32, Int32) | Applies a specified transform Matrix to a specified range of an array of Vector3s and writes the results into a specified range of a destination array.
Vector3.Transform (Vector3[], Int32, Quaternion, Vector3[], Int32, Int32) | Applies a specified Quaternion rotation to a specified range of an array of Vector3s and writes the results into a specified range of a destination array.
Vector3.Transform (Vector3[], Matrix, Vector3[]) | Transforms a source array of Vector3s by a specified Matrix and writes the results to an existing destination array.
Vector3.Transform (Vector3[], Quaternion, Vector3[]) | Transforms a source array of Vector3s by a specified Quaternion rotation and writes the results to an existing destination array.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.Transform Method (Vector3, Matrix)

Vector3.Transform Method (Vector3, Matrix)
See Also
CollapseAll image

Transforms a 3D vector by the given matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Transform (
         Vector3 position,
         Matrix matrix
)

Parameters

position
The source vector.
matrix
The transformation matrix.

Return Value

The transformed vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Transform Method (Vector3, Matrix, Vector3)

Vector3.Transform Method (Vector3, Matrix, Vector3)
See Also
CollapseAll image

Transforms a Vector3 by the given Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Vector3 position,
         ref Matrix matrix,
         out Vector3 result
)

Parameters

position
The source Vector3.
matrix
The transformation Matrix.
result
[OutAttribute] The transformed vector.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Transform Method (Vector3, Quaternion)

Vector3.Transform Method (Vector3, Quaternion)
See Also
CollapseAll image

Transforms a Vector3 by a specified Quaternion rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Transform (
         Vector3 value,
         Quaternion rotation
)

Parameters

value
The Vector3 to rotate.
rotation
The Quaternion rotation to apply.

Return Value

Returns a new Vector3 that results from the rotation.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Transform Method (Vector3, Quaternion, Vector3)

Vector3.Transform Method (Vector3, Quaternion, Vector3)
See Also
CollapseAll image

Transforms a Vector3 by a specified Quaternion rotation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Vector3 value,
         ref Quaternion rotation,
         out Vector3 result
)

Parameters

value
The Vector3 to rotate.
rotation
The Quaternion rotation to apply.
result
[OutAttribute] An existing Vector3 filled in with the results of the rotation.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Transform Method (Vector3[], Int32, Matrix, Vector3[], Int32, Int32)

Vector3.Transform Method (Vector3[], Int32, Matrix, Vector3[], Int32, Int32)
See Also
CollapseAll image

Applies a specified transform Matrix to a specified range of an array of Vector3s and writes the results into a specified range of a destination array.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector3[] sourceArray,
         int sourceIndex,
         ref Matrix matrix,
         Vector3[] destinationArray,
         int destinationIndex,
         int length
)

Parameters

sourceArray
The source array.
sourceIndex
The index in the source array at which to start.
matrix
The transform Matrix to apply.
destinationArray
The existing destination array.
destinationIndex
The index in the destination array at which to start.
length
The number of Vector3s to transform.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result or the combination of sourceIndex and length was greater than sourceArray.Length.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Transform Method (Vector3[], Int32, Quaternion, Vector3[], Int32, Int32)

Vector3.Transform Method (Vector3[], Int32, Quaternion, Vector3[], Int32, Int32)
See Also
CollapseAll image

Applies a specified Quaternion rotation to a specified range of an array of Vector3s and writes the results into a specified range of a destination array.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector3[] sourceArray,
         int sourceIndex,
         ref Quaternion rotation,
         Vector3[] destinationArray,
         int destinationIndex,
         int length
)

Parameters

sourceArray
The source array.
sourceIndex
The index in the source array at which to start.
rotation
The Quaternion rotation to apply.
destinationArray
The existing destination array.
destinationIndex
The index in the destination array at which to start.
length
The number of Vector3s to transform.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result or the combination of sourceIndex and length was greater than sourceArray.Length.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Transform Method (Vector3[], Matrix, Vector3[])

Vector3.Transform Method (Vector3[], Matrix, Vector3[])
See Also
CollapseAll image

Transforms a source array of Vector3s by a specified Matrix and writes the results to an existing destination array.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector3[] sourceArray,
         ref Matrix matrix,
         Vector3[] destinationArray
)

Parameters

sourceArray
The source array.
matrix
The transform Matrix to apply.
destinationArray
An existing destination array into which the transformed Vector3s are written.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Transform Method (Vector3[], Quaternion, Vector3[])

Vector3.Transform Method (Vector3[], Quaternion, Vector3[])
See Also
CollapseAll image

Transforms a source array of Vector3s by a specified Quaternion rotation and writes the results to an existing destination array.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector3[] sourceArray,
         ref Quaternion rotation,
         Vector3[] destinationArray
)

Parameters

sourceArray
The source array.
rotation
The Quaternion rotation to apply.
destinationArray
An existing destination array into which the transformed Vector3s are written.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.TransformNormal Method

Vector3.TransformNormal Method

Transforms a vector normal by a matrix.

Expand image Overload List

Name | Description
Vector3.TransformNormal (Vector3, Matrix) | Transforms a 3D vector normal by a matrix.
Vector3.TransformNormal (Vector3, Matrix, Vector3) | Transforms a vector normal by a matrix.
Vector3.TransformNormal (Vector3[], Int32, Matrix, Vector3[], Int32, Int32) | Transforms a specified range in an array of 3D vector normals by a specified Matrix and writes the results to a specified range in a destination array.
Vector3.TransformNormal (Vector3[], Matrix, Vector3[]) | Transforms an array of 3D vector normals by a specified Matrix.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace


Vector3.TransformNormal Method (Vector3, Matrix)

Vector3.TransformNormal Method (Vector3, Matrix)
See Also
CollapseAll image

Transforms a 3D vector normal by a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 TransformNormal (
         Vector3 normal,
         Matrix matrix
)

Parameters

normal
The source vector.
matrix
The transformation matrix.

Return Value

The transformed vector normal.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.TransformNormal Method (Vector3, Matrix, Vector3)

Vector3.TransformNormal Method (Vector3, Matrix, Vector3)
See Also
CollapseAll image

Transforms a vector normal by a matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void TransformNormal (
         ref Vector3 normal,
         ref Matrix matrix,
         out Vector3 result
)

Parameters

normal
The source vector.
matrix
The transformation Matrix.
result
[OutAttribute] The Vector3 resulting from the transformation.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.TransformNormal Method (Vector3[], Int32, Matrix, Vector3[], Int32, Int32)

Vector3.TransformNormal Method (Vector3[], Int32, Matrix, Vector3[], Int32, Int32)
See Also
CollapseAll image

Transforms a specified range in an array of 3D vector normals by a specified Matrix and writes the results to a specified range in a destination array.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void TransformNormal (
         Vector3[] sourceArray,
         int sourceIndex,
         ref Matrix matrix,
         Vector3[] destinationArray,
         int destinationIndex,
         int length
)

Parameters

sourceArray
The source array of Vector3 normals.
sourceIndex
The starting index in the source array.
matrix
The transform Matrix to apply.
destinationArray
The destination Vector3 array.
destinationIndex
The starting index in the destination array.
length
The number of vectors to transform.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result or the combination of sourceIndex and length was greater than sourceArray.Length.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.TransformNormal Method (Vector3[], Matrix, Vector3[])

Vector3.TransformNormal Method (Vector3[], Matrix, Vector3[])
See Also
CollapseAll image

Transforms an array of 3D vector normals by a specified Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void TransformNormal (
         Vector3[] sourceArray,
         ref Matrix matrix,
         Vector3[] destinationArray
)

Parameters

sourceArray
The array of Vector3 normals to transform.
matrix
The transform matrix to apply.
destinationArray
An existing Vector3 array into which the results of the transforms are written.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3 Properties

Vector3 Properties

Expand image Public Properties

Name | Description
Backward | Returns a unit Vector3 designating backward in a right-handed coordinate system (0, 0, 1).
Down | Returns a unit Vector3 designating down (0, −1, 0).
Forward | Returns a unit Vector3 designating forward in a right-handed coordinate system(0, 0, −1).
Left | Returns a unit Vector3 designating left (−1, 0, 0).
One | Returns a Vector3 with ones in all of its components.
Right | Returns a unit Vector3 pointing to the right (1, 0, 0).
UnitX | Returns the x unit Vector3 (1, 0, 0).
UnitY | Returns the y unit Vector3 (0, 1, 0).
UnitZ | Returns the z unit Vector3 (0, 0, 1).
Up | Returns a unit vector designating up (0, 1, 0).
Zero | Returns a Vector3 with all of its components set to zero.

Expand image See Also

Reference

Vector3 Structure
Microsoft.Xna.Framework Namespace


Vector3.Backward Property

Vector3.Backward Property

Returns a unit Vector3 designating backward in a right-handed coordinate system (0, 0, 1).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Backward { get; }

Property Value

A unit Vector3 pointing backward.

Expand image Remarks

The XNA Framework uses a right-handed coordinate system, with the positive x-axis pointing to the right, the positive y-axis pointing up, and the positive z-axis pointing toward the observer.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Down Property

Vector3.Down Property

Returns a unit Vector3 designating down (0, −1, 0).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Down { get; }

Property Value

A unit Vector3 pointing down.

Expand image Remarks

The XNA Framework uses a right-handed coordinate system, with the positive x-axis pointing to the right, the positive y-axis pointing up, and the positive z-axis pointing toward the observer.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Forward Property

Vector3.Forward Property

Returns a unit Vector3 designating forward in a right-handed coordinate system(0, 0, −1).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Forward { get; }

Property Value

A unit Vector3 pointing forward.

Expand image Remarks

The XNA Framework uses a right-handed coordinate system, with the positive x-axis pointing to the right, the positive y-axis pointing up, and the positive z-axis pointing toward the observer.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Left Property

Vector3.Left Property

Returns a unit Vector3 designating left (−1, 0, 0).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Left { get; }

Property Value

A unit Vector3 pointing left.

Expand image Remarks

The XNA Framework uses a right-handed coordinate system, with the positive x-axis pointing to the right, the positive y-axis pointing up, and the positive z-axis pointing toward the observer.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.One Property

Vector3.One Property

Returns a Vector3 with ones in all of its components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 One { get; }

Property Value

a Vector3 with ones in all of its components.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Right Property

Vector3.Right Property

Returns a unit Vector3 pointing to the right (1, 0, 0).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Right { get; }

Property Value

A unit Vector3 pointing to the right.

Expand image Remarks

The XNA Framework uses a right-handed coordinate system, with the positive x-axis pointing to the right, the positive y-axis pointing up, and the positive z-axis pointing toward the observer.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.UnitX Property

Vector3.UnitX Property

Returns the x unit Vector3 (1, 0, 0).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 UnitX { get; }

Property Value

Returns the x unit Vector3 .

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.UnitY Property

Vector3.UnitY Property

Returns the y unit Vector3 (0, 1, 0).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 UnitY { get; }

Property Value

Returns the y unit Vector3.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.UnitZ Property

Vector3.UnitZ Property

Returns the z unit Vector3 (0, 0, 1).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 UnitZ { get; }

Property Value

Returns the z unit Vector3.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Up Property

Vector3.Up Property

Returns a unit vector designating up (0, 1, 0).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Up { get; }

Property Value

A unit Vector3 pointing up.

Expand image Remarks

The XNA Framework uses a right-handed coordinate system, with the positive x-axis pointing to the right, the positive y-axis pointing up, and the positive z-axis pointing toward the observer.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector3.Zero Property

Vector3.Zero Property

Returns a Vector3 with all of its components set to zero.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector3 Zero { get; }

Property Value

A Vector3 with all of its components set to zero.

Expand image See Also

Reference

Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4 Structure

Vector4 Structure

Defines a vector with four components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.Vector4Converter)")]
[SerializableAttribute]
public struct Vector4 : IEquatable<Vector4>

Expand image See Also

Reference

Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4 Members

Vector4 Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the Vector4 type.

Expand image Public Constructors

 | Name | Description
Public Method | Vector4 | Overloaded. Initializes a new instance of Vector4.

Expand image Public Fields

 | Name | Description
Public Field | W | Gets or sets the w-component of the vector.
Public Field | X | Gets or sets the x-component of the vector.
Public Field | Y | Gets or sets the y-component of the vector.
Public Field | Z | Gets or sets the z-component of the vector.

Expand image Public Properties

Name | Description
One | Returns a Vector4 with all of its components set to one.
UnitW | Returns the Vector4 (0, 0, 0, 1).
UnitX | Returns the Vector4 (1, 0, 0, 0).
UnitY | Returns the Vector4 (0, 1, 0, 0).
UnitZ | Returns the Vector4 (0, 0, 1, 0).
Zero | Returns a Vector4 with all of its components set to zero.

Expand image Public Methods

 | Name | Description
 | Add | Overloaded. Adds two vectors.
 | Barycentric | Overloaded. Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 4D triangle.
 | CatmullRom | Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
 | Clamp | Overloaded. Restricts a value to be within a specified range.
 | Distance | Overloaded. Calculates the distance between two vectors.
 | DistanceSquared | Overloaded. Calculates the distance between two vectors squared.
 | Divide | Overloaded. Divide a vector by a scalar or another vector.
 | Dot | Overloaded. Calculates the dot product of two vectors.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code of this object.
Public Method | GetType | (Inherited from Object.)
 | Hermite | Overloaded. Performs a Hermite spline interpolation.
Public Method | Length | Calculates the length of the vector.
Public Method | LengthSquared | Calculates the length of the vector squared.
 | Lerp | Overloaded. Performs a linear interpolation between two vectors.
 | Max | Overloaded. Returns a vector that contains the highest value from each matching pair of components.
 | Min | Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
 | Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | Negate | Overloaded. Returns a vector pointing in the opposite direction.
Public Method | Normalize | Overloaded. Creates a unit vector from the specified vector.
 | op_Addition | Adds two vectors.
 | op_Division | Overloaded. Divides a vector by a scalar or another vector.
 | op_Equality | Tests vectors for equality.
 | op_Inequality | Tests vectors for inequality.
 | op_Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | op_Subtraction | Subtracts a vector from a vector.
 | op_UnaryNegation | Returns a vector pointing in the opposite direction.
 | SmoothStep | Overloaded. Interpolates between two values using a cubic equation.
 | Subtract | Overloaded. Subtracts a vector from a vector.
Public Method | ToString | Retrieves a string representation of the current object.
 | Transform | Overloaded. Transforms one or more vectors by a specified Matrix or Quaternion and returns the results in Vector4 form.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Vector4 Structure
Microsoft.Xna.Framework Namespace


Vector4 Fields

Vector4 Fields

Expand image Public Fields

 | Name | Description
Public Field | W | Gets or sets the w-component of the vector.
Public Field | X | Gets or sets the x-component of the vector.
Public Field | Y | Gets or sets the y-component of the vector.
Public Field | Z | Gets or sets the z-component of the vector.

Expand image See Also

Reference

Vector4 Structure
Microsoft.Xna.Framework Namespace


Vector4.W Field

Vector4.W Field

Gets or sets the w-component of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float W

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.X Field

Vector4.X Field

Gets or sets the x-component of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float X

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Y Field

Vector4.Y Field

Gets or sets the y-component of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Y

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Z Field

Vector4.Z Field

Gets or sets the z-component of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Z

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4 Constructor

Vector4 Constructor

Initializes a new instance of Vector4.

Expand image Overload List

Name | Description
Vector4 (Single) | Creates a new instance of Vector4.
Vector4 (Single, Single, Single, Single) | Initializes a new instance of Vector4.
Vector4 (Vector2, Single, Single) | Initializes a new instance of Vector4.
Vector4 (Vector3, Single) | Initializes a new instance of Vector4.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4 Constructor (Single)

Vector4 Constructor (Single)
See Also
CollapseAll image

Creates a new instance of Vector4.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 (
         float value
)

Parameters

value
Value to initialize each component to.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4 Constructor (Single, Single, Single, Single)

Vector4 Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of Vector4.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
Initial value for the x-component of the vector.
y
Initial value for the y-component of the vector.
z
Initial value for the z-component of the vector.
w
Initial value for the w-component of the vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4 Constructor (Vector2, Single, Single)

Vector4 Constructor (Vector2, Single, Single)
See Also
CollapseAll image

Initializes a new instance of Vector4.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 (
         Vector2 value,
         float z,
         float w
)

Parameters

value
A vector containing the values to initialize x and y components with.
z
Initial value for the z-component of the vector.
w
Initial value for the w-component of the vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4 Constructor (Vector3, Single)

Vector4 Constructor (Vector3, Single)
See Also
CollapseAll image

Initializes a new instance of Vector4.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 (
         Vector3 value,
         float w
)

Parameters

value
A vector containing the values to initialize x, y, and z components with.
w
Initial value for the w-component of the vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4 Methods

Vector4 Methods

Expand image Public Methods

 | Name | Description
 | Add | Overloaded. Adds two vectors.
 | Barycentric | Overloaded. Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 4D triangle.
 | CatmullRom | Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
 | Clamp | Overloaded. Restricts a value to be within a specified range.
 | Distance | Overloaded. Calculates the distance between two vectors.
 | DistanceSquared | Overloaded. Calculates the distance between two vectors squared.
 | Divide | Overloaded. Divide a vector by a scalar or another vector.
 | Dot | Overloaded. Calculates the dot product of two vectors.
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code of this object.
Public Method | GetType | (Inherited from Object.)
 | Hermite | Overloaded. Performs a Hermite spline interpolation.
Public Method | Length | Calculates the length of the vector.
Public Method | LengthSquared | Calculates the length of the vector squared.
 | Lerp | Overloaded. Performs a linear interpolation between two vectors.
 | Max | Overloaded. Returns a vector that contains the highest value from each matching pair of components.
 | Min | Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
 | Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | Negate | Overloaded. Returns a vector pointing in the opposite direction.
Public Method | Normalize | Overloaded. Creates a unit vector from the specified vector.
 | op_Addition | Adds two vectors.
 | op_Division | Overloaded. Divides a vector by a scalar or another vector.
 | op_Equality | Tests vectors for equality.
 | op_Inequality | Tests vectors for inequality.
 | op_Multiply | Overloaded. Multiplies a vector by a scalar or another vector.
 | op_Subtraction | Subtracts a vector from a vector.
 | op_UnaryNegation | Returns a vector pointing in the opposite direction.
 | SmoothStep | Overloaded. Interpolates between two values using a cubic equation.
 | Subtract | Overloaded. Subtracts a vector from a vector.
Public Method | ToString | Retrieves a string representation of the current object.
 | Transform | Overloaded. Transforms one or more vectors by a specified Matrix or Quaternion and returns the results in Vector4 form.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Vector4 Structure
Microsoft.Xna.Framework Namespace


Vector4.Add Method

Vector4.Add Method

Adds two vectors.

Expand image Overload List

Name | Description
Vector4.Add (Vector4, Vector4) | Adds two vectors.
Vector4.Add (Vector4, Vector4, Vector4) | Adds two vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Add Method (Vector4, Vector4)

Vector4.Add Method (Vector4, Vector4)
See Also
CollapseAll image

Adds two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Add (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Sum of the two vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Add Method (Vector4, Vector4, Vector4)

Vector4.Add Method (Vector4, Vector4, Vector4)
See Also
CollapseAll image

Adds two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Add (
         ref Vector4 value1,
         ref Vector4 value2,
         out Vector4 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] Sum of the source vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Barycentric Method

Vector4.Barycentric Method

Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 4D triangle.

Expand image Overload List

Name | Description
Vector4.Barycentric (Vector4, Vector4, Vector4, Single, Single) | Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 4D triangle.
Vector4.Barycentric (Vector4, Vector4, Vector4, Single, Single, Vector4) | Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in Barycentric (areal) coordinates relative to a 4D triangle.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Barycentric Method (Vector4, Vector4, Vector4, Single, Single)

Vector4.Barycentric Method (Vector4, Vector4, Vector4, Single, Single)
See Also
CollapseAll image

Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 4D triangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Barycentric (
         Vector4 value1,
         Vector4 value2,
         Vector4 value3,
         float amount1,
         float amount2
)

Parameters

value1
A Vector4 containing the 4D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector4 containing the 4D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector4 containing the 4D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).

Return Value

A new Vector4 containing the 4D Cartesian coordinates of the specified point.

Expand image Remarks

About Barycentric Coordinates

Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by 3 weighting factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to the location of the point, as specified in the following formulas.

    Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
    Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
    Pz = (b1 * V1z) + (b2 * V2z) + (b3 * V3z);
    Pw = (b1 * V1w) + (b2 * V2w) + (b3 * V3w);

Such triple weighting factors b1, b2, and b3 are called barycentric coordinates.

Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same point as b1, b2, and b3 for any positive value of k.

If a set of barycentric coordinates is normalized so that: b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3, since b1 equals (1 − b2 − b3).

What Vector4 Barycentric Does

The Vector4 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument and b3 is the amount2 argument). The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.

Barycentric then calculates the Cartesian coordinate of P as follows:

    Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
    Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);
    Pz = ( (1 - b2 - b3) * V1z ) + (b2 * V2z) + (b3 * V3z);
    Pw = ( (1 - b2 - b3) * V1w ) + (b2 * V2w) + (b3 * V3w);

Thus, to calculate the 3D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric together with the appropropriate normalized barycentric (areal) coordinates of P.

The following relationships may be useful.

  • If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle defined by value1, value2, and value3.
  • If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value3.
  • If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value2.
  • If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by value2 and value3.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Barycentric Method (Vector4, Vector4, Vector4, Single, Single, Vector4)

Vector4.Barycentric Method (Vector4, Vector4, Vector4, Single, Single, Vector4)
See Also
CollapseAll image

Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in Barycentric (areal) coordinates relative to a 4D triangle.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Barycentric (
         ref Vector4 value1,
         ref Vector4 value2,
         ref Vector4 value3,
         float amount1,
         float amount2,
         out Vector4 result
)

Parameters

value1
A Vector4 containing the 4D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector4 containing the 4D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector4 containing the 4D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
result
[OutAttribute] The 4D Cartesian coordinates of the specified point are placed in this Vector4 on exit.

Expand image Remarks

About Barycentric Coordinates

Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to the location of the point, as specified in the following formulas.

    Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
    Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
    Pz = (b1 * V1z) + (b2 * V2z) + (b3 * V3z);
    Pw = (b1 * V1w) + (b2 * V2w) + (b3 * V3w);

Such triple weighting factors b1, b2, and b3 are called barycentric coordinates.

Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same point as b1, b2, and b3 for any positive value of k.

If a set of barycentric coordinates is normalized so that: b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3, since b1 equals (1 − b2 − b3).

What Vector4 Barycentric Does

The Vector4 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument and b3 is the amount2 argument). The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.

Barycentric then calculates the Cartesian coordinate of P as follows:

    Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
    Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);
    Pz = ( (1 - b2 - b3) * V1z ) + (b2 * V2z) + (b3 * V3z);
    Pw = ( (1 - b2 - b3) * V1w ) + (b2 * V2w) + (b3 * V3w);

Thus, to calculate the 3D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric together with the appropropriate normalized barycentric (areal) coordinates of P.

The following relationships may be useful.

  • If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle defined by value1, value2, and value3.
  • If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value3.
  • If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by value1 and value2.
  • If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by value2 and value3.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.CatmullRom Method

Vector4.CatmullRom Method

Performs a Catmull-Rom interpolation using the specified positions.

Expand image Overload List

Name | Description
Vector4.CatmullRom (Vector4, Vector4, Vector4, Vector4, Single) | Performs a Catmull-Rom interpolation using the specified positions.
Vector4.CatmullRom (Vector4, Vector4, Vector4, Vector4, Single, Vector4) | Performs a Catmull-Rom interpolation using the specified positions.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.CatmullRom Method (Vector4, Vector4, Vector4, Vector4, Single)

Vector4.CatmullRom Method (Vector4, Vector4, Vector4, Vector4, Single)
See Also
CollapseAll image

Performs a Catmull-Rom interpolation using the specified positions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 CatmullRom (
         Vector4 value1,
         Vector4 value2,
         Vector4 value3,
         Vector4 value4,
         float amount
)

Parameters

value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.

Return Value

A vector that is the result of the Catmull-Rom interpolation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.CatmullRom Method (Vector4, Vector4, Vector4, Vector4, Single, Vector4)

Vector4.CatmullRom Method (Vector4, Vector4, Vector4, Vector4, Single, Vector4)
See Also
CollapseAll image

Performs a Catmull-Rom interpolation using the specified positions.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void CatmullRom (
         ref Vector4 value1,
         ref Vector4 value2,
         ref Vector4 value3,
         ref Vector4 value4,
         float amount,
         out Vector4 result
)

Parameters

value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.
result
[OutAttribute] A vector that is the result of the Catmull-Rom interpolation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Clamp Method

Vector4.Clamp Method

Restricts a value to be within a specified range.

Expand image Overload List

Name | Description
Vector4.Clamp (Vector4, Vector4, Vector4) | Restricts a value to be within a specified range.
Vector4.Clamp (Vector4, Vector4, Vector4, Vector4) | Restricts a value to be within a specified range.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Clamp Method (Vector4, Vector4, Vector4)

Vector4.Clamp Method (Vector4, Vector4, Vector4)
See Also
CollapseAll image

Restricts a value to be within a specified range.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Clamp (
         Vector4 value1,
         Vector4 min,
         Vector4 max
)

Parameters

value1
The value to clamp.
min
The minimum value.
max
The maximum value.

Return Value

The clamped value.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Clamp Method (Vector4, Vector4, Vector4, Vector4)

Vector4.Clamp Method (Vector4, Vector4, Vector4, Vector4)
See Also
CollapseAll image

Restricts a value to be within a specified range.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Clamp (
         ref Vector4 value1,
         ref Vector4 min,
         ref Vector4 max,
         out Vector4 result
)

Parameters

value1
The value to clamp.
min
The minimum value.
max
The maximum value.
result
[OutAttribute] The clamped value.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Distance Method

Vector4.Distance Method

Calculates the distance between two vectors.

Expand image Overload List

Name | Description
Vector4.Distance (Vector4, Vector4) | Calculates the distance between two vectors.
Vector4.Distance (Vector4, Vector4, Single) | Calculates the distance between two vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Distance Method (Vector4, Vector4)

Vector4.Distance Method (Vector4, Vector4)
See Also
CollapseAll image

Calculates the distance between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Distance (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Distance between the source vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Distance Method (Vector4, Vector4, Single)

Vector4.Distance Method (Vector4, Vector4, Single)
See Also
CollapseAll image

Calculates the distance between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Distance (
         ref Vector4 value1,
         ref Vector4 value2,
         out float result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.DistanceSquared Method

Vector4.DistanceSquared Method

Calculates the distance between two vectors squared.

Expand image Overload List

Name | Description
Vector4.DistanceSquared (Vector4, Vector4) | Calculates the distance between two vectors squared.
Vector4.DistanceSquared (Vector4, Vector4, Single) | Calculates the distance between two vectors squared.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.DistanceSquared Method (Vector4, Vector4)

Vector4.DistanceSquared Method (Vector4, Vector4)
See Also
CollapseAll image

Calculates the distance between two vectors squared.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float DistanceSquared (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

The distance between the source vectors squared.

Expand image Remarks

Distance is calculated with the following formula:

Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A, compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square roots, which are computationally expensive. However, using distance squared provides the same information and avoids calculating two square roots.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.DistanceSquared Method (Vector4, Vector4, Single)

Vector4.DistanceSquared Method (Vector4, Vector4, Single)
See Also
CollapseAll image

Calculates the distance between two vectors squared.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void DistanceSquared (
         ref Vector4 value1,
         ref Vector4 value2,
         out float result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the two vectors squared.

Expand image Remarks

Distance is calculated with the formula:

Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A, compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square roots, which are computationally expensive. However, using distance squared provides the same information and avoids calculating two square roots.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Divide Method

Vector4.Divide Method

Divide a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector4.Divide (Vector4, Single) | Divides a vector by a scalar value.
Vector4.Divide (Vector4, Single, Vector4) | Divides a vector by a scalar value.
Vector4.Divide (Vector4, Vector4) | Divides the components of a vector by the components of another vector.
Vector4.Divide (Vector4, Vector4, Vector4) | Divides the components of a vector by the components of another vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Divide Method (Vector4, Single)

Vector4.Divide Method (Vector4, Single)
See Also
CollapseAll image

Divides a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Divide (
         Vector4 value1,
         float divider
)

Parameters

value1
Source vector.
divider
The divisor.

Return Value

The source vector divided by b.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Divide Method (Vector4, Single, Vector4)

Vector4.Divide Method (Vector4, Single, Vector4)
See Also
CollapseAll image

Divides a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Divide (
         ref Vector4 value1,
         float divider,
         out Vector4 result
)

Parameters

value1
Source vector.
divider
The divisor.
result
[OutAttribute] The result of the division.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Divide Method (Vector4, Vector4)

Vector4.Divide Method (Vector4, Vector4)
See Also
CollapseAll image

Divides the components of a vector by the components of another vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Divide (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Divisor vector.

Return Value

The result of dividing the vectors.

Expand image Remarks

Division of a vector by another vector is not mathematically defined. This method simply divides each component of a by the matching component of b.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Divide Method (Vector4, Vector4, Vector4)

Vector4.Divide Method (Vector4, Vector4, Vector4)
See Also
CollapseAll image

Divides the components of a vector by the components of another vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Divide (
         ref Vector4 value1,
         ref Vector4 value2,
         out Vector4 result
)

Parameters

value1
Source vector.
value2
The divisor.
result
[OutAttribute] The result of the division.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Dot Method

Vector4.Dot Method

Calculates the dot product of two vectors.

Expand image Overload List

Name | Description
Vector4.Dot (Vector4, Vector4) | Calculates the dot product of two vectors.
Vector4.Dot (Vector4, Vector4, Single) | Calculates the dot product of two vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Dot Method (Vector4, Vector4)

Vector4.Dot Method (Vector4, Vector4)
See Also
CollapseAll image

Calculates the dot product of two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Dot (
         Vector4 vector1,
         Vector4 vector2
)

Parameters

vector1
Source vector.
vector2
Source vector.

Return Value

The dot product of the two vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Dot Method (Vector4, Vector4, Single)

Vector4.Dot Method (Vector4, Vector4, Single)
See Also
CollapseAll image

Calculates the dot product of two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Dot (
         ref Vector4 vector1,
         ref Vector4 vector2,
         out float result
)

Parameters

vector1
Source vector.
vector2
Source vector.
result
[OutAttribute] The dot product of the two vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Equals Method

Vector4.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Vector4.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.
Vector4.Equals (Vector4) | Determines whether the specified Object is equal to the Vector4.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Equals Method (Object)

Vector4.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Equals Method (Vector4)

Vector4.Equals Method (Vector4)
See Also
CollapseAll image

Determines whether the specified Object is equal to the Vector4.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Vector4 other
)

Parameters

other
The Vector4 to compare with the current Vector4.

Return Value

true if the specified Vector4 is equal to the current Vector4; false otherwise.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.GetHashCode Method

Vector4.GetHashCode Method

Gets the hash code of this object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code of the vector object.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Hermite Method

Vector4.Hermite Method

Performs a Hermite spline interpolation.

Expand image Overload List

Name | Description
Vector4.Hermite (Vector4, Vector4, Vector4, Vector4, Single) | Performs a Hermite spline interpolation.
Vector4.Hermite (Vector4, Vector4, Vector4, Vector4, Single, Vector4) | Performs a Hermite spline interpolation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Hermite Method (Vector4, Vector4, Vector4, Vector4, Single)

Vector4.Hermite Method (Vector4, Vector4, Vector4, Vector4, Single)
See Also
CollapseAll image

Performs a Hermite spline interpolation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Hermite (
         Vector4 value1,
         Vector4 tangent1,
         Vector4 value2,
         Vector4 tangent2,
         float amount
)

Parameters

value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.

Return Value

The result of the Hermite spline interpolation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Hermite Method (Vector4, Vector4, Vector4, Vector4, Single, Vector4)

Vector4.Hermite Method (Vector4, Vector4, Vector4, Vector4, Single, Vector4)
See Also
CollapseAll image

Performs a Hermite spline interpolation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Hermite (
         ref Vector4 value1,
         ref Vector4 tangent1,
         ref Vector4 value2,
         ref Vector4 tangent2,
         float amount,
         out Vector4 result
)

Parameters

value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.
result
[OutAttribute] The result of the Hermite spline interpolation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Length Method

Vector4.Length Method

Calculates the length of the vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Length ()

Return Value

The length of the vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.LengthSquared Method

Vector4.LengthSquared Method

Calculates the length of the vector squared.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float LengthSquared ()

Return Value

The length of the vector squared.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Lerp Method

Vector4.Lerp Method

Performs a linear interpolation between two vectors.

Expand image Overload List

Name | Description
Vector4.Lerp (Vector4, Vector4, Single) | Performs a linear interpolation between two vectors.
Vector4.Lerp (Vector4, Vector4, Single, Vector4) | Performs a linear interpolation between two vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Lerp Method (Vector4, Vector4, Single)

Vector4.Lerp Method (Vector4, Vector4, Single)
See Also
CollapseAll image

Performs a linear interpolation between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Lerp (
         Vector4 value1,
         Vector4 value2,
         float amount
)

Parameters

value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.

Return Value

The linear interpolation of the two vectors.

Expand image Remarks

This method performs the linear interpolation based on the following formula.

value1 + (value2 - value1) * amount

Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Lerp Method (Vector4, Vector4, Single, Vector4)

Vector4.Lerp Method (Vector4, Vector4, Single, Vector4)
See Also
CollapseAll image

Performs a linear interpolation between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Lerp (
         ref Vector4 value1,
         ref Vector4 value2,
         float amount,
         out Vector4 result
)

Parameters

value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.
result
[OutAttribute] The result of the interpolation.

Expand image Remarks

This method performs the linear interpolation based on the following formula.

value1 + (value2 - value1) * amount

Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Max Method

Vector4.Max Method

Returns a vector that contains the highest value from each matching pair of components.

Expand image Overload List

Name | Description
Vector4.Max (Vector4, Vector4) | Returns a vector that contains the highest value from each matching pair of components.
Vector4.Max (Vector4, Vector4, Vector4) | Returns a vector that contains the highest value from each matching pair of components.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Max Method (Vector4, Vector4)

Vector4.Max Method (Vector4, Vector4)
See Also
CollapseAll image

Returns a vector that contains the highest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Max (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

The maximized vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Max Method (Vector4, Vector4, Vector4)

Vector4.Max Method (Vector4, Vector4, Vector4)
See Also
CollapseAll image

Returns a vector that contains the highest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Max (
         ref Vector4 value1,
         ref Vector4 value2,
         out Vector4 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The maximized vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Min Method

Vector4.Min Method

Returns a vector that contains the lowest value from each matching pair of components.

Expand image Overload List

Name | Description
Vector4.Min (Vector4, Vector4) | Returns a vector that contains the lowest value from each matching pair of components.
Vector4.Min (Vector4, Vector4, Vector4) | Returns a vector that contains the lowest value from each matching pair of components.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Min Method (Vector4, Vector4)

Vector4.Min Method (Vector4, Vector4)
See Also
CollapseAll image

Returns a vector that contains the lowest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Min (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

The minimized vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Min Method (Vector4, Vector4, Vector4)

Vector4.Min Method (Vector4, Vector4, Vector4)
See Also
CollapseAll image

Returns a vector that contains the lowest value from each matching pair of components.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Min (
         ref Vector4 value1,
         ref Vector4 value2,
         out Vector4 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The minimized vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Multiply Method

Vector4.Multiply Method

Multiplies a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector4.Multiply (Vector4, Single) | Multiplies a vector by a scalar.
Vector4.Multiply (Vector4, Single, Vector4) | Multiplies a vector by a scalar value.
Vector4.Multiply (Vector4, Vector4) | Multiplies the components of two vectors by each other.
Vector4.Multiply (Vector4, Vector4, Vector4) | Multiplies the components of two vectors by each other.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Multiply Method (Vector4, Single)

Vector4.Multiply Method (Vector4, Single)
See Also
CollapseAll image

Multiplies a vector by a scalar.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Multiply (
         Vector4 value1,
         float scaleFactor
)

Parameters

value1
Source vector.
scaleFactor
Scalar value.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Multiply Method (Vector4, Single, Vector4)

Vector4.Multiply Method (Vector4, Single, Vector4)
See Also
CollapseAll image

Multiplies a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Multiply (
         ref Vector4 value1,
         float scaleFactor,
         out Vector4 result
)

Parameters

value1
Source vector.
scaleFactor
Scalar value.
result
[OutAttribute] The result of the multiplication.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Multiply Method (Vector4, Vector4)

Vector4.Multiply Method (Vector4, Vector4)
See Also
CollapseAll image

Multiplies the components of two vectors by each other.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Multiply (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the multiplication.

Expand image Remarks

Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the corresponding components of each vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Multiply Method (Vector4, Vector4, Vector4)

Vector4.Multiply Method (Vector4, Vector4, Vector4)
See Also
CollapseAll image

Multiplies the components of two vectors by each other.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Multiply (
         ref Vector4 value1,
         ref Vector4 value2,
         out Vector4 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the multiplication.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Negate Method

Vector4.Negate Method

Returns a vector pointing in the opposite direction.

Expand image Overload List

Name | Description
Vector4.Negate (Vector4) | Returns a vector pointing in the opposite direction.
Vector4.Negate (Vector4, Vector4) | Returns a vector pointing in the opposite direction.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Negate Method (Vector4)

Vector4.Negate Method (Vector4)
See Also
CollapseAll image

Returns a vector pointing in the opposite direction.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Negate (
         Vector4 value
)

Parameters

value
Source vector.

Return Value

Vector pointing in the opposite direction.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Negate Method (Vector4, Vector4)

Vector4.Negate Method (Vector4, Vector4)
See Also
CollapseAll image

Returns a vector pointing in the opposite direction.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Negate (
         ref Vector4 value,
         out Vector4 result
)

Parameters

value
Source vector.
result
[OutAttribute] Vector pointing in the opposite direction.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Normalize Method

Vector4.Normalize Method

Creates a unit vector from the specified vector.

Expand image Overload List

Name | Description
Vector4.Normalize () | Turns the current vector into a unit vector.
Vector4.Normalize (Vector4) | Creates a unit vector from the specified vector.
Vector4.Normalize (Vector4, Vector4) | Returns a normalized version of the specified vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Normalize Method ()

Vector4.Normalize Method ()
See Also
CollapseAll image

Turns the current vector into a unit vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Normalize ()

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Normalize Method (Vector4)

Vector4.Normalize Method (Vector4)
See Also
CollapseAll image

Creates a unit vector from the specified vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Normalize (
         Vector4 vector
)

Parameters

vector
The source Vector4.

Return Value

The created unit vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Normalize Method (Vector4, Vector4)

Vector4.Normalize Method (Vector4, Vector4)
See Also
CollapseAll image

Returns a normalized version of the specified vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Normalize (
         ref Vector4 vector,
         out Vector4 result
)

Parameters

vector
Source vector.
result
[OutAttribute] The normalized vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.op_Addition Method

Vector4.op_Addition Method

Adds two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 op_Addition (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Sum of the vectors.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.op_Division Method

Vector4.op_Division Method

Divides a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector4.op_Division (Vector4, Single) | Divides a vector by a scalar value.
Vector4.op_Division (Vector4, Vector4) | Divides the components of a vector by the components of another vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.op_Division Method (Vector4, Single)

Vector4.op_Division Method (Vector4, Single)
See Also
CollapseAll image

Divides a vector by a scalar value.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 op_Division (
         Vector4 value1,
         float divider
)

Parameters

value1
Source vector.
divider
The divisor.

Return Value

The source vector divided by div.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.op_Division Method (Vector4, Vector4)

Vector4.op_Division Method (Vector4, Vector4)
See Also
CollapseAll image

Divides the components of a vector by the components of another vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 op_Division (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Divisor vector.

Return Value

The result of dividing the vectors.

Expand image Remarks

Division of a vector by another vector is not mathematically defined. This method simply divides each component of a by the matching component of b.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.op_Equality Method

Vector4.op_Equality Method

Tests vectors for equality.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

true if the vectors are equal; false otherwise.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.op_Inequality Method

Vector4.op_Inequality Method

Tests vectors for inequality.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Vector to compare.
value2
Vector to compare.

Return Value

true if the vectors are not equal; false otherwise.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.op_Multiply Method

Vector4.op_Multiply Method

Multiplies a vector by a scalar or another vector.

Expand image Overload List

Name | Description
Vector4.op_Multiply (Single, Vector4) | Multiplies a vector by a scalar.
Vector4.op_Multiply (Vector4, Single) | Multiplies a vector by a scalar.
Vector4.op_Multiply (Vector4, Vector4) | Multiplies the components of two vectors by each other.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.op_Multiply Method (Single, Vector4)

Vector4.op_Multiply Method (Single, Vector4)
See Also
CollapseAll image

Multiplies a vector by a scalar.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 op_Multiply (
         float scaleFactor,
         Vector4 value1
)

Parameters

scaleFactor
Scalar value.
value1
Source vector.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.op_Multiply Method (Vector4, Single)

Vector4.op_Multiply Method (Vector4, Single)
See Also
CollapseAll image

Multiplies a vector by a scalar.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 op_Multiply (
         Vector4 value1,
         float scaleFactor
)

Parameters

value1
Source vector.
scaleFactor
Scalar value.

Return Value

Result of the multiplication.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.op_Multiply Method (Vector4, Vector4)

Vector4.op_Multiply Method (Vector4, Vector4)
See Also
CollapseAll image

Multiplies the components of two vectors by each other.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 op_Multiply (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the multiplication.

Expand image Remarks

Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the corresponding components of each vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.op_Subtraction Method

Vector4.op_Subtraction Method

Subtracts a vector from a vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 op_Subtraction (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the subtraction.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.op_UnaryNegation Method

Vector4.op_UnaryNegation Method

Returns a vector pointing in the opposite direction.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 op_UnaryNegation (
         Vector4 value
)

Parameters

value
Source vector.

Return Value

Vector pointing in the opposite direction.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.SmoothStep Method

Vector4.SmoothStep Method

Interpolates between two values using a cubic equation.

Expand image Overload List

Name | Description
Vector4.SmoothStep (Vector4, Vector4, Single) | Interpolates between two values using a cubic equation.
Vector4.SmoothStep (Vector4, Vector4, Single, Vector4) | Interpolates between two values using a cubic equation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.SmoothStep Method (Vector4, Vector4, Single)

Vector4.SmoothStep Method (Vector4, Vector4, Single)
See Also
CollapseAll image

Interpolates between two values using a cubic equation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 SmoothStep (
         Vector4 value1,
         Vector4 value2,
         float amount
)

Parameters

value1
Source value.
value2
Source value.
amount
Weighting value.

Return Value

Interpolated value.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.SmoothStep Method (Vector4, Vector4, Single, Vector4)

Vector4.SmoothStep Method (Vector4, Vector4, Single, Vector4)
See Also
CollapseAll image

Interpolates between two values using a cubic equation.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void SmoothStep (
         ref Vector4 value1,
         ref Vector4 value2,
         float amount,
         out Vector4 result
)

Parameters

value1
Source vector.
value2
Source vector.
amount
Weighting factor.
result
[OutAttribute] The interpolated value.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Subtract Method

Vector4.Subtract Method

Subtracts a vector from a vector.

Expand image Overload List

Name | Description
Vector4.Subtract (Vector4, Vector4) | Subtracts a vector from a vector.
Vector4.Subtract (Vector4, Vector4, Vector4) | Subtracts a vector from a vector.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Subtract Method (Vector4, Vector4)

Vector4.Subtract Method (Vector4, Vector4)
See Also
CollapseAll image

Subtracts a vector from a vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Subtract (
         Vector4 value1,
         Vector4 value2
)

Parameters

value1
Source vector.
value2
Source vector.

Return Value

Result of the subtraction.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Subtract Method (Vector4, Vector4, Vector4)

Vector4.Subtract Method (Vector4, Vector4, Vector4)
See Also
CollapseAll image

Subtracts a vector from a vector.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Subtract (
         ref Vector4 value1,
         ref Vector4 value2,
         out Vector4 result
)

Parameters

value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the subtraction.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.ToString Method

Vector4.ToString Method

Retrieves a string representation of the current object.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method

Vector4.Transform Method

Transforms one or more vectors by a specified Matrix or Quaternion and returns the results in Vector4 form.

Expand image Overload List

Name | Description
Vector4.Transform (Vector2, Matrix) | Transforms a Vector2 by the given Matrix.
Vector4.Transform (Vector2, Matrix, Vector4) | Transforms a Vector2 by the given Matrix.
Vector4.Transform (Vector2, Quaternion) | Transforms a Vector2 by a specified Quaternion into a Vector4.
Vector4.Transform (Vector2, Quaternion, Vector4) | Transforms a Vector2 by a specified Quaternion into a Vector4.
Vector4.Transform (Vector3, Matrix) | Transforms a Vector3 by the given Matrix.
Vector4.Transform (Vector3, Matrix, Vector4) | Transforms a Vector3 by the given Matrix.
Vector4.Transform (Vector3, Quaternion) | Transforms a Vector3 by a specified Quaternion into a Vector4.
Vector4.Transform (Vector3, Quaternion, Vector4) | Transforms a Vector3 by a specified Quaternion into a Vector4.
Vector4.Transform (Vector4, Matrix) | Transforms a Vector4 by the specified Matrix.
Vector4.Transform (Vector4, Matrix, Vector4) | Transforms a Vector4 by the given Matrix.
Vector4.Transform (Vector4, Quaternion) | Transforms a Vector4 by a specified Quaternion.
Vector4.Transform (Vector4, Quaternion, Vector4) | Transforms a Vector4 by a specified Quaternion.
Vector4.Transform (Vector4[], Int32, Matrix, Vector4[], Int32, Int32) | Transforms a specified range in an array of Vector4s by a specified Matrix into a specified range in a destination array.
Vector4.Transform (Vector4[], Int32, Quaternion, Vector4[], Int32, Int32) | Transforms a specified range in an array of Vector4s by a specified Quaternion into a specified range in a destination array.
Vector4.Transform (Vector4[], Matrix, Vector4[]) | Transforms an array of Vector4s by a specified Matrix.
Vector4.Transform (Vector4[], Quaternion, Vector4[]) | Transforms an array of Vector4s by a specified Quaternion.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace


Vector4.Transform Method (Vector2, Matrix)

Vector4.Transform Method (Vector2, Matrix)
See Also
CollapseAll image

Transforms a Vector2 by the given Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Transform (
         Vector2 position,
         Matrix matrix
)

Parameters

position
The source Vector2.
matrix
The transformation Matrix.

Return Value

The transformed Vector4.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector2, Matrix, Vector4)

Vector4.Transform Method (Vector2, Matrix, Vector4)
See Also
CollapseAll image

Transforms a Vector2 by the given Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Vector2 position,
         ref Matrix matrix,
         out Vector4 result
)

Parameters

position
The source Vector2.
matrix
The transformation Matrix.
result
[OutAttribute] The Vector4 resulting from the transformation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector2, Quaternion)

Vector4.Transform Method (Vector2, Quaternion)
See Also
CollapseAll image

Transforms a Vector2 by a specified Quaternion into a Vector4.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Transform (
         Vector2 value,
         Quaternion rotation
)

Parameters

value
The Vector2 to transform.
rotation
The Quaternion rotation to apply.

Return Value

Returns the Vector4 resulting from the transformation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector2, Quaternion, Vector4)

Vector4.Transform Method (Vector2, Quaternion, Vector4)
See Also
CollapseAll image

Transforms a Vector2 by a specified Quaternion into a Vector4.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Vector2 value,
         ref Quaternion rotation,
         out Vector4 result
)

Parameters

value
The Vector2 to transform.
rotation
The Quaternion rotation to apply.
result
[OutAttribute] The Vector4 resulting from the transformation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector3, Matrix)

Vector4.Transform Method (Vector3, Matrix)
See Also
CollapseAll image

Transforms a Vector3 by the given Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Transform (
         Vector3 position,
         Matrix matrix
)

Parameters

position
The source Vector3.
matrix
The transformation Matrix.

Return Value

The Vector4 resulting from the transformation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector3, Matrix, Vector4)

Vector4.Transform Method (Vector3, Matrix, Vector4)
See Also
CollapseAll image

Transforms a Vector3 by the given Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Vector3 position,
         ref Matrix matrix,
         out Vector4 result
)

Parameters

position
The source Vector3.
matrix
The transformation Matrix.
result
[OutAttribute] The Vector4 resulting from the transformation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector3, Quaternion)

Vector4.Transform Method (Vector3, Quaternion)
See Also
CollapseAll image

Transforms a Vector3 by a specified Quaternion into a Vector4.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Transform (
         Vector3 value,
         Quaternion rotation
)

Parameters

value
The Vector3 to transform.
rotation
The Quaternion rotation to apply.

Return Value

The Vector4 resulting from the transformation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector3, Quaternion, Vector4)

Vector4.Transform Method (Vector3, Quaternion, Vector4)
See Also
CollapseAll image

Transforms a Vector3 by a specified Quaternion into a Vector4.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Vector3 value,
         ref Quaternion rotation,
         out Vector4 result
)

Parameters

value
The Vector3 to transform.
rotation
The Quaternion rotation to apply.
result
[OutAttribute] The Vector4 resulting from the transformation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector4, Matrix)

Vector4.Transform Method (Vector4, Matrix)
See Also
CollapseAll image

Transforms a Vector4 by the specified Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Transform (
         Vector4 vector,
         Matrix matrix
)

Parameters

vector
The source Vector4.
matrix
The transformation Matrix.

Return Value

The transformed Vector4.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector4, Matrix, Vector4)

Vector4.Transform Method (Vector4, Matrix, Vector4)
See Also
CollapseAll image

Transforms a Vector4 by the given Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Vector4 vector,
         ref Matrix matrix,
         out Vector4 result
)

Parameters

vector
The source Vector4.
matrix
The transformation Matrix.
result
[OutAttribute] The Vector4 resulting from the transformation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector4, Quaternion)

Vector4.Transform Method (Vector4, Quaternion)
See Also
CollapseAll image

Transforms a Vector4 by a specified Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Transform (
         Vector4 value,
         Quaternion rotation
)

Parameters

value
The Vector4 to transform.
rotation
The Quaternion rotation to apply.

Return Value

The Vector4 resulting from the transformation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector4, Quaternion, Vector4)

Vector4.Transform Method (Vector4, Quaternion, Vector4)
See Also
CollapseAll image

Transforms a Vector4 by a specified Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         ref Vector4 value,
         ref Quaternion rotation,
         out Vector4 result
)

Parameters

value
The Vector4 to transform.
rotation
The Quaternion rotation to apply.
result
[OutAttribute] The Vector4 resulting from the transformation.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector4[], Int32, Matrix, Vector4[], Int32, Int32)

Vector4.Transform Method (Vector4[], Int32, Matrix, Vector4[], Int32, Int32)
See Also
CollapseAll image

Transforms a specified range in an array of Vector4s by a specified Matrix into a specified range in a destination array.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector4[] sourceArray,
         int sourceIndex,
         ref Matrix matrix,
         Vector4[] destinationArray,
         int destinationIndex,
         int length
)

Parameters

sourceArray
The array of Vector4s containing the range to transform.
sourceIndex
The index in the source array of the first Vector4 to transform.
matrix
The transform Matrix to apply.
destinationArray
The existing destination array of Vector4s into which to write the results.
destinationIndex
The index in the destination array of the first result Vector4 to write.
length
The number of Vector4s to transform.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result or the combination of sourceIndex and length was greater than sourceArray.Length.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector4[], Int32, Quaternion, Vector4[], Int32, Int32)

Vector4.Transform Method (Vector4[], Int32, Quaternion, Vector4[], Int32, Int32)
See Also
CollapseAll image

Transforms a specified range in an array of Vector4s by a specified Quaternion into a specified range in a destination array.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector4[] sourceArray,
         int sourceIndex,
         ref Quaternion rotation,
         Vector4[] destinationArray,
         int destinationIndex,
         int length
)

Parameters

sourceArray
The array of Vector4s containing the range to transform.
sourceIndex
The index in the source array of the first Vector4 to transform.
rotation
The Quaternion rotation to apply.
destinationArray
The existing destination array of Vector4s into which to write the results.
destinationIndex
The index in the destination array of the first result Vector4 to write.
length
The number of Vector4s to transform.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result or the combination of sourceIndex and length was greater than sourceArray.Length.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector4[], Matrix, Vector4[])

Vector4.Transform Method (Vector4[], Matrix, Vector4[])
See Also
CollapseAll image

Transforms an array of Vector4s by a specified Matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector4[] sourceArray,
         ref Matrix matrix,
         Vector4[] destinationArray
)

Parameters

sourceArray
The array of Vector4s to transform.
matrix
The transform Matrix to apply.
destinationArray
The existing destination array into which the transformed Vector4s are written.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Transform Method (Vector4[], Quaternion, Vector4[])

Vector4.Transform Method (Vector4[], Quaternion, Vector4[])
See Also
CollapseAll image

Transforms an array of Vector4s by a specified Quaternion.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Transform (
         Vector4[] sourceArray,
         ref Quaternion rotation,
         Vector4[] destinationArray
)

Parameters

sourceArray
The array of Vector4s to transform.
rotation
The Quaternion rotation to apply.
destinationArray
The existing destination array into which the transformed Vector4s are written.

Expand image Exceptions

Exception type | Condition
ArgumentException | destinationArray is too small to contain the result or.
ArgumentNullException | sourceArray or destinationArray is null.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4 Properties

Vector4 Properties

Expand image Public Properties

Name | Description
One | Returns a Vector4 with all of its components set to one.
UnitW | Returns the Vector4 (0, 0, 0, 1).
UnitX | Returns the Vector4 (1, 0, 0, 0).
UnitY | Returns the Vector4 (0, 1, 0, 0).
UnitZ | Returns the Vector4 (0, 0, 1, 0).
Zero | Returns a Vector4 with all of its components set to zero.

Expand image See Also

Reference

Vector4 Structure
Microsoft.Xna.Framework Namespace


Vector4.One Property

Vector4.One Property

Returns a Vector4 with all of its components set to one.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 One { get; }

Property Value

A Vector4 with all of its components set to one.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.UnitW Property

Vector4.UnitW Property

Returns the Vector4 (0, 0, 0, 1).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 UnitW { get; }

Property Value

The Vector4 (0, 0, 0, 1).

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.UnitX Property

Vector4.UnitX Property

Returns the Vector4 (1, 0, 0, 0).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 UnitX { get; }

Property Value

The Vector4 (1, 0, 0, 0).

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.UnitY Property

Vector4.UnitY Property

Returns the Vector4 (0, 1, 0, 0).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 UnitY { get; }

Property Value

The Vector4 (0, 1, 0, 0).

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.UnitZ Property

Vector4.UnitZ Property

Returns the Vector4 (0, 0, 1, 0).

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 UnitZ { get; }

Property Value

The Vector4 (0, 0, 1, 0).

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Vector4.Zero Property

Vector4.Zero Property

Returns a Vector4 with all of its components set to zero.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Vector4 Zero { get; }

Property Value

A Vector4 with all of its components set to zero.

Expand image See Also

Reference

Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Audio Namespace

Microsoft.Xna.Framework.Audio Namespace

Contains low-level application programming interface (API) methods that can load and manipulate XACT-created project and content files to play audio.

Expand image Classes

 | Name | Description
Public Class | AudioEmitter | Represents a 3D audio emitter.
Public Class | AudioEngine | Represents the audio engine. Applications use the methods of the audio engine to instantiate and manipulate core audio objects.
Public Class | AudioListener | Represents a 3D audio listener.
Public Class | Cue | Defines methods for managing the playback of sounds.
Public Class | DynamicSoundEffectInstance | Provides properties, methods, and events for play back of the audio buffer.
Public Class | InstancePlayLimitException | The exception that is thrown when there is an attempt to play more than 16 SoundEffectInstance sounds concurrently.
Public Class | Microphone | Provides properties, methods, and fields and events for capturing audio data with microphones.
Public Class | NoAudioHardwareException | The exception that is thrown when no audio hardware is present, or when audio hardware is installed, but the device drivers for the audio hardware are not present or enabled.
Public Class | NoMicrophoneConnectedException | The exception that is thrown when Microphone API calls are made on a disconnected microphone.
Public Class | SoundBank | Represents a sound bank, which is a collection of cues.
Public Class | SoundEffect | Provides a loaded sound resource.
Public Class | SoundEffectInstance | Provides a single playing, paused, or stopped instance of a SoundEffect sound.
Public Class | WaveBank | Represents a wave bank, which is a collection of wave files.

Expand image Structures

 | Name | Description
Public Structure | AudioCategory | Represents a particular category of sounds.
Public Structure | RendererDetail | Represents an audio renderer, which is a device that can render audio to a user.

Expand image Enumerations

 | Name | Description
Public Enumeration | AudioChannels | Defines the number of channels in the audio data.
Public Enumeration | AudioStopOptions | Controls how Cue objects should stop when Stop is called.
Public Enumeration | MicrophoneState | Current state of the Microphone audio capture (started or stopped).
Public Enumeration | SoundState | Current state (playing, paused, or stopped) of a SoundEffectInstance.

Expand image See Also

Tasks

Playing a Sound
Playing a Song
Streaming a Sound (XACT)
Adding a Sound File (XACT)
Playing Sounds from an XACT Project
Playing Background Music (XACT)
Pausing a Sound (XACT)
Adjusting Volume (XACT)
Applying a 3D Positional Effect to a Cue (XACT)
Applying 3D Audio Effects (XACT)

Concepts

Sounds Overview
Audio Content Catalog at XNA Creators Club Online


AudioCategory Structure

AudioCategory Structure

Represents a particular category of sounds.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct AudioCategory : IEquatable<AudioCategory>

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)
Adjusting Volume (XACT)

Concepts

Sounds Overview

Reference

AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory Members

AudioCategory Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the AudioCategory type.

Expand image Public Properties

 | Name | Description
Public Property | Name | Specifies the friendly name of this category.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Determines whether two instances of AudioCategory are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified AudioCategory instances are equal.
 | op_Inequality | Determines whether the specified AudioCategory instances are not equal.
Public Method | Pause | Pauses all sounds associated with this category.
Public Method | Resume | Resumes all paused sounds associated with this category.
Public Method | SetVolume | Sets the volume of all sounds associated with this category.
Public Method | Stop | Stops all sounds associated with this category.
Public Method | ToString | Returns a String representation of this AudioCategory.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)
Adjusting Volume (XACT)

Concepts

Sounds Overview

Reference

AudioCategory Structure
Microsoft.Xna.Framework.Audio Namespace


AudioCategory Methods

AudioCategory Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Determines whether two instances of AudioCategory are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified AudioCategory instances are equal.
 | op_Inequality | Determines whether the specified AudioCategory instances are not equal.
Public Method | Pause | Pauses all sounds associated with this category.
Public Method | Resume | Resumes all paused sounds associated with this category.
Public Method | SetVolume | Sets the volume of all sounds associated with this category.
Public Method | Stop | Stops all sounds associated with this category.
Public Method | ToString | Returns a String representation of this AudioCategory.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AudioCategory Structure
Microsoft.Xna.Framework.Audio Namespace


AudioCategory.Equals Method

AudioCategory.Equals Method

Determines whether two instances of AudioCategory are equal.

Expand image Overload List

Name | Description
AudioCategory.Equals (AudioCategory) | Determines whether the specified AudioCategory is equal to this AudioCategory.
AudioCategory.Equals (Object) | Determines whether the specified Object is equal to this AudioCategory.

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace


AudioCategory.Equals Method (AudioCategory)

AudioCategory.Equals Method (AudioCategory)
See Also
CollapseAll image

Determines whether the specified AudioCategory is equal to this AudioCategory.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         AudioCategory other
)

Parameters

other
AudioCategory to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory.Equals Method (Object)

AudioCategory.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to this AudioCategory.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory.GetHashCode Method

AudioCategory.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory.op_Equality Method

AudioCategory.op_Equality Method

Determines whether the specified AudioCategory instances are equal.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         AudioCategory value1,
         AudioCategory value2
)

Parameters

value1
Object to the left of the equality operator.
value2
Object to the right of the equality operator.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory.op_Inequality Method

AudioCategory.op_Inequality Method

Determines whether the specified AudioCategory instances are not equal.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         AudioCategory value1,
         AudioCategory value2
)

Parameters

value1
Object to the left of the inequality operator.
value2
Object to the right of the inequality operator.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory.Pause Method

AudioCategory.Pause Method

Pauses all sounds associated with this category.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Pause ()

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory.Resume Method

AudioCategory.Resume Method

Resumes all paused sounds associated with this category.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Resume ()

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory.SetVolume Method

AudioCategory.SetVolume Method

Sets the volume of all sounds associated with this category.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void SetVolume (
         float volume
)

Parameters

volume

Volume amplitude multiplier. volume is normally between 0.0 (silence) and 1.0 (full volume), but can range from 0.0f to float.MaxValue.

Volume levels map to decibels (dB) as shown in the following table.

Volume | Description
0.0f | -96 dB (silence)
1.0f | +0 dB (full volume as authored)
2.0f | +6 dB (6 dB greater than authored)

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)
Adjusting Volume (XACT)

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory.Stop Method

AudioCategory.Stop Method

Stops all sounds associated with this category.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Stop (
         AudioStopOptions options
)

Parameters

options
Enumerated value specifying how the sounds should be stopped.

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory.ToString Method

AudioCategory.ToString Method

Returns a String representation of this AudioCategory.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioCategory Properties

AudioCategory Properties

Expand image Public Properties

 | Name | Description
Public Property | Name | Specifies the friendly name of this category.

Expand image See Also

Reference

AudioCategory Structure
Microsoft.Xna.Framework.Audio Namespace


AudioCategory.Name Property

AudioCategory.Name Property

Specifies the friendly name of this category.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

Friendly name of this category.

Expand image See Also

Reference

AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioChannels Enumeration

AudioChannels Enumeration

Defines the number of channels in the audio data.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum AudioChannels

Expand image Members

Member name | Description
Mono | Indicates audio data is contained in one channel.
Stereo | Indicates audio data contains two channels.

Expand image See Also

Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioEmitter Class

AudioEmitter Class
See Also Members
CollapseAll image

Represents a 3D audio emitter. This object, used in combination with an AudioListener, can simulate 3D audio effects for a given Cue or SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class AudioEmitter

Expand image See Also

Tasks

Applying a 3D Positional Effect to a Sound
Applying a 3D Positional Effect to a Cue (XACT)

Reference

AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioEmitter Members

AudioEmitter Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the AudioEmitter type.

Expand image Public Constructors

 | Name | Description
Public Method | AudioEmitter | Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | DopplerScale | Gets or sets a scalar applied to the level of Doppler effect calculated between this and any AudioListener.
Public Property | Forward | Gets or sets the forward orientation vector for this emitter.
Public Property | Position | Gets or sets the position of this emitter.
Public Property | Up | Gets or sets the upward orientation vector for this emitter.
Public Property | Velocity | Gets or sets the velocity vector of this emitter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AudioEmitter Class
Microsoft.Xna.Framework.Audio Namespace


AudioEmitter Constructor

AudioEmitter Constructor

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public AudioEmitter ()

Expand image See Also

Reference

AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioEmitter Methods

AudioEmitter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AudioEmitter Class
Microsoft.Xna.Framework.Audio Namespace


AudioEmitter Properties

AudioEmitter Properties

Expand image Public Properties

 | Name | Description
Public Property | DopplerScale | Gets or sets a scalar applied to the level of Doppler effect calculated between this and any AudioListener.
Public Property | Forward | Gets or sets the forward orientation vector for this emitter.
Public Property | Position | Gets or sets the position of this emitter.
Public Property | Up | Gets or sets the upward orientation vector for this emitter.
Public Property | Velocity | Gets or sets the velocity vector of this emitter.

Expand image See Also

Reference

AudioEmitter Class
Microsoft.Xna.Framework.Audio Namespace


AudioEmitter.DopplerScale Property

AudioEmitter.DopplerScale Property

Gets or sets a scalar applied to the level of Doppler effect calculated between this and any AudioListener.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float DopplerScale { get; set; }

Property Value

The Doppler scale value.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | The doppler scale of an audio emitter must be greater than or equal to zero.

Expand image Remarks

By default, this value is 1.0.

This value determines how much to modify the calculated Doppler effect between this object and a AudioListener. Values below 1.0 scale down the Doppler effect to make it less apparent. Values above 1.0 exaggerate the Doppler effect. A value of 1.0 leaves the effect unmodified.

Note that this value modifies only the calculated Doppler between this object and a AudioListener. The calculated Doppler is a product of the relationship between AudioEmitter.Velocity and AudioListener.Velocity. If the calculation yields a result of no Doppler effect, this value has no effect.

Expand image See Also

Reference

AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioEmitter.Forward Property

AudioEmitter.Forward Property

Gets or sets the forward orientation vector for this emitter.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Forward { get; set; }

Property Value

The forward orientation vector.

Expand image Remarks

By default, this value is Vector3.Forward. In most cases, it is not necessary to modify this value.

Doppler values between an AudioEmitter and an AudioListener are calculated by the relationship between AudioListener.Velocity and AudioEmitter.Velocity with respect to the axes defined by the Forward and Up vectors of each.

The values of the Forward and Up vectors must be orthonormal (at right angles to one another). Behavior is undefined if these vectors are not orthonormal.

Expand image See Also

Reference

AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioEmitter.Position Property

AudioEmitter.Position Property

Gets or sets the position of this emitter.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Position { get; set; }

Property Value

The position vector.

Expand image Remarks

By default, the value of this property is Vector3.Zero.

The relative positions of an AudioEmitter and an AudioListener are used to determine speaker positioning of a sound.

Expand image See Also

Tasks

Applying a 3D Positional Effect to a Sound
Applying a 3D Positional Effect to a Cue (XACT)

Reference

AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioEmitter.Up Property

AudioEmitter.Up Property

Gets or sets the upward orientation vector for this emitter.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Up { get; set; }

Property Value

The upward orientation vector.

Expand image Remarks

By default, this value is Vector3.Up. In most cases, it is not necessary to modify this value.

Doppler values between an AudioEmitter and an AudioListener are calculated by the relationship between AudioListener.Velocity and AudioEmitter.Velocity with respect to the axes defined by the Forward and Up vectors of each.

The values of the Forward and Up vectors must be orthonormal (at right angles to one another). Behavior is undefined if these vectors are not orthonormal.

Expand image See Also

Reference

AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioEmitter.Velocity Property

AudioEmitter.Velocity Property

Gets or sets the velocity vector of this emitter.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Velocity { get; set; }

Property Value

The velocity vector.

Expand image Remarks

By default, the value of this property is Vector3.Zero.

The Doppler effect value applied to a Cue is based on the relative Velocity values of the AudioEmitter and AudioListener, scaled by the DopplerScale value.

The Velocity property is used only to calculate Doppler values. It is not applied to the Position vector or otherwise used to set game state. You must set Velocity and Position each frame to maintain accurate 3D audio values in your game.

Expand image See Also

Reference

AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioEngine Class

AudioEngine Class
See Also Members
CollapseAll image

Represents the audio engine. Applications use the methods of the audio engine to instantiate and manipulate core audio objects.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class AudioEngine : IDisposable

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)
Adjusting Volume (XACT)

Concepts

Sounds Overview

Reference

AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine Members

AudioEngine Members
See Also Constructors Events Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the AudioEngine type.

Expand image Public Constructors

 | Name | Description
Public Method | AudioEngine | Overloaded. Initializes a new instance of this class.

Expand image Public Fields

 | Name | Description
Public Field | ContentVersion | Specifies the current content version.

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | RendererDetails | Gets a collection of audio renderers.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCategory | Gets an audio category.
Public Method | GetGlobalVariable | Gets the value of a global variable.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetGlobalVariable | Sets the value of a global variable.
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Performs periodic work required by the audio engine.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)
Adjusting Volume (XACT)

Concepts

Sounds Overview

Reference

AudioEngine Class
Microsoft.Xna.Framework.Audio Namespace


AudioEngine Fields

AudioEngine Fields

Expand image Public Fields

 | Name | Description
Public Field | ContentVersion | Specifies the current content version.

Expand image See Also

Reference

AudioEngine Class
Microsoft.Xna.Framework.Audio Namespace


AudioEngine.ContentVersion Field

AudioEngine.ContentVersion Field

Specifies the current content version.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public const int ContentVersion

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine Constructor

AudioEngine Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
AudioEngine (String) | Initializes a new instance of this class, using a path to an XACT global settings file.
AudioEngine (String, TimeSpan, String) | Initializes a new instance of this class, using a settings file, a specific audio renderer, and a specific speaker configuration.

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace


AudioEngine Constructor (String)

AudioEngine Constructor (String)
See Also
CollapseAll image

Initializes a new instance of this class, using a path to an XACT global settings file.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public AudioEngine (
         string settingsFile
)

Parameters

settingsFile
Path to a global settings file.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The settingsFile parameter is null.
ArgumentException | XACT could not load the data provided. Make sure you are using the correct version of the XACT tool.
InvalidOperationException | The engine could not be created.

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine Constructor (String, TimeSpan, String)

AudioEngine Constructor (String, TimeSpan, String)
See Also
CollapseAll image

Initializes a new instance of this class, using a settings file, a specific audio renderer, and a specific speaker configuration.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public AudioEngine (
         string settingsFile,
         TimeSpan lookAheadTime,
         string rendererId
)

Parameters

settingsFile
Path to a global settings file.
lookAheadTime
Interactive audio and branch event look-ahead time, in milliseconds.
rendererId
A string that specifies the audio renderer to use.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The settingsFile parameter is null.
ArgumentException | XACT could not load the data provided. Make sure you are using the correct version of the XACT tool.
InvalidOperationException | The engine could not be created.

Expand image Remarks

The lookAheadTime parameter specifies how far ahead the audio engine will look when determining when to transition to another sound. For sounds linked to Play events that use a wave variation list, this parameter should be set to greater than 250 milliseconds. Doing so should give the audio engine enough time to prepare streamed data before it is needed for the loop iteration.

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine Methods

AudioEngine Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCategory | Gets an audio category.
Public Method | GetGlobalVariable | Gets the value of a global variable.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetGlobalVariable | Sets the value of a global variable.
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Performs periodic work required by the audio engine.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AudioEngine Class
Microsoft.Xna.Framework.Audio Namespace


AudioEngine.Dispose Method

AudioEngine.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
AudioEngine.Dispose () | Immediately releases the unmanaged resources used by this object.
AudioEngine.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace


AudioEngine.Dispose Method ()

AudioEngine.Dispose Method ()
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine.Dispose Method (Boolean)

AudioEngine.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool disposing
)

Parameters

disposing
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine.Finalize Method

AudioEngine.Finalize Method

Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine.GetCategory Method

AudioEngine.GetCategory Method

Gets an audio category.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public AudioCategory GetCategory (
         string name
)

Parameters

name
Friendly name of the category to get.

Return Value

Audio category.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | This resource could not be created.

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)
Adjusting Volume (XACT)

Concepts

Sounds Overview

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine.GetGlobalVariable Method

AudioEngine.GetGlobalVariable Method

Gets the value of a global variable.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float GetGlobalVariable (
         string name
)

Parameters

name
Friendly name of the variable.

Return Value

Value of the variable.

Expand image Remarks

A global variable has global scope. It can be accessed by all code within a project.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The name parameter is null.

Expand image See Also

Concepts

Sounds Overview

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine.SetGlobalVariable Method

AudioEngine.SetGlobalVariable Method

Sets the value of a global variable.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void SetGlobalVariable (
         string name,
         float value
)

Parameters

name
Value of the global variable.
value
Friendly name of the global variable.

Expand image Remarks

A global variable has global scope. It can be accessed by all code within a project.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The name parameter is null.

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine.Update Method

AudioEngine.Update Method

Performs periodic work required by the audio engine.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Update ()

Expand image Remarks

This method drives the audio engine, and must be called once per frame.

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)
Adjusting Volume (XACT)

Concepts

Sounds Overview

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine Properties

AudioEngine Properties

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | RendererDetails | Gets a collection of audio renderers.

Expand image See Also

Reference

AudioEngine Class
Microsoft.Xna.Framework.Audio Namespace


AudioEngine.IsDisposed Property

AudioEngine.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine.RendererDetails Property

AudioEngine.RendererDetails Property

Gets a collection of audio renderers.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ReadOnlyCollection<RendererDetail> RendererDetails { get; }

Property Value

Collection of audio renderers.

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioEngine Events

AudioEngine Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Expand image See Also

Reference

AudioEngine Class
Microsoft.Xna.Framework.Audio Namespace


AudioEngine.Disposing Event

AudioEngine.Disposing Event

Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Disposing

Expand image See Also

Reference

AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AudioListener Class

AudioListener Class
See Also Members
CollapseAll image

Represents a 3D audio listener. This object, used in combination with an AudioEmitter, can simulate 3D audio effects for a given Cue or SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class AudioListener

Expand image See Also

Tasks

Applying a 3D Positional Effect to a Sound
Applying a 3D Positional Effect to a Cue (XACT)

Reference

AudioListener Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioListener Members

AudioListener Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the AudioListener type.

Expand image Public Constructors

 | Name | Description
Public Method | AudioListener | Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | Forward | Gets or sets the forward orientation vector for this listener.
Public Property | Position | Gets or sets the position of this listener.
Public Property | Up | Gets or sets the upward orientation vector for this listener.
Public Property | Velocity | Gets or sets the velocity vector of this listener.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AudioListener Class
Microsoft.Xna.Framework.Audio Namespace


AudioListener Constructor

AudioListener Constructor

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public AudioListener ()

Expand image See Also

Reference

AudioListener Class
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioListener Methods

AudioListener Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AudioListener Class
Microsoft.Xna.Framework.Audio Namespace


AudioListener Properties

AudioListener Properties

Expand image Public Properties

 | Name | Description
Public Property | Forward | Gets or sets the forward orientation vector for this listener.
Public Property | Position | Gets or sets the position of this listener.
Public Property | Up | Gets or sets the upward orientation vector for this listener.
Public Property | Velocity | Gets or sets the velocity vector of this listener.

Expand image See Also

Reference

AudioListener Class
Microsoft.Xna.Framework.Audio Namespace


AudioListener.Forward Property

AudioListener.Forward Property

Gets or sets the forward orientation vector for this listener.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Forward { get; set; }

Property Value

The forward orientation vector.

Expand image Remarks

By default, this value is Vector3.Forward. In most cases, it is not necessary to modify this value.

Doppler values between an AudioEmitter and an AudioListener are calculated by the relationship between AudioListener.Velocity and AudioEmitter.Velocity with respect to the axes defined by the Forward and Up vectors of each.

The values of the Forward and Up vectors must be orthonormal (at right angles to one another). Behavior is undefined if these vectors are not orthonormal.

Expand image See Also

Reference

AudioListener Class
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioListener.Position Property

AudioListener.Position Property

Gets or sets the position of this listener.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Position { get; set; }

Property Value

The position vector.

Expand image Remarks

By default, the value of this property is Vector3.Zero.

The relative positions of an AudioEmitter and an AudioListener are used to determine speaker positioning of a sound.

Expand image See Also

Tasks

Applying a 3D Positional Effect to a Sound
Applying a 3D Positional Effect to a Cue (XACT)

Reference

AudioListener Class
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioListener.Up Property

AudioListener.Up Property

Gets or sets the upward orientation vector for this listener.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Up { get; set; }

Property Value

The upward orientation vector.

Expand image Remarks

By default, this value is Vector3.Up. In most cases, it is not necessary to modify this value.

Doppler values between an AudioEmitter and an AudioListener are calculated by the relationship between AudioListener.Velocity and AudioEmitter.Velocity with respect to the axes defined by the Forward and Up vectors of each.

The values of the Forward and Up vectors must be orthonormal (at right angles to one another). Behavior is undefined if these vectors are not orthonormal.

Expand image See Also

Reference

AudioListener Class
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioListener.Velocity Property

AudioListener.Velocity Property

Gets or sets the velocity vector of this listener.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 Velocity { get; set; }

Property Value

The velocity vector.

Expand image Remarks

By default, the value of this property is Vector3.Zero.

The Doppler effect value applied to a Cue is based on the relative Velocity values of the AudioEmitter and AudioListener, scaled by the DopplerScale value.

The Velocity property is used only to calculate Doppler values. It is not applied to the Position vector or otherwise used to set game state. You must set Velocity and Position each frame to maintain accurate 3D audio values in your game.

Expand image See Also

Reference

AudioListener Class
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AudioStopOptions Enumeration

AudioStopOptions Enumeration

Controls how Cue objects should stop when Stop is called.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum AudioStopOptions

Expand image Members

Member name | Description
AsAuthored | Indicates the cue should stop normally, playing any release phase or transition specified in the content.
Immediate | Indicates the cue should stop immediately, ignoring any release phase or transition specified in the content.

Expand image See Also

Reference

Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue Class

Cue Class
See Also Members
CollapseAll image

Defines methods for managing the playback of sounds.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class Cue : IDisposable

Expand image Remarks

Cues are what programmers use to play sounds. Cues are typically played when certain game events occur, such as footsteps or gunshots. A cue is composed of one or more sounds, so when the cue is triggered, the set of associated sounds is heard.

A sound specifies how one or more waves should be played. A sound also has specific properties such as volume and pitch. The sound designer can adjust these properties.

The advantage to using the Audio API to reference cues rather than specific sounds is that an audio designer can reassign sounds to a cue in the sound bank without programmer intervention. For example, a sound designer can try various gunshot waves associated with a particular game event without requiring the programmer to change code or rename sounds.

Cues and sounds are referenced through SoundBank objects. The waves that compose a sound are referenced through WaveBank objects.

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue Members

Cue Members
See Also Events Methods Properties
CollapseAll image

The following tables list the members exposed by the Cue type.

Expand image Public Properties

 | Name | Description
Public Property | IsCreated | Returns whether the cue has been created.
Public Property | IsDisposed | Gets a value indicating whether the object has been disposed.
Public Property | IsPaused | Returns whether the cue is currently paused.
Public Property | IsPlaying | Returns whether the cue is playing.
Public Property | IsPrepared | Returns whether the cue is prepared to play.
Public Property | IsPreparing | Returns whether the cue is preparing to play.
Public Property | IsStopped | Returns whether the cue is currently stopped.
Public Property | IsStopping | Returns whether the cue is stopping playback.
Public Property | Name | Returns the friendly name of the cue.

Expand image Public Methods

 | Name | Description
Public Method | Apply3D | Calculates the 3D audio values between an AudioEmitter and an AudioListener object, and applies the resulting values to this Cue.
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetVariable | Gets a cue-instance variable value based on its friendly name.
Public Method | Pause | Pauses playback.
Public Method | Play | Requests playback of a prepared or preparing Cue.
Public Method | Resume | Resumes playback of a paused Cue.
Public Method | SetVariable | Sets the value of a cue-instance variable based on its friendly name.
Public Method | Stop | Stops playback of a Cue.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

Cue Class
Microsoft.Xna.Framework.Audio Namespace


Cue Methods

Cue Methods

Expand image Public Methods

 | Name | Description
Public Method | Apply3D | Calculates the 3D audio values between an AudioEmitter and an AudioListener object, and applies the resulting values to this Cue.
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetVariable | Gets a cue-instance variable value based on its friendly name.
Public Method | Pause | Pauses playback.
Public Method | Play | Requests playback of a prepared or preparing Cue.
Public Method | Resume | Resumes playback of a paused Cue.
Public Method | SetVariable | Sets the value of a cue-instance variable based on its friendly name.
Public Method | Stop | Stops playback of a Cue.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Cue Class
Microsoft.Xna.Framework.Audio Namespace


Cue.Apply3D Method

Cue.Apply3D Method
See Also Example
CollapseAll image

Calculates the 3D audio values between an AudioEmitter and an AudioListener object, and applies the resulting values to this Cue.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Apply3D (
         AudioListener listener,
         AudioEmitter emitter
)

Parameters

listener
The listener to calculate.
emitter
The emitter to calculate.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | Both listener and emitter must be non-null.
InvalidOperationException | You must call the Cue.Apply3D method before you call the Cue.Play method.

Expand image Remarks

If you want to apply 3D effects to a Cue, you must call this method before you call the Play method. Not doing so will throw an exception the next time Apply3D is called.

Calling this method automatically sets the speaker mix for any sound played by this cue to a value calculated by the difference in Position values between listener and emitter. In preparation for the mix, the sound is converted to monoaural. Any stereo information in the sound is discarded.

Calling this method sets the cue-instance variables Distance, DopplerPitchScalar, and OrientationAngle to the resulting values of the 3D calculation between listener and emitter. These values do not modify sound attenuation over distance, or pitch shifting using Doppler values, on their own. You must set up a Runtime Parameter Curve (RPC) that defines how to map the cue-instance variable values to pitch and volume shifts, and associate sounds to these curves in the Microsoft Cross-Platform Audio Creation Tool (XACT). For information on doing so, see Applying 3D Audio Effects (XACT).

Expand image Example

When first retrieving a Cue object using SoundBank.GetCue, you must call Cue.Apply3D before calling Cue.Play, if you want to apply 3D effects to the cue.

C#
// Get the cue and play it.
// For 3D cues, you must call Apply3D before calling Play.
cue = soundBank.GetCue("buzz");
cue.Apply3D(listener, emitter);
cue.Play();

Once you have called Cue.Apply3D then Cue.Play, you can call Cue.Apply3D each Game.Update loop after specifying new positions and velocities for the listener and emitter objects.

C#
protected override void Update(GameTime gameTime)
{

    // Apply 3D settings to the cue.
    emitter.Position = objectPos;

    cue.Apply3D(listener, emitter);

    // Update the audio engine
    engine.Update();

    base.Update(gameTime);

}

Expand image See Also

Tasks

Applying a 3D Positional Effect to a Cue (XACT)
Applying 3D Audio Effects (XACT)

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.Dispose Method

Cue.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.GetVariable Method

Cue.GetVariable Method

Gets a cue-instance variable value based on its friendly name.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float GetVariable (
         string name
)

Parameters

name
Friendly name of the variable.

Return Value

Value of the variable.

Expand image Remarks

Cue-instance variables are useful when multiple instantiations of a single cue (and its associated sounds) are required (for example, a "car" cue where there may be more than one car at any given time). While a global variable allows multiple audio elements to be controlled in unison, a cue instance variable grants discrete control of each instance of a cue, even for each copy of the same cue.

The friendly name is a text string that the designer can associate with the cue when it is built.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The name parameter is null.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.Pause Method

Cue.Pause Method

Pauses playback.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Pause ()

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.Play Method

Cue.Play Method

Requests playback of a prepared or preparing Cue.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Play ()

Expand image Remarks

Calling Play when the Cue already is playing can result in an InvalidOperationException.

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.Resume Method

Cue.Resume Method

Resumes playback of a paused Cue.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Resume ()

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.SetVariable Method

Cue.SetVariable Method

Sets the value of a cue-instance variable based on its friendly name.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void SetVariable (
         string name,
         float value
)

Parameters

name
Friendly name of the variable to set.
value
Value to assign to the variable.

Expand image Remarks

The friendly name is a text string that the designer can associate with the cue when it is built.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The name parameter is null.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.Stop Method

Cue.Stop Method

Stops playback of a Cue.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Stop (
         AudioStopOptions options
)

Parameters

options
Enumerated value specifying how the sound should stop. If set to None, the sound will play any release phase or transition specified in the audio designer. If set to Immediate, the sound will stop immediately, ignoring any release phases or transitions.

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue Properties

Cue Properties

Expand image Public Properties

 | Name | Description
Public Property | IsCreated | Returns whether the cue has been created.
Public Property | IsDisposed | Gets a value indicating whether the object has been disposed.
Public Property | IsPaused | Returns whether the cue is currently paused.
Public Property | IsPlaying | Returns whether the cue is playing.
Public Property | IsPrepared | Returns whether the cue is prepared to play.
Public Property | IsPreparing | Returns whether the cue is preparing to play.
Public Property | IsStopped | Returns whether the cue is currently stopped.
Public Property | IsStopping | Returns whether the cue is stopping playback.
Public Property | Name | Returns the friendly name of the cue.

Expand image See Also

Reference

Cue Class
Microsoft.Xna.Framework.Audio Namespace


Cue.IsCreated Property

Cue.IsCreated Property

Returns whether the cue has been created.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsCreated { get; }

Property Value

true if the cue is created; false otherwise.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.IsDisposed Property

Cue.IsDisposed Property

Gets a value indicating whether the object has been disposed.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object has been disposed; false otherwise.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.IsPaused Property

Cue.IsPaused Property

Returns whether the cue is currently paused.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsPaused { get; }

Property Value

true if the cue is paused; false otherwise.

Expand image Remarks

IsPlaying and IsPaused both return true if a cue is paused while playing.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.IsPlaying Property

Cue.IsPlaying Property

Returns whether the cue is playing.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsPlaying { get; }

Property Value

true if the cue is playing; false otherwise.

Expand image Remarks

IsPlaying and IsPaused both return true if a cue is paused while playing.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.IsPrepared Property

Cue.IsPrepared Property

Returns whether the cue is prepared to play.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsPrepared { get; }

Property Value

true if the cue is prepared to play; false otherwise.

Expand image Remarks

This property returns true only if the cue is prepared but has not yet been played. Cues that are played return true for IsPlaying if they are currently playing or true for IsStopped if they are stopped.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.IsPreparing Property

Cue.IsPreparing Property

Returns whether the cue is preparing to play.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsPreparing { get; }

Property Value

true if the cue is preparing to play; false otherwise.

This property returns true only if the cue is preparing but has not yet been prepared. Cues that have been prepared return true for IsPrepared.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.IsStopped Property

Cue.IsStopped Property

Returns whether the cue is currently stopped.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsStopped { get; }

Property Value

true if the cue is stopped; false if otherwise.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.IsStopping Property

Cue.IsStopping Property

Returns whether the cue is stopping playback.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsStopping { get; }

Property Value

true if the cue is stopping; false if otherwise.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue.Name Property

Cue.Name Property

Returns the friendly name of the cue.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

Friendly name of the cue.

Expand image Remarks

The friendly name is a text string that the designer can associate with the cue when it is built.

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Cue Events

Cue Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Expand image See Also

Reference

Cue Class
Microsoft.Xna.Framework.Audio Namespace


Cue.Disposing Event

Cue.Disposing Event

Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Disposing

Expand image See Also

Reference

Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


DynamicSoundEffectInstance Class

DynamicSoundEffectInstance Class
See Also Members
CollapseAll image

Provides properties, methods, and events for play back of the audio buffer.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class DynamicSoundEffectInstance : SoundEffectInstance

Expand image See Also

Reference

DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicSoundEffectInstance Members

DynamicSoundEffectInstance Members
See Also Constructors Events Methods Properties
CollapseAll image

The following tables list the members exposed by the DynamicSoundEffectInstance type.

Expand image Public Constructors

 | Name | Description
Public Method | DynamicSoundEffectInstance | Initializes a new instance of this class, which creates a dynamic sound effect based on the specified sample rate and audio channel.

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | (Inherited from SoundEffectInstance.)
Public Property | IsLooped | Indicates whether the audio playback of the DynamicSoundEffectInstance object is looped.
Public Property | Pan | (Inherited from SoundEffectInstance.)
Public Property | PendingBufferCount | Returns the number of audio buffers in the queue awaiting playback.
Public Property | Pitch | (Inherited from SoundEffectInstance.)
Public Property | State | (Inherited from SoundEffectInstance.)
Public Property | Volume | (Inherited from SoundEffectInstance.)

Expand image Public Methods

 | Name | Description
Public Method | Apply3D | (Overloaded. Inherited from SoundEffectInstance.)
 | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetSampleDuration | Returns the sample duration based on the specified size of the audio buffer.
Public Method | GetSampleSizeInBytes | Returns the size of the audio buffer required to contain audio samples based on the specified duration.
Public Method | GetType | (Inherited from Object.)
Public Method | Pause | (Inherited from SoundEffectInstance.)
Public Method | Play | Begins or resumes audio playback.
Public Method | Resume | (Inherited from SoundEffectInstance.)
Public Method | Stop | (Overloaded. Inherited from SoundEffectInstance.)
Public Method | SubmitBuffer | Overloaded. Submits an audio buffer for playback.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from SoundEffectInstance.)
Protected Method | Finalize | (Inherited from SoundEffectInstance.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | BufferNeeded | Event that occurs when the number of audio capture buffers awaiting playback is less than or equal to two.

Expand image See Also

Reference

DynamicSoundEffectInstance Class
Microsoft.Xna.Framework.Audio Namespace


DynamicSoundEffectInstance Constructor

DynamicSoundEffectInstance Constructor

Initializes a new instance of this class, which creates a dynamic sound effect based on the specified sample rate and audio channel.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public DynamicSoundEffectInstance (
         int sampleRate,
         AudioChannels channels
)

Parameters

sampleRate
Sample rate, in Hertz (Hz), of audio content.
channels
Number of channels in the audio data.

Expand image Remarks

The sampleRate parameter must between 8000 Hz and 48000 Hz.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | The value specified for sampleRate is less than 8000 Hz or greater than 48000 Hz. The value specified for channels is something other than mono or stereo.

Expand image See Also

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicSoundEffectInstance Methods

DynamicSoundEffectInstance Methods

Expand image Public Methods

 | Name | Description
Public Method | Apply3D | (Overloaded. Inherited from SoundEffectInstance.)
 | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetSampleDuration | Returns the sample duration based on the specified size of the audio buffer.
Public Method | GetSampleSizeInBytes | Returns the size of the audio buffer required to contain audio samples based on the specified duration.
Public Method | GetType | (Inherited from Object.)
Public Method | Pause | (Inherited from SoundEffectInstance.)
Public Method | Play | Begins or resumes audio playback.
Public Method | Resume | (Inherited from SoundEffectInstance.)
Public Method | Stop | (Overloaded. Inherited from SoundEffectInstance.)
Public Method | SubmitBuffer | Overloaded. Submits an audio buffer for playback.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from SoundEffectInstance.)
Protected Method | Finalize | (Inherited from SoundEffectInstance.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DynamicSoundEffectInstance Class
Microsoft.Xna.Framework.Audio Namespace


DynamicSoundEffectInstance.Dispose Method

DynamicSoundEffectInstance.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name Description

Expand image See Also

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace


DynamicSoundEffectInstance.GetSampleDuration Method

DynamicSoundEffectInstance.GetSampleDuration Method

Returns the sample duration based on the specified size of the audio buffer.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TimeSpan GetSampleDuration (
         int sizeInBytes
)

Parameters

sizeInBytes
Size, in bytes, of the audio data.

Return Value

TimeSpan object that represents the calculated sample duration.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | The exception that is thrown if GetSampleDuration is called after DynamicSoundEffectInstance has been disposed.

Expand image See Also

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicSoundEffectInstance.GetSampleSizeInBytes Method

DynamicSoundEffectInstance.GetSampleSizeInBytes Method

Returns the size of the audio buffer required to contain audio samples based on the specified duration.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int GetSampleSizeInBytes (
         TimeSpan duration
)

Parameters

duration
TimeSpan object that contains the duration of the audio sample.

Return Value

Size, in bytes, of the audio buffer.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | The exception that is thrown if GetSampleSizeInBytes is called after DynamicSoundEffectInstance has been disposed.

Expand image See Also

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicSoundEffectInstance.Play Method

DynamicSoundEffectInstance.Play Method

Begins or resumes audio playback.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override void Play ()

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | Exception thrown if Play is called after DynamicSoundEffectInstance is disposed.
InstancePlayLimitException | Exception thrown when the amount of concurrent DynamicSoundEffectInstance sounds playing exceeds the platform limit.
InvalidOperationException | Exception thrown when playback of the DynamicSoundEffectInstance fails.

Expand image Remarks

Play has no effect if the DynamicSoundEffectInstance object is playing currently.

Each platform has limits on the number of sounds playing simultaneously. A InstancePlayLimitException exception is thrown if this limit is exceeded. The following table shows the limits for simultaneous playing sounds based on platform.

Platform | Number of sounds that can play simultaneously
Windows Phone | 64
Xbox 360 | 300
Windows | No limit

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. Play throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicSoundEffectInstance.SubmitBuffer Method

DynamicSoundEffectInstance.SubmitBuffer Method

Submits an audio buffer for playback.

Expand image Overload List

Name | Description
DynamicSoundEffectInstance.SubmitBuffer (Byte[]) | Submits an audio buffer for playback. Playback starts at the beginning, and the buffer is played in its entirety.
DynamicSoundEffectInstance.SubmitBuffer (Byte[], Int32, Int32) | Submits an audio buffer for playback. Playback begins at the specifed offset, and the byte count determines the size of the sample played.

Expand image Remarks

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. SubmitBuffer throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace


DynamicSoundEffectInstance.SubmitBuffer Method (Byte[])

DynamicSoundEffectInstance.SubmitBuffer Method (Byte[])
See Also
CollapseAll image

Submits an audio buffer for playback. Playback starts at the beginning, and the buffer is played in its entirety.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void SubmitBuffer (
         byte[] buffer
)

Parameters

buffer
Buffer that contains the audio data. The audio format must be PCM wave data.

Expand image Remarks

The buffer must conform to the format alignment. For example, the buffer length must be aligned to the block alignment value for the audio format type. For PCM audio format, the block alignment is calculated as BlockAlignment = BytesPerSample * AudioChannels. DynamicSoundEffectInstance supports only PCM 16-bit mono or stereo data. Therefore, BlockAlignment = 2 * AudioChannels (Channels is 2 for mono content and 4 for stereo).

For information about an audio format using XNA Game Studio, see Audio API Developers Guide.

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. SubmitBuffer throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

Concepts

Sounds Overview
Audio API Developers Guide

Reference

--> DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicSoundEffectInstance.SubmitBuffer Method (Byte[], Int32, Int32)

DynamicSoundEffectInstance.SubmitBuffer Method (Byte[], Int32, Int32)
See Also
CollapseAll image

Submits an audio buffer for playback. Playback begins at the specifed offset, and the byte count determines the size of the sample played.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void SubmitBuffer (
         byte[] buffer,
         int offset,
         int count
)

Parameters

buffer
Buffer that contains the audio data. The audio format must be PCM wave data.
offset
Offset, in bytes, to the starting position of the data.
count
Amount, in bytes, of data sent.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | The exception thrown if SubmitBuffer is called after DynamicSoundEffectInstance is disposed.
ArgumentException | The exception thrown when buffer is null, is zero length, or does not satisfy format alignment restrictions. This exception also is thrown if offset is less than zero or is greater than or equal to the size of the buffer.
ArgumentOutOfRangeException | The exception thrown when count is less than or equal to zero, or if the sum of offset and count exceeds the size of the buffer.

Expand image Remarks

The buffer must conform to the format alignment; for example, the buffer length must be aligned to the block alignment value for the audio format type. For PCM audio format, the block alignment is calculated as BlockAlignment = BytesPerSample * AudioChannels. DynamicSoundEffectInstance supports only PCM 16-bit mono or stereo data. Therefore, BlockAlignment = 2 * AudioChannels (Channels is 2 for mono content and 4 for stereo). The offset and count values also must conform to the format alignment restrictions.

For information about an audio format using XNA Game Studio, see Audio API Developers Guide.

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. SubmitBuffer throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

Concepts

Sounds Overview
Audio API Developers Guide

Reference

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicSoundEffectInstance Properties

DynamicSoundEffectInstance Properties

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | (Inherited from SoundEffectInstance.)
Public Property | IsLooped | Indicates whether the audio playback of the DynamicSoundEffectInstance object is looped.
Public Property | Pan | (Inherited from SoundEffectInstance.)
Public Property | PendingBufferCount | Returns the number of audio buffers in the queue awaiting playback.
Public Property | Pitch | (Inherited from SoundEffectInstance.)
Public Property | State | (Inherited from SoundEffectInstance.)
Public Property | Volume | (Inherited from SoundEffectInstance.)

Expand image See Also

Reference

DynamicSoundEffectInstance Class
Microsoft.Xna.Framework.Audio Namespace


DynamicSoundEffectInstance.IsLooped Property

DynamicSoundEffectInstance.IsLooped Property

Indicates whether the audio playback of the DynamicSoundEffectInstance object is looped.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool IsLooped { get; set; }

Property Value

Always returns false.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | The exception that is thrown if IsLooped is called after DynamicSoundEffectInstance has been disposed.
InvalidOperationException | The exception that is thrown when IsLooped is set to true.

Expand image Remarks

IsLooped will always return false because DynamicSoundEffectInstance instances cannot be looped.

Expand image See Also

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicSoundEffectInstance.PendingBufferCount Property

DynamicSoundEffectInstance.PendingBufferCount Property

Returns the number of audio buffers in the queue awaiting playback.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int PendingBufferCount { get; }

Property Value

The number of audio buffers in the queue.

Expand image Remarks

DynamicSoundEffectInstance will update the pending buffer count as each buffer finishes playback. This means the first buffer in the queue is the currently-playing audio buffer.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | The exception that is thrown if PendingBufferCount is called after DynamicSoundEffectInstance has been disposed.

Expand image See Also

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicSoundEffectInstance Events

DynamicSoundEffectInstance Events

Expand image Public Events

 | Name | Description
Public Event | BufferNeeded | Event that occurs when the number of audio capture buffers awaiting playback is less than or equal to two.

Expand image See Also

Reference

DynamicSoundEffectInstance Class
Microsoft.Xna.Framework.Audio Namespace


DynamicSoundEffectInstance.BufferNeeded Event

DynamicSoundEffectInstance.BufferNeeded Event

Event that occurs when the number of audio capture buffers awaiting playback is less than or equal to two.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> BufferNeeded

Expand image Remarks

Occurs when PendingBufferCount <= 2.

The BufferNeeded event is raised in the following situations:

  • During DynamicSoundEffectInstance playback when the pending buffer count is less then or equal to 2.

  • Every time the DynamicSoundEffectInstance instance completes playing a buffer, and updates the pending buffer count.

  • When a DynamicSoundEffectInstance instance transitions from the stopped to playing state, and the pending buffer count is less than or equal to 2.

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. BufferNeeded throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


InstancePlayLimitException Class

InstancePlayLimitException Class
See Also Members
CollapseAll image

The exception that is thrown when there is an attempt to play more than 16 SoundEffectInstance sounds concurrently.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[SerializableAttribute]
public sealed class InstancePlayLimitException : ExternalException

Expand image Remarks

Only 16 SoundEffectInstance sounds can be playing at one time. If an attempt is made to play more than 16, this exception is thrown. Paused or stopped SoundEffectInstance objects do not count against this limit.

Expand image See Also

Reference

InstancePlayLimitException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


InstancePlayLimitException Members

InstancePlayLimitException Members
See Also Constructors
CollapseAll image

The exception that is thrown when there is an attempt to play more than 16 SoundEffectInstance sounds concurrently.

The following tables list the members exposed by the InstancePlayLimitException type.

Expand image Public Constructors

 | Name | Description
Public Method | InstancePlayLimitException | Overloaded. Initializes a new instance of the InstancePlayLimitException class.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | ErrorCode | (Inherited from ExternalException.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

InstancePlayLimitException Class
Microsoft.Xna.Framework.Audio Namespace


InstancePlayLimitException Constructor

InstancePlayLimitException Constructor

Initializes a new instance of the InstancePlayLimitException class.

Expand image Overload List

Name | Description
InstancePlayLimitException () | Initializes a new instance of the InstancePlayLimitException class.
InstancePlayLimitException (String) | Initializes a new instance of the InstancePlayLimitException class with a specified error message.
InstancePlayLimitException (String, Exception) | Initializes a new instance of the InstancePlayLimitException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Expand image See Also

Reference

InstancePlayLimitException Class
InstancePlayLimitException Members
Microsoft.Xna.Framework.Audio Namespace


InstancePlayLimitException Constructor ()

InstancePlayLimitException Constructor ()
See Also
CollapseAll image

Initializes a new instance of the InstancePlayLimitException class.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public InstancePlayLimitException ()

Expand image See Also

Reference

InstancePlayLimitException Class
InstancePlayLimitException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


InstancePlayLimitException Constructor (String)

InstancePlayLimitException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of the InstancePlayLimitException class with a specified error message.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public InstancePlayLimitException (
         string message
)

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

Expand image Remarks

The Message property of the new instance is initialized to message.

The InnerException property of the new instance is initialized to null.

Expand image See Also

Reference

InstancePlayLimitException Class
InstancePlayLimitException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


InstancePlayLimitException Constructor (String, Exception)

InstancePlayLimitException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of the InstancePlayLimitException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public InstancePlayLimitException (
         string message,
         Exception inner
)

Parameters

message
Error message that explains the reason for the exception.
inner
Exception that is the cause of the current exception. If innerException is not null, the current exception is raised in a catch block that handles the inner exception.

Expand image See Also

Reference

InstancePlayLimitException Class
InstancePlayLimitException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


InstancePlayLimitException Methods

InstancePlayLimitException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

InstancePlayLimitException Class
Microsoft.Xna.Framework.Audio Namespace


InstancePlayLimitException Properties

InstancePlayLimitException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | ErrorCode | (Inherited from ExternalException.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

InstancePlayLimitException Class
Microsoft.Xna.Framework.Audio Namespace


InstancePlayLimitException Events

InstancePlayLimitException Events

Expand image See Also

Reference

InstancePlayLimitException Class
Microsoft.Xna.Framework.Audio Namespace


Microphone Class

Microphone Class
See Also Members
CollapseAll image

Provides properties, methods, and fields and events for capturing audio data with microphones.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class Microphone

Expand image See Also

Reference

Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone Members

Microphone Members
See Also Events Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the Microphone type.

Expand image Public Fields

 | Name | Description
Public Field | Name | Returns the friendly name of the microphone.

Expand image Public Properties

 | Name | Description
 | All | Returns the collection of all currently-available microphones.
Public Property | BufferDuration | Gets or sets audio capture buffer duration of the microphone.
 | Default | Returns the default attached microphone.
Public Property | IsHeadset | Determines if the microphone is a wired headset or a Bluetooth device.
Public Property | SampleRate | Returns the sample rate at which the microphone is capturing audio data.
Public Property | State | Returns the recording state of the Microphone object.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | Overloaded. Gets the latest recorded data from the microphone.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetSampleDuration | Returns the duration of audio playback based on the size of the buffer.
Public Method | GetSampleSizeInBytes | Returns the size of the byte array required to hold the specified duration of audio for this microphone object.
Public Method | GetType | (Inherited from Object.)
Public Method | Start | Starts microphone audio capture.
Public Method | Stop | Stops microphone audio capture.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | BufferReady | Event that occurs when the audio capture buffer is ready to processed.

Expand image See Also

Reference

Microphone Class
Microsoft.Xna.Framework.Audio Namespace


Microphone Fields

Microphone Fields

Expand image Public Fields

 | Name | Description
Public Field | Name | Returns the friendly name of the microphone.

Expand image See Also

Reference

Microphone Class
Microsoft.Xna.Framework.Audio Namespace


Microphone.Name Field

Microphone.Name Field

Returns the friendly name of the microphone.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public readonly string Name

Expand image See Also

Reference

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone Methods

Microphone Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | Overloaded. Gets the latest recorded data from the microphone.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetSampleDuration | Returns the duration of audio playback based on the size of the buffer.
Public Method | GetSampleSizeInBytes | Returns the size of the byte array required to hold the specified duration of audio for this microphone object.
Public Method | GetType | (Inherited from Object.)
Public Method | Start | Starts microphone audio capture.
Public Method | Stop | Stops microphone audio capture.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Microphone Class
Microsoft.Xna.Framework.Audio Namespace


Microphone.GetData Method

Microphone.GetData Method

Gets the latest recorded data from the microphone.

Expand image Overload List

Name | Description
Microphone.GetData (Byte[]) | Gets the latest recorded data from the microphone based on the audio capture buffer.
Microphone.GetData (Byte[], Int32, Int32) | Gets the latest captured audio data from the microphone based on the specified offset and byte count.

Expand image Remarks

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. GetData throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace


Microphone.GetData Method (Byte[])

Microphone.GetData Method (Byte[])
See Also
CollapseAll image

Gets the latest recorded data from the microphone based on the audio capture buffer.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int GetData (
         byte[] buffer
)

Parameters

buffer
Buffer, in bytes, containing the captured audio data. The audio format must be PCM wave data.

Return Value

The buffer size, in bytes, of the audio data.

Expand image Exceptions

Exception type | Condition
ArgumentException | buffer is null, has zero length, or does not satisfy alignment requirements.

Expand image Remarks

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. GetData throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

For information about an audio format using XNA Game Studio, see Audio API Developers Guide.

Expand image See Also

Concepts

Working with Microphones
Sounds Overview
Audio API Developers Guide

Reference

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone.GetData Method (Byte[], Int32, Int32)

Microphone.GetData Method (Byte[], Int32, Int32)
See Also
CollapseAll image

Gets the latest captured audio data from the microphone based on the specified offset and byte count.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int GetData (
         byte[] buffer,
         int offset,
         int count
)

Parameters

buffer
Buffer, in bytes, containing the captured audio data. The audio format must be PCM wave data.
offset
Offset, in bytes, to the starting position of the data.
count
Amount, in bytes, of desired audio data.

Return Value

The buffer size, in bytes, of the audio data.

Expand image Exceptions

Exception type Condition
ArgumentException

The exception thrown when the following arguments are invalid:

  • buffer is null, has zero length, or does not satisfy alignment requirements.
  • offset is less than zero, is greater than or equal to the size of the buffer, or does not satisfy alignment requirements.
  • The sum of count and offset is greater than the size of the buffer, count is less than or equal to zero, or does not satisfy alignment requirements.

Expand image Remarks

For information about an audio format using XNA Game Studio, see Audio API Developers Guide.

Expand image See Also

Concepts

Working with Microphones
Sounds Overview
Audio API Developers Guide

Reference

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone.GetSampleDuration Method

Microphone.GetSampleDuration Method

Returns the duration of audio playback based on the size of the buffer.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TimeSpan GetSampleDuration (
         int sizeInBytes
)

Parameters

sizeInBytes
Size, in bytes, of the audio data.

Return Value

TimeSpan object that represents the duration of the audio playback.

Expand image Remarks

sizeInBytes must satisfy format alignment restrictions.

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone.GetSampleSizeInBytes Method

Microphone.GetSampleSizeInBytes Method

Returns the size of the byte array required to hold the specified duration of audio for this microphone object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int GetSampleSizeInBytes (
         TimeSpan duration
)

Parameters

duration
TimeSpan object that contains the duration of the audio sample.

Return Value

Size (10 ms block aligned), in bytes, of the audio buffer.

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone.Start Method

Microphone.Start Method

Starts microphone audio capture.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Start ()

Expand image Remarks

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. Start throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone.Stop Method

Microphone.Stop Method

Stops microphone audio capture.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Stop ()

Expand image See Also

Reference

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone Properties

Microphone Properties

Expand image Public Properties

 | Name | Description
 | All | Returns the collection of all currently-available microphones.
Public Property | BufferDuration | Gets or sets audio capture buffer duration of the microphone.
 | Default | Returns the default attached microphone.
Public Property | IsHeadset | Determines if the microphone is a wired headset or a Bluetooth device.
Public Property | SampleRate | Returns the sample rate at which the microphone is capturing audio data.
Public Property | State | Returns the recording state of the Microphone object.

Expand image See Also

Reference

Microphone Class
Microsoft.Xna.Framework.Audio Namespace


Microphone.All Property

Microphone.All Property

Returns the collection of all currently-available microphones.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static ReadOnlyCollection<Microphone> All { get; }

Property Value

The collection of microphones.

Expand image Remarks

Windows Phone Specific Information

This property will always return the default microphone on Windows Phone, and it will only return one device.

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone.BufferDuration Property

Microphone.BufferDuration Property

Gets or sets audio capture buffer duration of the microphone.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TimeSpan BufferDuration { get; set; }

Property Value

The duration of the audio capture buffer.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | The exception that is thrown if BufferDuration is less than 100 milliseconds or is greater than 1000 milliseconds.
ArgumentOutOfRangeException | The exception that is thrown if BufferDuration is not aligned by 10 milliseconds.

Expand image Remarks

The duration of the capture buffer must be between 100ms and 1000ms. Additionally, the capture buffer must be 10ms aligned (BufferDuration % 10 == 0).

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. BufferDuration throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone.Default Property

Microphone.Default Property

Returns the default attached microphone.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Microphone Default { get; }

Property Value

The default microphone; returns null if there are no microphones attached.

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone.IsHeadset Property

Microphone.IsHeadset Property

Determines if the microphone is a wired headset or a Bluetooth device.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsHeadset { get; }

Property Value

If the microphone is a headset, the value is true; otherwise it is false.

Expand image Remarks

Always returns true for Windows Phone devices.

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone.SampleRate Property

Microphone.SampleRate Property

Returns the sample rate at which the microphone is capturing audio data.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int SampleRate { get; }

Property Value

Sample rate of audio data being captured, in Hertz (Hz).

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone.State Property

Microphone.State Property

Returns the recording state of the Microphone object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public MicrophoneState State { get; }

Property Value

Enumeration that indicates whether the recording state of the Microphone has started or stopped.

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microphone Events

Microphone Events

Expand image Public Events

 | Name | Description
Public Event | BufferReady | Event that occurs when the audio capture buffer is ready to processed.

Expand image See Also

Reference

Microphone Class
Microsoft.Xna.Framework.Audio Namespace


Microphone.BufferReady Event

Microphone.BufferReady Event

Event that occurs when the audio capture buffer is ready to processed.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> BufferReady

Expand image See Also

Microphone Class
Microphone Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MicrophoneState Enumeration

MicrophoneState Enumeration

Current state of the Microphone audio capture (started or stopped).

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum MicrophoneState

Expand image Members

Member name | Description
Started | The Microphone audio capture has started.
Stopped | The Microphone audio capture has stopped.

Expand image See Also

Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoAudioHardwareException Class

NoAudioHardwareException Class
See Also Members
CollapseAll image

The exception that is thrown when no audio hardware is present, or when audio hardware is installed, but the device drivers for the audio hardware are not present or enabled.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[SerializableAttribute]
public sealed class NoAudioHardwareException : ExternalException

Expand image See Also

Reference

NoAudioHardwareException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoAudioHardwareException Members

NoAudioHardwareException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the NoAudioHardwareException type.

Expand image Public Constructors

 | Name | Description
Public Method | NoAudioHardwareException | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | ErrorCode | (Inherited from ExternalException.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NoAudioHardwareException Class
Microsoft.Xna.Framework.Audio Namespace


NoAudioHardwareException Constructor

NoAudioHardwareException Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
NoAudioHardwareException () | Initializes a new instance of this class.
NoAudioHardwareException (String) | Initializes a new instance of this class with a specified error message.
NoAudioHardwareException (String, Exception) | Initializes a new instance of this class with a specified error message and a reference to the inner exception that is the cause of this exception.

Expand image See Also

Reference

NoAudioHardwareException Class
NoAudioHardwareException Members
Microsoft.Xna.Framework.Audio Namespace


NoAudioHardwareException Constructor ()

NoAudioHardwareException Constructor ()
See Also
CollapseAll image

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NoAudioHardwareException ()

Expand image See Also

Reference

NoAudioHardwareException Class
NoAudioHardwareException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoAudioHardwareException Constructor (String)

NoAudioHardwareException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of this class with a specified error message.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NoAudioHardwareException (
         string message
)

Parameters

message
A message that describes the error.

Expand image See Also

Reference

NoAudioHardwareException Class
NoAudioHardwareException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoAudioHardwareException Constructor (String, Exception)

NoAudioHardwareException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of this class with a specified error message and a reference to the inner exception that is the cause of this exception.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NoAudioHardwareException (
         string message,
         Exception inner
)

Parameters

message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Expand image See Also

Reference

NoAudioHardwareException Class
NoAudioHardwareException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoAudioHardwareException Methods

NoAudioHardwareException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NoAudioHardwareException Class
Microsoft.Xna.Framework.Audio Namespace


NoAudioHardwareException Properties

NoAudioHardwareException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | ErrorCode | (Inherited from ExternalException.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

NoAudioHardwareException Class
Microsoft.Xna.Framework.Audio Namespace


NoAudioHardwareException Events

NoAudioHardwareException Events

Expand image See Also

Reference

NoAudioHardwareException Class
Microsoft.Xna.Framework.Audio Namespace


NoMicrophoneConnectedException Class

NoMicrophoneConnectedException Class
See Also Members
CollapseAll image

The exception that is thrown when Microphone API calls are made on a disconnected microphone.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class NoMicrophoneConnectedException : Exception

Expand image See Also

Reference

NoMicrophoneConnectedException Members
Microphone
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoMicrophoneConnectedException Members

NoMicrophoneConnectedException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the NoMicrophoneConnectedException type.

Expand image Public Constructors

 | Name | Description
Public Method | NoMicrophoneConnectedException | Overloaded. Initializes a new instance of the NoMicrophoneConnectedException class.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NoMicrophoneConnectedException Class
Microsoft.Xna.Framework.Audio Namespace


NoMicrophoneConnectedException Constructor

NoMicrophoneConnectedException Constructor

Initializes a new instance of the NoMicrophoneConnectedException class.

Expand image Overload List

Name | Description
NoMicrophoneConnectedException () | Initializes a new instance of the NoMicrophoneConnectedException class.
NoMicrophoneConnectedException (String) | Initializes a new instance of the NoMicrophoneConnectedException class with a specified error message.
NoMicrophoneConnectedException (String, Exception) | Initializes a new instance of the NoMicrophoneConnectedException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Expand image See Also

Reference

NoMicrophoneConnectedException Class
NoMicrophoneConnectedException Members
Microsoft.Xna.Framework.Audio Namespace


NoMicrophoneConnectedException Constructor ()

NoMicrophoneConnectedException Constructor ()
See Also
CollapseAll image

Initializes a new instance of the NoMicrophoneConnectedException class.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NoMicrophoneConnectedException ()

Expand image See Also

Reference

NoMicrophoneConnectedException Class
NoMicrophoneConnectedException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoMicrophoneConnectedException Constructor (String)

NoMicrophoneConnectedException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of the NoMicrophoneConnectedException class with a specified error message.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NoMicrophoneConnectedException (
         string message
)

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

Expand image See Also

Reference

NoMicrophoneConnectedException Class
NoMicrophoneConnectedException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoMicrophoneConnectedException Constructor (String, Exception)

NoMicrophoneConnectedException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of the NoMicrophoneConnectedException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NoMicrophoneConnectedException (
         string message,
         Exception inner
)

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
inner
Exception that is the cause of the current exception. If innerException is not null, the current exception is raised in a catch block that handles the inner exception.

Expand image See Also

Reference

NoMicrophoneConnectedException Class
NoMicrophoneConnectedException Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoMicrophoneConnectedException Methods

NoMicrophoneConnectedException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NoMicrophoneConnectedException Class
Microsoft.Xna.Framework.Audio Namespace


NoMicrophoneConnectedException Properties

NoMicrophoneConnectedException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

NoMicrophoneConnectedException Class
Microsoft.Xna.Framework.Audio Namespace


NoMicrophoneConnectedException Events

NoMicrophoneConnectedException Events

Expand image See Also

Reference

NoMicrophoneConnectedException Class
Microsoft.Xna.Framework.Audio Namespace


RendererDetail Structure

RendererDetail Structure

Represents an audio renderer, which is a device that can render audio to a user.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[SerializableAttribute]
public struct RendererDetail

Expand image See Also

Reference

RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


RendererDetail Members

RendererDetail Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the RendererDetail type.

Expand image Public Properties

 | Name | Description
Public Property | FriendlyName | Gets the human-readable name for the renderer.
Public Property | RendererId | Specifies the string that identifies the renderer.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

RendererDetail Structure
Microsoft.Xna.Framework.Audio Namespace


RendererDetail Methods

RendererDetail Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

RendererDetail Structure
Microsoft.Xna.Framework.Audio Namespace


RendererDetail.Equals Method

RendererDetail.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to compare to this object.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


RendererDetail.GetHashCode Method

RendererDetail.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


RendererDetail.op_Equality Method

RendererDetail.op_Equality Method

Compares two objects to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         RendererDetail left,
         RendererDetail right
)

Parameters

left
Object to the left of the equality operator.
right
Object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


RendererDetail.op_Inequality Method

RendererDetail.op_Inequality Method

Compares two objects to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         RendererDetail left,
         RendererDetail right
)

Parameters

left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


RendererDetail.ToString Method

RendererDetail.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


RendererDetail Properties

RendererDetail Properties

Expand image Public Properties

 | Name | Description
Public Property | FriendlyName | Gets the human-readable name for the renderer.
Public Property | RendererId | Specifies the string that identifies the renderer.

Expand image See Also

Reference

RendererDetail Structure
Microsoft.Xna.Framework.Audio Namespace


RendererDetail.FriendlyName Property

RendererDetail.FriendlyName Property

Gets the human-readable name for the renderer.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string FriendlyName { get; }

Property Value

The name of the renderer.

Expand image See Also

Reference

RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


RendererDetail.RendererId Property

RendererDetail.RendererId Property

Specifies the string that identifies the renderer.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string RendererId { get; }

Property Value

A string identifying the renderer. If this value is null, the default audio output device is used.

Caution
On Xbox 360, this property is unused and ignored.

Expand image See Also

Reference

RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank Class

SoundBank Class
See Also Members
CollapseAll image

Represents a sound bank, which is a collection of cues.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class SoundBank : IDisposable

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank Members

SoundBank Members
See Also Constructors Events Methods Properties
CollapseAll image

The following tables list the members exposed by the SoundBank type.

Expand image Public Constructors

 | Name | Description
Public Method | SoundBank | Initializes a new instance of this class using a sound bank from file.

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | IsInUse | Returns whether the sound bank is currently in use.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCue | Gets a cue from the sound bank.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | PlayCue | Overloaded. Plays a cue.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

SoundBank Class
Microsoft.Xna.Framework.Audio Namespace


SoundBank Constructor

SoundBank Constructor

Initializes a new instance of this class using a sound bank from file.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public SoundBank (
         AudioEngine audioEngine,
         string filename
)

Parameters

audioEngine
Audio engine that will be associated with this sound bank.
filename
Path to the sound bank file.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The audioEngine or filename parameter is null.
ArgumentException | XACT could not load the data provided. Make sure you are using the correct version of the XACT tool.
InvalidOperationException | Unable to create the SoundBank resource.

Expand image See Also

Reference

SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank Methods

SoundBank Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCue | Gets a cue from the sound bank.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | PlayCue | Overloaded. Plays a cue.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SoundBank Class
Microsoft.Xna.Framework.Audio Namespace


SoundBank.Dispose Method

SoundBank.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
SoundBank.Dispose () | Immediately releases the unmanaged resources used by this object.
SoundBank.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace


SoundBank.Dispose Method ()

SoundBank.Dispose Method ()
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank.Dispose Method (Boolean)

SoundBank.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool disposing
)

Parameters

disposing
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank.Finalize Method

SoundBank.Finalize Method

Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image See Also

Reference

SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank.GetCue Method

SoundBank.GetCue Method

Gets a cue from the sound bank.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Cue GetCue (
         string name
)

Parameters

name
Friendly name of the cue to get.

Return Value

Cue object.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The name parameter is null.

Expand image Remarks

Each Cue instance that you retrieve is unique, even when retrieving multiple cues with the same name. This allows multiple instances of the same Cue to exist and play simultaneously.

The Cue instance that you retrieve using this method is valid only as long as it is in scope. If the Cue instance is allowed to go out of scope, such as in the case of the Cue being retrieved and played without otherwise being stored, the Cue is marked to be disposed by the garbage collector. This will result in the Cue stopping playback at an indeterminate time when the garbage collector disposes of the Cue. To prevent this behavior, store Cue objects to prevent them from falling out of scope. Alternatively, you can call PlayCue to play a cue immediately that will not fall out of scope.

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank.PlayCue Method

SoundBank.PlayCue Method

Plays a cue.

Expand image Overload List

Name | Description
SoundBank.PlayCue (String) | Plays a cue.
SoundBank.PlayCue (String, AudioListener, AudioEmitter) | Plays a cue using 3D positional information specified in an AudioListener and AudioEmitter.

Expand image See Also

Tasks

Playing Sounds from an XACT Project

Reference

SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace


SoundBank.PlayCue Method (String)

SoundBank.PlayCue Method (String)
See Also
CollapseAll image

Plays a cue.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void PlayCue (
         string name
)

Parameters

name
Name of the cue to play.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The name parameter is null.
InvalidOperationException | The name parameter specifies a cue that does not exist.

Expand image Remarks

Each Cue instance that you play is unique, even when playing multiple cues with the same name. This allows multiple instances of the same Cue to play simultaneously.

Calling this method does not return a Cue object. Therefore, once the cue has started playing, it cannot be controlled through any methods of Cue, such as Stop, Pause, or Resume. The cue will play until its authored end, at which point it will be released.

Because no Cue object is retrieved, cues played using this method are also unable to use Apply3D to apply 3D effects to the cue. To retrieve a cue that you can control during playback, or apply 3D effects to, use GetCue.

Cue objects whose Playlist Type property has been specified as Interactive cannot be initiated with the PlayCue method. (This property is set in the XACT tool, within the Variation Playlist attributes of the Cue Properties.) Instead, retrieve the Cue object with the GetCue method, invoke its Play method, then release the object through the Dispose method.

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Reference

SoundBank.PlayCue Method
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank.PlayCue Method (String, AudioListener, AudioEmitter)

SoundBank.PlayCue Method (String, AudioListener, AudioEmitter)
See Also
CollapseAll image

Plays a cue using 3D positional information specified in an AudioListener and AudioEmitter.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void PlayCue (
         string name,
         AudioListener listener,
         AudioEmitter emitter
)

Parameters

name
Name of the cue to play.
listener
AudioListener that specifies listener 3D audio information.
emitter
AudioEmitter that specifies emitter 3D audio information.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The name parameter is null.
InvalidOperationException | The name parameter specifies a cue that does not exist.

Expand image Remarks

The 3D audio information in the specified listener and emitter is used to initialize the cue instance and apply a static positional 3D audio effect (the direction from which the player hears the sound). Position and velocity are not updated over time; the 3D audio effects are calculated based on the emitter and listener position at the time of the call. Typically, this is used for short-lived sounds, or when the object and listener are stationary for the duration of the sound but placed somewhere in the world space.

For example, a sound that is played off to the right will continue to sound as if it is coming from the right, even if the listener moves or turns. For very short sounds, this may be imperceptable and thus acceptable. As another example, a voice that comes from the player's vehicle will always be the same distance and direction relative to the player, so static positioning in this case would be correct.

Attenuation and doppler effects, if enabled, will also be static for the duration of the sound.

To enable dynamic 3D audio when the emitter or listener are moving, use GetCue and Apply3D instead.

Each Cue instance that you play is unique, even when playing multiple cues with the same name. This allows multiple instances of the same Cue to play simultaneously.

Calling this method does not return a Cue object. Therefore, once the cue has started playing, it cannot be controlled through any methods of Cue, such as Stop, Pause, or Resume. The cue will play until its authored end, at which point it will be released.

Because no Cue object is retrieved, cues played using this method are also unable to use Apply3D to apply dynamic 3D effects to the cue. To retrieve a cue that you can control during playback, or apply dynamic 3D effects to, use GetCue.

For more information about 3D audio, see Applying a 3D Positional Effect to a Cue (XACT) and Applying 3D Audio Effects (XACT).

Cue objects whose Playlist Type property has been specified as Interactive cannot be initiated with the PlayCue method. (This property is set in the XACT tool, within the Variation Playlist attributes of the Cue Properties.) Instead, retrieve the Cue object with the GetCue method, invoke its Play method, then release the object through the Dispose method.

Expand image See Also

Concepts

Sounds Overview

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)
Applying a 3D Positional Effect to a Cue (XACT)
Applying 3D Audio Effects (XACT)

Reference

SoundBank.PlayCue Method
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank Properties

SoundBank Properties

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | IsInUse | Returns whether the sound bank is currently in use.

Expand image See Also

Reference

SoundBank Class
Microsoft.Xna.Framework.Audio Namespace


SoundBank.IsDisposed Property

SoundBank.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank.IsInUse Property

SoundBank.IsInUse Property

Returns whether the sound bank is currently in use.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsInUse { get; }

Property Value

true if the sound bank is in use; false otherwise.

Expand image Remarks

This value will return true if the sound bank is currently referenced by at least one valid cue instance or other client. For example, the game itself might reference the sound bank.

Expand image See Also

Reference

SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundBank Events

SoundBank Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Expand image See Also

Reference

SoundBank Class
Microsoft.Xna.Framework.Audio Namespace


SoundBank.Disposing Event

SoundBank.Disposing Event

Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Disposing

Expand image See Also

Reference

SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SoundEffect Class

SoundEffect Class
See Also Members
CollapseAll image

Provides a loaded sound resource. You can play multiple instances of the SoundEffect by calling Play.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class SoundEffect : IDisposable

Expand image Remarks

A SoundEffect contains the audio data and metadata (such as wave data and loop information) loaded from a sound file. You can create multiple SoundEffectInstance objects, and play them from a single SoundEffect. These objects share the resources of that SoundEffect.

You can create a SoundEffect by calling ContentManager.Load. When you make that call, use the type SoundEffect and the asset name of an audio file. The audio file must be part of the Content project. Be sure to use the SoundEffect - XNA Framework content processor.

The only limit to the number of loaded SoundEffect objects is memory. A loaded SoundEffect will continue to hold its memory resources throughout its lifetime. All SoundEffectInstance objects created from a SoundEffect share memory resources. When a SoundEffect object is destroyed, all SoundEffectInstance objects previously created by that SoundEffect will stop playing and become invalid.

Expand image See Also

Tasks

Playing a Sound
Looping a Sound
Adjusting Pitch and Volume
Applying a 3D Positional Effect to a Sound

Reference

SoundEffectInstance Class
ContentManager.Load Generic Method
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect Members

SoundEffect Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the SoundEffect type.

Expand image Public Constructors

 | Name | Description
Public Method | SoundEffect | Overloaded. Initializes a new instance of SoundEffect, which provides the ability to load audio data for sound effects.

Expand image Public Properties

 | Name | Description
 | DistanceScale | Gets or sets a value that adjusts the effect of distance calculations on the sound (emitter).
 | DopplerScale | Gets or sets a value that adjusts the effect of doppler calculations on the sound (emitter).
Public Property | Duration | Gets the duration of the SoundEffect.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
 | MasterVolume | Gets or sets the master volume that affects all SoundEffectInstance sounds.
Public Property | Name | Gets or sets the asset name of the SoundEffect.
 | SpeedOfSound | Returns the speed of sound: 343.5 meters per second.

Expand image Public Methods

 | Name | Description
Public Method | CreateInstance | Creates a new SoundEffectInstance for this SoundEffect.
Public Method | Dispose | Releases the resources used by the SoundEffect.
Public Method | Equals | (Inherited from Object.)
 | FromStream | Creates a SoundEffect object based on the specified data stream.
Public Method | GetHashCode | (Inherited from Object.)
 | GetSampleDuration | Returns the sample duration based on the specified sample size and sample rate.
 | GetSampleSizeInBytes | Returns the size of the audio sample based on duration, sample rate, and audio channels.
Public Method | GetType | (Inherited from Object.)
Public Method | Play | Overloaded. Plays a sound.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SoundEffect Class
Microsoft.Xna.Framework.Audio Namespace


SoundEffect Constructor

SoundEffect Constructor

Initializes a new instance of SoundEffect, which provides the ability to load audio data for sound effects.

Expand image Overload List

Name | Description
SoundEffect (Byte[], Int32, AudioChannels) | Initializes a new instance of SoundEffect based on an audio buffer, sample rate, and number of audio channels.
SoundEffect (Byte[], Int32, Int32, Int32, AudioChannels, Int32, Int32) | Initializes a new instance of SoundEffect with specified parameters such as audio sample rate, channels, looping criteria, and a buffer to hold the audio.

Expand image See Also

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace


SoundEffect Constructor (Byte[], Int32, AudioChannels)

SoundEffect Constructor (Byte[], Int32, AudioChannels)
See Also
CollapseAll image

Initializes a new instance of SoundEffect based on an audio buffer, sample rate, and number of audio channels.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public SoundEffect (
         byte[] buffer,
         int sampleRate,
         AudioChannels channels
)

Parameters

buffer
Buffer that contains the audio data. The audio format must be PCM wave data.
sampleRate
Sample rate, in Hertz (Hz), of audio data.
channels
Number of channels (mono or stereo) of audio data.

Expand image Remarks

For information about an audio format using XNA Game Studio, see Audio API Developers Guide.

Expand image See Also

Concepts

Sounds Overview
Audio API Developers Guide

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect Constructor (Byte[], Int32, Int32, Int32, AudioChannels, Int32, Int32)

SoundEffect Constructor (Byte[], Int32, Int32, Int32, AudioChannels, Int32, Int32)
See Also
CollapseAll image

Initializes a new instance of SoundEffect with specified parameters such as audio sample rate, channels, looping criteria, and a buffer to hold the audio.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public SoundEffect (
         byte[] buffer,
         int offset,
         int count,
         int sampleRate,
         AudioChannels channels,
         int loopStart,
         int loopLength
)

Parameters

buffer
Buffer that contains the audio data. The audio format must be PCM wave data.
offset
Offset, in bytes, to the starting position of the audio data.
count
Amount, in bytes, of audio data.
sampleRate
Sample rate, in Hertz (Hz), of audio data.
channels
Number of channels (mono or stereo) of audio data.
loopStart
Loop start in samples.
loopLength
Loop length in samples.

Expand image Exceptions

Exception type Condition
ArgumentOutOfRangeException

The exception thrown when the following arguments are out of range:

  • sampleRate is less than 8,000 Hz or is greater than 48,000 Hz.
  • channels is something other than mono or stereo.
ArgumentException

The exception thrown when the following arguments are invalid:

  • buffer is null, has zero length, or does not satisfy alignment requirements.
  • offset is less than zero, is greater than or equal to the size of the buffer, or does not satisfy alignment requirements.
  • The sum of count and offset is greater than the size of the buffer, count is less than or equal to zero, or does not satisfy alignment requirements.
  • loopStart is less than zero, loopLength is less than zero, or loopStart + loopLength is greater than the sample size.

Expand image Remarks

For information regarding audio format using XNA Game Studio see Audio API Developers Guide.

Expand image See Also

Concepts

Sounds Overview
Audio API Developers Guide

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect Methods

SoundEffect Methods

Expand image Public Methods

 | Name | Description
Public Method | CreateInstance | Creates a new SoundEffectInstance for this SoundEffect.
Public Method | Dispose | Releases the resources used by the SoundEffect.
Public Method | Equals | (Inherited from Object.)
 | FromStream | Creates a SoundEffect object based on the specified data stream.
Public Method | GetHashCode | (Inherited from Object.)
 | GetSampleDuration | Returns the sample duration based on the specified sample size and sample rate.
 | GetSampleSizeInBytes | Returns the size of the audio sample based on duration, sample rate, and audio channels.
Public Method | GetType | (Inherited from Object.)
Public Method | Play | Overloaded. Plays a sound.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SoundEffect Class
Microsoft.Xna.Framework.Audio Namespace


SoundEffect.CreateInstance Method

SoundEffect.CreateInstance Method

Creates a new SoundEffectInstance for this SoundEffect.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public SoundEffectInstance CreateInstance ()

Return Value

A new SoundEffectInstance for this SoundEffect.

Expand image Remarks

Creating a SoundEffectInstance before calling Play allows you to access advanced playback features, such as 3D positioning.

Expand image See Also

Tasks

Looping a Sound
Adjusting Pitch and Volume
Applying a 3D Positional Effect to a Sound

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.Dispose Method

SoundEffect.Dispose Method

Releases the resources used by the SoundEffect.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image Remarks

Call Dispose only when you are finished using the SoundEffect. The Dispose method leaves the SoundEffect in an unusable state. After calling Dispose, you must release all references to the SoundEffect in order for the garbage collector to reclaim the memory that the SoundEffect was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

Expand image See Also

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.FromStream Method

SoundEffect.FromStream Method

Creates a SoundEffect object based on the specified data stream.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static SoundEffect FromStream (
         Stream stream
)

Parameters

stream
Stream object that contains the data for this SoundEffect object.

Return Value

SoundEffect object that this method creates.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | Stream parameter is NULL.

Expand image Remarks

The Stream object must point to the head of a valid PCM wave file. Also, this wave file must be in the RIFF bitstream format.

The audio format has the following restrictions:

  • Must be a PCM wave file
  • Can only be mono or stereo
  • Must be 8 or 16 bit
  • Sample rate must be between 8,000 Hz and 48,000 Hz

Expand image See Also

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.GetSampleDuration Method

SoundEffect.GetSampleDuration Method

Returns the sample duration based on the specified sample size and sample rate.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static TimeSpan GetSampleDuration (
         int sizeInBytes,
         int sampleRate,
         AudioChannels channels
)

Parameters

sizeInBytes
Size, in bytes, of audio data.
sampleRate
Sample rate, in Hertz (Hz), of audio content. The sampleRate must be between 8000 Hz and 48000 Hz.
channels
Number of channels in the audio data.

Return Value

TimeSpan object that represents the calculated sample duration.

Expand image See Also

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.GetSampleSizeInBytes Method

SoundEffect.GetSampleSizeInBytes Method

Returns the size of the audio sample based on duration, sample rate, and audio channels.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static int GetSampleSizeInBytes (
         TimeSpan duration,
         int sampleRate,
         AudioChannels channels
)

Parameters

duration
TimeSpan object that contains the sample duration.
sampleRate
Sample rate, in Hertz (Hz), of audio content. The sampleRate parameter must be between 8,000 Hz and 48,000 Hz.
channels
Number of channels in the audio data.

Return Value

Size, in bytes, of audio sample.

Expand image See Also

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.Play Method

SoundEffect.Play Method

Plays a sound.

Expand image Overload List

Name | Description
SoundEffect.Play () | Plays a sound.
SoundEffect.Play (Single, Single, Single) | Plays a sound based on specified volume, pitch, and panning.

Expand image Remarks

Play will return false if too many sounds already are playing.

To loop a sound or apply 3D effects, call CreateInstance instead of Play, and SoundEffectInstance.Play.

Sounds play in a "fire and forget" fashion with Play; therefore, the lifetime of these sounds is managed by the framework. These sounds will play once, and then stop. They cannot be looped or 3D positioned. To loop a sound or apply 3D effects, call CreateInstance instead of Play, or call SoundEffectInstance.Play.

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. Play throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

Tasks

Playing a Sound
Enable XNA Framework Events in Windows Phone Applications

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace


SoundEffect.Play Method ()

SoundEffect.Play Method ()
See Also
CollapseAll image

Plays a sound.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Play ()

Return Value

true if the sound is playing back successfully; otherwise, false.

Expand image Remarks

Play returns false if too many sounds already are playing.

To loop a sound or apply 3D effects, call CreateInstance instead of Play, and SoundEffectInstance.Play.

Sounds play in a "fire and forget" fashion with Play; therefore, the lifetime of these sounds is managed by the framework. These sounds will play once, and then stop. They cannot be looped or 3D positioned. To loop a sound or apply 3D effects, call CreateInstance instead of Play, or SoundEffectInstance.Play.

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. Play throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

Tasks

Playing a Sound
Looping a Sound
Enable XNA Framework Events in Windows Phone Applications

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.Play Method (Single, Single, Single)

SoundEffect.Play Method (Single, Single, Single)
See Also
CollapseAll image

Plays a sound based on specified volume, pitch, and panning.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Play (
         float volume,
         float pitch,
         float pan
)

Parameters

volume
Volume, ranging from 0.0f (silence) to 1.0f (full volume). 1.0f is full volume relative to SoundEffect.MasterVolume.
pitch
Pitch adjustment, ranging from -1.0f (down one octave) to 1.0f (up one octave). 0.0f is unity (normal) pitch.
pan
Panning, ranging from -1.0f (full left) to 1.0f (full right). 0.0f is centered.

Return Value

true if the sound is playing back successfully; otherwise, false.

Expand image Remarks

Play will return false if there too many sounds already are playing.

To loop a sound or apply 3D effects, call CreateInstance instead of Play, and SoundEffectInstance.Play.

Sounds play in a "fire and forget" fashion with Play; therefore, the lifetime of these sounds is managed by the framework. These sounds will play once, and then stop. They cannot be looped or 3D positioned.

Silverlight applications must ensure that FrameworkDispatcher.Update is called regularly in order for "fire and forget" sounds to work correctly. Play throws an InvalidOperationException if FrameworkDispatcher.Update has not been called at least once before making this call. For more information, see Enable XNA Framework Events in Windows Phone Applications.

Expand image See Also

Tasks

Playing a Sound
Enable XNA Framework Events in Windows Phone Applications

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect Properties

SoundEffect Properties

Expand image Public Properties

 | Name | Description
 | DistanceScale | Gets or sets a value that adjusts the effect of distance calculations on the sound (emitter).
 | DopplerScale | Gets or sets a value that adjusts the effect of doppler calculations on the sound (emitter).
Public Property | Duration | Gets the duration of the SoundEffect.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
 | MasterVolume | Gets or sets the master volume that affects all SoundEffectInstance sounds.
Public Property | Name | Gets or sets the asset name of the SoundEffect.
 | SpeedOfSound | Returns the speed of sound: 343.5 meters per second.

Expand image See Also

Reference

SoundEffect Class
Microsoft.Xna.Framework.Audio Namespace


SoundEffect.DistanceScale Property

SoundEffect.DistanceScale Property

Gets or sets a value that adjusts the effect of distance calculations on the sound (emitter).

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float DistanceScale { get; set; }

Property Value

Value that scales distance calculations on the sound (emitter).

Expand image Remarks

If sounds are attenuating too fast, which means that the sounds get quiet too quickly as they move away from the listener, you need to increase the DistanceScale. If sounds are not attenuating fast enough, decrease the DistanceScale.

This property will also affect Doppler sound.

Adjustment | Effect
DistanceScale <= 0.0f | Throws an ArgumentOutOfRangeException (invalid value).
0.0 < DistanceScale <= 1.0 | Increases the effect of distance attenuation.
DistanceScale = 1.0 | No scaling (this is the default setting).
DistanceScale > 1.0 | Decrease the effect of distance attenuation.

Distance attenuation is calculated using the inverse square law:

volume = 1.0 / distance;

Adding DistanceScale into the equations give:

if (distance > DistanceScale)
{
  volume = DistanceScale / distance;
}
else
{
  volume = 1.0;
}

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | The exception that is thrown when DistanceScale is less than or equal to 0.0.

Expand image See Also

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.DopplerScale Property

SoundEffect.DopplerScale Property

Gets or sets a value that adjusts the effect of doppler calculations on the sound (emitter).

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float DopplerScale { get; set; }

Property Value

Value that scales doppler calculations on the sound (emitter).

Expand image Remarks

DopplerScale changes the relative velocities of emitters and listeners.

If sounds are shifting (pitch) too much for the given relative velocity of the emitter and listener, decrease the DopplerScale. If sounds are not shifting enough for the given relative velocity of the emitter and listener, increase the DopplerScale.

Adjustment | Effect
DopplerScale = 0 | No Doppler will be applied
0.0 < DopplerScale <= 1.0 | Decreases the effect of Doppler
DopplerScale = 1.0 | No scaling (default)
DopplerScale > 1.0 | Increase the effect of Doppler

Expand image See Also

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.Duration Property

SoundEffect.Duration Property

Gets the duration of the SoundEffect.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TimeSpan Duration { get; }

Property Value

A TimeSpan that represents the duration of the SoundEffect.

Expand image Remarks

This is a read-only property. The sound duration is initialized from the sound file and cannot be changed. For information about authoring and adding sound files, see Adding a Sound File (XACT).

Expand image See Also

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.IsDisposed Property

SoundEffect.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.MasterVolume Property

SoundEffect.MasterVolume Property

Gets or sets the master volume that affects all SoundEffectInstance sounds.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float MasterVolume { get; set; }

Property Value

Volume, ranging from 0.0f (silence) to 1.0f (current device volume). 1.0f is full volume relative to the current device volume.

Expand image Remarks

The sound effect master volume affects all sound effect instances, including currently playing instances and newly created instances. Each SoundEffectInstance also has its own volume (SoundEffectInstance.Volume) that is relative to the master volume.

You can adjust the volume of all sounds effects by changing MasterVolume. You can adjust the volume of an individual SoundEffectInstance by changing SoundEffectInstance.Volume, or by specifying an instance volume when you call Play to create the instance.

Expand image See Also

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.Name Property

SoundEffect.Name Property

Gets or sets the asset name of the SoundEffect.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; set; }

Property Value

Asset name of the SoundEffect.

Expand image See Also

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffect.SpeedOfSound Property

SoundEffect.SpeedOfSound Property

Returns the speed of sound: 343.5 meters per second.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float SpeedOfSound { get; set; }

Property Value

The speed of sound: 343.5 meters per second.

Expand image Remarks

Use this value to simulate different environments. A smaller speed of sound will exaggerate the doppler effect. A higher speed of sound will reduce the doppler effect. Speed of sound has no impact on distance attenuation.

Expand image See Also

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance Class

SoundEffectInstance Class
See Also Members
CollapseAll image

Provides a single playing, paused, or stopped instance of a SoundEffect sound.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class SoundEffectInstance : IDisposable

Expand image Remarks

You can create a SoundEffectInstance by calling SoundEffect.CreateInstance. Initially, the SoundEffectInstance is created as stopped, but you can play it by calling Play.

You can modify the volume, panning, and pitch of the SoundEffectInstance by setting the Volume, Pitch, and Pan properties.

On Zune, a game can have a maximum of 16 total playing SoundEffectInstance instances at one time, combined across all loaded SoundEffect objects. The only limit to the total number of loaded SoundEffectInstance and SoundEffect objects is available memory. However, the user can play only 16 sound effects at one time. Attempts to play a SoundEffectInstance beyond this limit will fail. On Windows, there is no hard limit. Playing too many instances can lead to performance degradation. On Xbox 360, the limit is 300 sound effect instances loaded or playing. Dispose of old instances if you need more.

Note
Unlike other platforms, the Xbox 360 has a limit to how many sound effect instances can exist in memory at one time.

Expand image See Also

Reference

SoundEffect.Play Method
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance Members

SoundEffectInstance Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the SoundEffectInstance type.

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | IsLooped | Gets a value that indicates whether looping is enabled for the SoundEffectInstance.
Public Property | Pan | Gets or sets the panning for the SoundEffectInstance.
Public Property | Pitch | Gets or sets the pitch adjustment for the SoundEffectInstance.
Public Property | State | Gets the current state (playing, paused, or stopped) of the SoundEffectInstance.
Public Property | Volume | Gets or sets the volume of the SoundEffectInstance.

Expand image Public Methods

 | Name | Description
Public Method | Apply3D | Overloaded. Applies 3D position to the sound.
Public Method | Dispose | Overloaded. Overloads for releasing the resources held by a SoundEffectInstance.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Pause | Pauses a SoundEffectInstance.
Public Method | Play | Plays or resumes a SoundEffectInstance.
Public Method | Resume | Resumes playback for a SoundEffectInstance.
Public Method | Stop | Overloaded. Stops playing a SoundEffectInstance.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Releases unmanaged resources and performs other cleanup operations before the SoundEffectInstance is reclaimed by garbage collection.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SoundEffectInstance Class
Microsoft.Xna.Framework.Audio Namespace


SoundEffectInstance Methods

SoundEffectInstance Methods

Expand image Public Methods

 | Name | Description
Public Method | Apply3D | Overloaded. Applies 3D position to the sound.
Public Method | Dispose | Overloaded. Overloads for releasing the resources held by a SoundEffectInstance.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Pause | Pauses a SoundEffectInstance.
Public Method | Play | Plays or resumes a SoundEffectInstance.
Public Method | Resume | Resumes playback for a SoundEffectInstance.
Public Method | Stop | Overloaded. Stops playing a SoundEffectInstance.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Releases unmanaged resources and performs other cleanup operations before the SoundEffectInstance is reclaimed by garbage collection.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SoundEffectInstance Class
Microsoft.Xna.Framework.Audio Namespace


SoundEffectInstance.Apply3D Method

SoundEffectInstance.Apply3D Method

Applies 3D position to the sound.

Expand image Overload List

Name | Description
SoundEffectInstance.Apply3D (AudioListener, AudioEmitter) | Applies 3D positioning to the sound using a single listener.
SoundEffectInstance.Apply3D (AudioListener[], AudioEmitter) | Applies 3D position to the sound using multiple listeners.

Expand image See Also

Tasks

Playing a Sound
Looping a Sound
Adjusting Pitch and Volume
Applying a 3D Positional Effect to a Sound

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace


SoundEffectInstance.Apply3D Method (AudioListener, AudioEmitter)

SoundEffectInstance.Apply3D Method (AudioListener, AudioEmitter)
See Also
CollapseAll image

Applies 3D positioning to the sound using a single listener.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Apply3D (
         AudioListener listener,
         AudioEmitter emitter
)

Parameters

listener
Position of the listener.
emitter
Position of the emitter.

Expand image See Also

Tasks

Playing a Sound
Looping a Sound
Adjusting Pitch and Volume
Applying a 3D Positional Effect to a Sound

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Apply3D Method (AudioListener[], AudioEmitter)

SoundEffectInstance.Apply3D Method (AudioListener[], AudioEmitter)
See Also
CollapseAll image

Applies 3D position to the sound using multiple listeners.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Apply3D (
         AudioListener[] listeners,
         AudioEmitter emitter
)

Parameters

listeners
Positions of each listener.
emitter
Position of the emitter.

Expand image See Also

Tasks

Playing a Sound
Looping a Sound
Adjusting Pitch and Volume
Applying a 3D Positional Effect to a Sound

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Dispose Method

SoundEffectInstance.Dispose Method

Overloads for releasing the resources held by a SoundEffectInstance.

Expand image Overload List

Name | Description
SoundEffectInstance.Dispose () | Releases unmanaged resources held by this SoundEffectInstance.
SoundEffectInstance.Dispose (Boolean) | Releases the unmanaged resources held by this SoundEffectInstance, and optionally releases the managed resources.

Expand image See Also

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace


SoundEffectInstance.Dispose Method ()

SoundEffectInstance.Dispose Method ()
See Also
CollapseAll image

Releases unmanaged resources held by this SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Dispose Method (Boolean)

SoundEffectInstance.Dispose Method (Boolean)
See Also
CollapseAll image

Releases the unmanaged resources held by this SoundEffectInstance, and optionally releases the managed resources.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool disposing
)

Parameters

disposing
Pass true to release both the managed and unmanaged resources for this SoundEffectInstance. Passing false releases only the unmanaged resources.

Expand image See Also

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Finalize Method

SoundEffectInstance.Finalize Method

Releases unmanaged resources and performs other cleanup operations before the SoundEffectInstance is reclaimed by garbage collection.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image Remarks

This method overrides Finalize System.Object.Finalize. Application code should not call this method. The object's Finalize method is automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by the garbage collector.

For more information, see Finalize Methods and Destructors, Cleaning Up Unmanaged Resources, and Overriding the Finalize Method.

Expand image See Also

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Pause Method

SoundEffectInstance.Pause Method

Pauses a SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Pause ()

Expand image Remarks

To resume a paused SoundEffectInstance, call Play.

Expand image See Also

Reference

SoundEffectInstance.Play Method
SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Play Method

SoundEffectInstance.Play Method

Plays or resumes a SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public virtual void Play ()

Expand image Remarks

If the SoundEffectInstance is paused, Play resumes playing it at the last played position. If the SoundEffectInstance is stopped, Play begins to play it.

On Zune, a game can have a maximum of 16 total playing SoundEffectInstance instances at one time, combined across all loaded SoundEffect objects. The only limit to the total number of loaded SoundEffectInstance and SoundEffect objects is available memory. However, the user can play only 16 sound effects at one time. Attempts to play a SoundEffectInstance beyond this limit will fail. On Windows, there is no hard limit. Playing too many instances can lead to performance degradation. On Xbox 360, the limit is 300 sound effect instances loaded or playing. Dispose of old instances if you need more.

Expand image See Also

Reference

SoundEffectInstance.Stop Method
SoundEffectInstance.Pause Method
SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Resume Method

SoundEffectInstance.Resume Method

Resumes playback for a SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Resume ()

Expand image See Also

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Stop Method

SoundEffectInstance.Stop Method

Stops playing a SoundEffectInstance.

Expand image Overload List

Name | Description
SoundEffectInstance.Stop () | Immediately stops playing a SoundEffectInstance.
SoundEffectInstance.Stop (Boolean) | Stops playing a SoundEffectInstance, either immediately or as authored.

Expand image See Also

Reference

SoundEffectInstance.Play Method
SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace


SoundEffectInstance.Stop Method ()

SoundEffectInstance.Stop Method ()
See Also
CollapseAll image

Immediately stops playing a SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Stop ()

Expand image See Also

Reference

SoundEffectInstance.Play Method
SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Stop Method (Boolean)

SoundEffectInstance.Stop Method (Boolean)
See Also
CollapseAll image

Stops playing a SoundEffectInstance, either immediately or as authored.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Stop (
         bool immediate
)

Parameters

immediate
Whether to stop playing immediately, or to break out of the loop region and play the release. Specify true to stop playing immediately, or false to break out of the loop region and play the release phase (the remainder of the sound).

Expand image See Also

Reference

SoundEffectInstance.Play Method
SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance Properties

SoundEffectInstance Properties

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | IsLooped | Gets a value that indicates whether looping is enabled for the SoundEffectInstance.
Public Property | Pan | Gets or sets the panning for the SoundEffectInstance.
Public Property | Pitch | Gets or sets the pitch adjustment for the SoundEffectInstance.
Public Property | State | Gets the current state (playing, paused, or stopped) of the SoundEffectInstance.
Public Property | Volume | Gets or sets the volume of the SoundEffectInstance.

Expand image See Also

Reference

SoundEffectInstance Class
Microsoft.Xna.Framework.Audio Namespace


SoundEffectInstance.IsDisposed Property

SoundEffectInstance.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.IsLooped Property

SoundEffectInstance.IsLooped Property

Gets a value that indicates whether looping is enabled for the SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public virtual bool IsLooped { get; set; }

Property Value

true if the SoundEffectInstance has looping enabled; otherwise, false.

Expand image Remarks

If you want to make a sound play continuously until stopped, be sure to set IsLooped to true before you call SoundEffect.Play.

Expand image See Also

Tasks

Looping a Sound

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Pan Property

SoundEffectInstance.Pan Property

Gets or sets the panning for the SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Pan { get; set; }

Property Value

Panning, ranging from -1.0f (full left) to 1.0f (full right). 0.0f is centered.

Expand image See Also

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Pitch Property

SoundEffectInstance.Pitch Property

Gets or sets the pitch adjustment for the SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Pitch { get; set; }

Property Value

Pitch adjustment, ranging from -1.0f (down one octave) to 1.0f (up one octave). 0.0f is unity (normal) pitch.

Expand image See Also

Tasks

Adjusting Pitch and Volume

Reference

SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.State Property

SoundEffectInstance.State Property

Gets the current state (playing, paused, or stopped) of the SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public SoundState State { get; }

Property Value

SoundState that represents the current state of the SoundEffectInstance.

Expand image See Also

Reference

SoundState Enumeration
SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundEffectInstance.Volume Property

SoundEffectInstance.Volume Property

Gets or sets the volume of the SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Volume { get; set; }

Property Value

Volume, ranging from 0.0f (silence) to 1.0f (full volume). 1.0f is full volume relative to SoundEffect.MasterVolume.

Expand image See Also

Tasks

Adjusting Pitch and Volume

Reference

SoundEffect.MasterVolume Property
SoundEffectInstance Class
SoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SoundState Enumeration

SoundState Enumeration

Current state (playing, paused, or stopped) of a SoundEffectInstance.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum SoundState

Expand image Members

Member name | Description
Paused | The SoundEffectInstance is paused.
Playing | The SoundEffectInstance is playing.
Stopped | The SoundEffectInstance is stopped.

Expand image See Also

Reference

SoundEffectInstance Class
SoundEffectInstance.Play Method
SoundEffectInstance.Pause Method
SoundEffectInstance.Stop Method
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


WaveBank Class

WaveBank Class
See Also Members
CollapseAll image

Represents a wave bank, which is a collection of wave files.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class WaveBank : IDisposable

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

WaveBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WaveBank Members

WaveBank Members
See Also Constructors Events Methods Properties
CollapseAll image

The following tables list the members exposed by the WaveBank type.

Expand image Public Constructors

 | Name | Description
Public Method | WaveBank | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | IsInUse | Returns whether the wave bank is currently in use.
Public Property | IsPrepared | Returns whether the wave bank is prepared to play.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Expand image See Also

Tasks

Playing Sounds from an XACT Project
Pausing a Sound (XACT)

Concepts

Sounds Overview

Reference

WaveBank Class
Microsoft.Xna.Framework.Audio Namespace


WaveBank Constructor

WaveBank Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
WaveBank (AudioEngine, String) | Initializes a new, in-memory instance of this class using a specified AudioEngine and path to a wave bank file.
WaveBank (AudioEngine, String, Int32, Int16) | Initializes a new, streaming instance of this class, using a provided AudioEngine and streaming wave bank parameters.

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace


WaveBank Constructor (AudioEngine, String)

WaveBank Constructor (AudioEngine, String)
See Also
CollapseAll image

Initializes a new, in-memory instance of this class using a specified AudioEngine and path to a wave bank file.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public WaveBank (
         AudioEngine audioEngine,
         string nonStreamingWaveBankFilename
)

Parameters

audioEngine
Instance of an AudioEngine to associate this wave bank with.
nonStreamingWaveBankFilename
Path to the wave bank file to load.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The audioEngine or nonStreamingWaveBankFilename parameter is null.
InvalidOperationException | Unable to create the WaveBank resource.

Expand image Remarks

This constructor generates an in-memory version of a wave bank. The entire wave bank contents are held in memory.

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WaveBank Constructor (AudioEngine, String, Int32, Int16)

WaveBank Constructor (AudioEngine, String, Int32, Int16)
See Also
CollapseAll image

Initializes a new, streaming instance of this class, using a provided AudioEngine and streaming wave bank parameters.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public WaveBank (
         AudioEngine audioEngine,
         string streamingWaveBankFilename,
         int offset,
         short packetsize
)

Parameters

audioEngine
Instance of an AudioEngine to associate this wave bank with.
streamingWaveBankFilename
Path to the wave bank file to stream from.
offset
Offset within the wave bank data file. This offset must be DVD sector aligned.
packetsize
Stream packet size, in sectors, to use for each stream. The minimum value is 2.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The audioEngine or nonStreamingWaveBankFilename parameter is null.
InvalidOperationException | Unable to create the WaveBank resource.

Expand image Remarks

This constructor constructs a streaming wave bank whose contents are streamed from storage as needed.

When setting packetsize, note that the size of a DVD sector is 2,048 bytes. Therefore, setting this value to 2 would result in a packet size of 4,096 bytes. Setting it to 3 would specify packets of 6,144 bytes, setting it to 4 would specify packets of 8,192 bytes, and so on. The optimal DVD size is a multiple of 16 (1 DVD block = 16 DVD sectors).

After creating a streaming wave bank, you must call Update at least once from the AudioEngine that was used to create the streaming wave bank before attempting to play a wave from the wave bank. This properly prepares the wave bank for use. Attempts to play waves out of any wave bank before the wave bank is prepared will result in an error.

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WaveBank Methods

WaveBank Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

WaveBank Class
Microsoft.Xna.Framework.Audio Namespace


WaveBank.Dispose Method

WaveBank.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
WaveBank.Dispose () | Immediately releases the unmanaged resources used by this object.
WaveBank.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace


WaveBank.Dispose Method ()

WaveBank.Dispose Method ()
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WaveBank.Dispose Method (Boolean)

WaveBank.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool disposing
)

Parameters

disposing
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WaveBank.Finalize Method

WaveBank.Finalize Method

Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WaveBank Properties

WaveBank Properties

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | IsInUse | Returns whether the wave bank is currently in use.
Public Property | IsPrepared | Returns whether the wave bank is prepared to play.

Expand image See Also

Reference

WaveBank Class
Microsoft.Xna.Framework.Audio Namespace


WaveBank.IsDisposed Property

WaveBank.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WaveBank.IsInUse Property

WaveBank.IsInUse Property

Returns whether the wave bank is currently in use.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsInUse { get; }

Property Value

true if the wave bank is in use; false otherwise.

Expand image Remarks

This value will return true if the wave bank is currently referenced by at least one valid cue instance or other client. For example, the game itself might reference the wave bank.

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WaveBank.IsPrepared Property

WaveBank.IsPrepared Property

Returns whether the wave bank is prepared to play.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsPrepared { get; }

Property Value

true if the wave bank is prepared; false otherwise.

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WaveBank Events

WaveBank Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Expand image See Also

Reference

WaveBank Class
Microsoft.Xna.Framework.Audio Namespace


WaveBank.Disposing Event

WaveBank.Disposing Event

Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime (CLR).

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Disposing

Expand image See Also

Reference

WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Microsoft.Xna.Framework.Content Namespace

Microsoft.Xna.Framework.Content Namespace

Contains the run-time components of the Content Pipeline.

Expand image Classes

 | Name | Description
Public Class | ContentLoadException | Exception used to report errors from the ContentManager.Load method.
Public Class | ContentManager | The ContentManager is the run-time component which loads managed objects from the binary files produced by the design time content pipeline. It also manages the lifespan of the loaded objects, disposing the content manager will also dispose any assets which are themselves IDisposable.
Public Class | ContentReader | A worker object that implements most of ContentManager.Load. A new ContentReader is constructed for each asset loaded.
Public Class | ContentSerializerAttribute | A custom Attribute that marks a field or property to control how it is serialized or to indicate that protected or private data should be included in serialization.
Public Class | ContentSerializerCollectionItemNameAttribute | A custom Attribute that marks a collection class to specify the XML element name for each item in the collection.
Public Class | ContentSerializerIgnoreAttribute | A custom Attribute that marks public fields or properties to prevent them from being serialized.
Public Class | ContentSerializerRuntimeTypeAttribute | A custom Attribute that specifies the corresponding run-time type of this object.
Public Class | ContentSerializerTypeVersionAttribute | A custom Attribute that specifies the corresponding run-time type version of this object.
Public Class | ContentTypeReader | Worker for reading a specific managed type from a binary format. Derive from this class to add new data types to the content pipeline system.
Public Class | ContentTypeReader | Worker for reading a specific managed type from a binary format.
Public Class | ContentTypeReaderManager | A manager that constructs and keeps track of type reader objects.
Public Class | ResourceContentManager | Subclass of ContentManager, which is specialized to read from .resx resource files rather than directly from individual files on disk.

Expand image See Also

Tasks

Concepts

Adding Content to a Game
What Is Content?


ContentLoadException Class

ContentLoadException Class
See Also Members
CollapseAll image

Exception used to report errors from the ContentManager.Load method.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[SerializableAttribute]
public class ContentLoadException : Exception

Expand image See Also

Reference

ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace

Programming Guide

Adding Content to a Game

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentLoadException Members

ContentLoadException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the ContentLoadException type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentLoadException | Overloaded. Creates a new instance of ContentLoadException.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentLoadException Class
Microsoft.Xna.Framework.Content Namespace


ContentLoadException Constructor

ContentLoadException Constructor

Creates a new instance of ContentLoadException.

Expand image Overload List

Name | Description
ContentLoadException () | Creates a new instance of ContentLoadException.
ContentLoadException (SerializationInfo, StreamingContext) | Creates a new instance of ContentLoadException.
ContentLoadException (String) | Creates a new instance of ContentLoadException.
ContentLoadException (String, Exception) | Creates a new instance of ContentLoadException.

Expand image See Also

Reference

ContentLoadException Class
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace


ContentLoadException Constructor ()

ContentLoadException Constructor ()
See Also
CollapseAll image

Creates a new instance of ContentLoadException.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentLoadException ()

Expand image See Also

Reference

ContentLoadException Class
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentLoadException Constructor (SerializationInfo, StreamingContext)

ContentLoadException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Note
This constructor is available only when developing for Windows.
Creates a new instance of ContentLoadException.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected ContentLoadException (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
Describes the value types that were being loaded when the exception occurred.
context
Describes the stream where the exception occurred.

Expand image See Also

Reference

ContentLoadException Class
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


ContentLoadException Constructor (String)

ContentLoadException Constructor (String)
See Also
CollapseAll image

Creates a new instance of ContentLoadException.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentLoadException (
         string message
)

Parameters

message
A message that describes the error.

Expand image See Also

Reference

ContentLoadException Class
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentLoadException Constructor (String, Exception)

ContentLoadException Constructor (String, Exception)
See Also
CollapseAll image

Creates a new instance of ContentLoadException.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentLoadException (
         string message,
         Exception innerException
)

Parameters

message
A message that describes the error.
innerException
The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Expand image See Also

Reference

ContentLoadException Class
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentLoadException Methods

ContentLoadException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentLoadException Class
Microsoft.Xna.Framework.Content Namespace


ContentLoadException Properties

ContentLoadException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

ContentLoadException Class
Microsoft.Xna.Framework.Content Namespace


ContentManager Class

ContentManager Class
See Also Members
CollapseAll image

The ContentManager is the run-time component which loads managed objects from the binary files produced by the design time content pipeline. It also manages the lifespan of the loaded objects, disposing the content manager will also dispose any assets which are themselves IDisposable.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class ContentManager : IDisposable

Expand image See Also

Reference

ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Programming Guide

Adding Content to a Game

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentManager Members

ContentManager Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the ContentManager type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentManager | Overloaded. Initializes a new instance of ContentManager.

Expand image Public Properties

 | Name | Description
Public Property | RootDirectory | Gets or sets the root directory associated with this ContentManager.
Public Property | ServiceProvider | Gets the service provider associated with the ContentManager.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Releases the resources used by the ContentManager class.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Load | Loads an asset that has been processed by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)
Public Method | Unload | Disposes all data that was loaded by this ContentManager.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OpenStream | Opens a stream for reading the specified asset. Derived classes can replace this to implement pack files or asset compression.
Protected Method | ReadAsset | Low-level worker method that reads asset data.

Expand image See Also

Reference

ContentManager Class
Microsoft.Xna.Framework.Content Namespace


ContentManager Constructor

ContentManager Constructor

Initializes a new instance of ContentManager.

Expand image Overload List

Name | Description
ContentManager (IServiceProvider) | Initializes a new instance of ContentManager.
ContentManager (IServiceProvider, String) | Initializes a new instance of ContentManager.

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace


ContentManager Constructor (IServiceProvider)

ContentManager Constructor (IServiceProvider)
See Also Example
CollapseAll image

Initializes a new instance of ContentManager.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentManager (
         IServiceProvider serviceProvider
)

Parameters

serviceProvider
The service provider that the ContentManager should use to locate services.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The serviceProvider parameter is null.

Expand image Remarks

Caution

When creating a new ContentManager, if no instance of Game is otherwise required by the application, it is often better to create a new class that implements the IServiceProvider interface rather than creating an instance of Game just to create a new instance of GraphicsDeviceManager.

By default, the ContentManager searches for content in the directory where the executable is located.

Expand image Example

To create a ContentManager that uses Game.Services:

C#
ContentManager contentManager = new ContentManager( Services );

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentManager Constructor (IServiceProvider, String)

ContentManager Constructor (IServiceProvider, String)
See Also Example
CollapseAll image

Initializes a new instance of ContentManager.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentManager (
         IServiceProvider serviceProvider,
         string rootDirectory
)

Parameters

serviceProvider
The service provider the ContentManager should use to locate services.
rootDirectory
The root directory to search for content.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | The serviceProvider or rootDirectory parameter is null.

Expand image Remarks

Caution

When creating a new ContentManager, if no instance of Game is otherwise required by the application, it is often better to create a new class that implements the IServiceProvider interface rather than creating an instance of Game just to create a new instance of GraphicsDeviceManager.

Expand image Example

To create a ContentManager that uses Game.Services and searches for resources from the root of the C: drive:

C#
ContentManager contentManager = new ContentManager( Services, "C:\\" );

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentManager Methods

ContentManager Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Releases the resources used by the ContentManager class.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Load | Loads an asset that has been processed by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)
Public Method | Unload | Disposes all data that was loaded by this ContentManager.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OpenStream | Opens a stream for reading the specified asset. Derived classes can replace this to implement pack files or asset compression.
Protected Method | ReadAsset | Low-level worker method that reads asset data.

Expand image See Also

Reference

ContentManager Class
Microsoft.Xna.Framework.Content Namespace


ContentManager.Dispose Method

ContentManager.Dispose Method

Releases the resources used by the ContentManager class.

Expand image Overload List

Name | Description
ContentManager.Dispose () | Releases all resources used by the ContentManager class.
ContentManager.Dispose (Boolean) | Releases the unmanaged resources used by the ContentManager and optionally releases the managed resources.

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace


ContentManager.Dispose Method ()

ContentManager.Dispose Method ()
See Also
CollapseAll image

Releases all resources used by the ContentManager class.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentManager.Dispose Method (Boolean)

ContentManager.Dispose Method (Boolean)
See Also
CollapseAll image

Releases the unmanaged resources used by the ContentManager and optionally releases the managed resources.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool disposing
)

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentManager.Load Generic Method

ContentManager.Load Generic Method
See Also Example
CollapseAll image

Loads an asset that has been processed by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public virtual T Load<T> (
         string assetName
)

Type Parameters

T
The type of asset to load. Model, Effect, SpriteFont, Texture, Texture2D, and TextureCube are all supported by default by the standard Content Pipeline processor, but additional types may be loaded by extending the processor.

Parameters

assetName
Asset name, relative to the loader root directory, and not including the .xnb extension.

Return Value

The loaded asset. Repeated calls to load the same asset will return the same object instance.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | Load was called after the ContentManager was disposed.
ArgumentNullException | The assetName argument is null.
ContentLoadException | The type of the assetName in the file does not match the type of asset requested as specified by T.

Expand image Remarks

Before a ContentManager can load an asset, you need to add the asset to your game project using the steps described in How to: Add Game Assets to a Content Project.

The following are the Content Pipeline run-time classes supported by Load and the file formats they are associated with.

Effect Class | .fx
Model Class | .fbx, .x
SpriteFont Class

.bmp, .spritefont, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga

Note
The default content processor for .bmp files is the texture processor. To process a .bmp file for use as a Sprite Font, click Sprite Font Texture - XNA Framework in the Properties pane for the .bmp file after it is added to the project.
Texture Class, Texture2D Class | .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga
TextureCube Class | .dds

Note that these are the formats of the original assets; after processing, all assets will be .xnb files.

Expand image Example

To load a Model from the directory .\content\models\ with the asset name of "box":

C#
Model model = contentManager.Load<Model>( ".\\content\\models\\box" );

Expand image See Also

Tasks

How to:Add a Resource

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentManager.OpenStream Method

ContentManager.OpenStream Method

Opens a stream for reading the specified asset. Derived classes can replace this to implement pack files or asset compression.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected virtual Stream OpenStream (
         string assetName
)

Parameters

assetName
The name of the asset being read.

Return Value

The opened stream.

Expand image Exceptions

Exception type | Condition
ContentLoadException | Unable to open the file containing assetName, or the file was not found.

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentManager.ReadAsset Generic Method

ContentManager.ReadAsset Generic Method

Low-level worker method that reads asset data.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected T ReadAsset<T> (
         string assetName,
         Action<IDisposable> recordDisposableObject
)

Type Parameters

T
Type of the asset specified for loading.

Parameters

assetName
The name of the asset to be loaded from disk.
recordDisposableObject
Delegate function for handling the disposition of assets. If recordDisposableObject is null, the default lifespan tracking and management is used, so unloading or disposing of the content manager frees everything that has been loaded through it. If recordDisposableObject specifies a valid delegate, that delegate is used instead of the default lifespan tracking and is called every time the loader encounters a type that implements IDisposable. You must use your own code to unload assets loaded in this fashion, since ContentManager's Unload method will not be aware of them.

Return Value

Returns the loaded asset.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | ReadAsset was called after the ContentManager was disposed.
ArgumentNullException | The assetName argument is null.

Expand image Remarks

This protected method loads an .xnb file from disk. Unlike ContentManager's public Load method, it always returns a new copy of the specified asset, even if the asset has been loaded previously.

You can customize how shared assets are managed by overriding ContentManager's Load method. In your own Load method, keep track of what has been loaded, and call ReadAsset when you need a new asset from disk.

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentManager.Unload Method

ContentManager.Unload Method

Disposes all data that was loaded by this ContentManager.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public virtual void Unload ()

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | Unload was called after the ContentManager was disposed.

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentManager Properties

ContentManager Properties

Expand image Public Properties

 | Name | Description
Public Property | RootDirectory | Gets or sets the root directory associated with this ContentManager.
Public Property | ServiceProvider | Gets the service provider associated with the ContentManager.

Expand image See Also

Reference

ContentManager Class
Microsoft.Xna.Framework.Content Namespace


ContentManager.RootDirectory Property

ContentManager.RootDirectory Property

Gets or sets the root directory associated with this ContentManager.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string RootDirectory { get; set; }

Property Value

The root directory associated with this ContentManager.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | RootDirectory cannot be null.
InvalidOperationException | This property cannot be changed after content has been loaded into the ContentManager.

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentManager.ServiceProvider Property

ContentManager.ServiceProvider Property

Gets the service provider associated with the ContentManager.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public IServiceProvider ServiceProvider { get; }

Property Value

The service provider associated with the ContentManager.

Expand image See Also

Reference

ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader Class

ContentReader Class
See Also Members
CollapseAll image

A worker object that implements most of ContentManager.Load. A new ContentReader is constructed for each asset loaded.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class ContentReader : BinaryReader

Expand image See Also

Reference

ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Programming Guide

Adding Content to a Game

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader Members

ContentReader Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the ContentReader type.

Expand image Public Properties

 | Name | Description
Public Property | AssetName | Gets the name of the asset currently being read by this ContentReader.
Public Property | BaseStream | (Inherited from BinaryReader.)
Public Property | ContentManager | Gets the ContentManager associated with the ContentReader.

Expand image Public Methods

 | Name | Description
Public Method | Close | (Inherited from BinaryReader.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | PeekChar | (Inherited from BinaryReader.)
Public Method | Read | (Overloaded. Inherited from BinaryReader.)
Public Method | ReadBoolean | (Inherited from BinaryReader.)
Public Method | ReadByte | (Inherited from BinaryReader.)
Public Method | ReadBytes | (Inherited from BinaryReader.)
Public Method | ReadChar | (Inherited from BinaryReader.)
Public Method | ReadChars | (Inherited from BinaryReader.)
Public Method | ReadColor | Reads a Color value from the currently open stream.
Public Method | ReadDouble | Reads a double value from the currently open stream.
Public Method | ReadExternalReference | Reads a link to an external file.
Public Method | ReadInt16 | (Inherited from BinaryReader.)
Public Method | ReadInt32 | (Inherited from BinaryReader.)
Public Method | ReadInt64 | (Inherited from BinaryReader.)
Public Method | ReadMatrix | Reads a Matrix value from the currently open stream.
Public Method | ReadObject | Overloaded. Reads a single managed object from the current stream. Can be called recursively.
Public Method | ReadQuaternion | Reads a Quaternion value from the current stream.
Public Method | ReadRawObject | Overloaded. Reads a single managed object from the current stream as an instance of the specified type. If a base class of the actual object type is specified only data from the base type will be read.
Public Method | ReadSByte | (Inherited from BinaryReader.)
Public Method | ReadSharedResource | Reads a shared resource ID, and records it for subsequent fix-up.
Public Method | ReadSingle | Reads a float value from the currently open stream.
Public Method | ReadString | (Inherited from BinaryReader.)
Public Method | ReadUInt16 | (Inherited from BinaryReader.)
Public Method | ReadUInt32 | (Inherited from BinaryReader.)
Public Method | ReadUInt64 | (Inherited from BinaryReader.)
Public Method | ReadVector2 | Reads a Vector2 value from the current stream.
Public Method | ReadVector3 | Reads a Vector3 value from the current stream.
Public Method | ReadVector4 | Reads a Vector4 value from the current stream.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from BinaryReader.)
Protected Method | FillBuffer | (Inherited from BinaryReader.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentReader Class
Microsoft.Xna.Framework.Content Namespace


ContentReader Methods

ContentReader Methods

Expand image Public Methods

 | Name | Description
Public Method | Close | (Inherited from BinaryReader.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | PeekChar | (Inherited from BinaryReader.)
Public Method | Read | (Overloaded. Inherited from BinaryReader.)
Public Method | ReadBoolean | (Inherited from BinaryReader.)
Public Method | ReadByte | (Inherited from BinaryReader.)
Public Method | ReadBytes | (Inherited from BinaryReader.)
Public Method | ReadChar | (Inherited from BinaryReader.)
Public Method | ReadChars | (Inherited from BinaryReader.)
Public Method | ReadColor | Reads a Color value from the currently open stream.
Public Method | ReadDouble | Reads a double value from the currently open stream.
Public Method | ReadExternalReference | Reads a link to an external file.
Public Method | ReadInt16 | (Inherited from BinaryReader.)
Public Method | ReadInt32 | (Inherited from BinaryReader.)
Public Method | ReadInt64 | (Inherited from BinaryReader.)
Public Method | ReadMatrix | Reads a Matrix value from the currently open stream.
Public Method | ReadObject | Overloaded. Reads a single managed object from the current stream. Can be called recursively.
Public Method | ReadQuaternion | Reads a Quaternion value from the current stream.
Public Method | ReadRawObject | Overloaded. Reads a single managed object from the current stream as an instance of the specified type. If a base class of the actual object type is specified only data from the base type will be read.
Public Method | ReadSByte | (Inherited from BinaryReader.)
Public Method | ReadSharedResource | Reads a shared resource ID, and records it for subsequent fix-up.
Public Method | ReadSingle | Reads a float value from the currently open stream.
Public Method | ReadString | (Inherited from BinaryReader.)
Public Method | ReadUInt16 | (Inherited from BinaryReader.)
Public Method | ReadUInt32 | (Inherited from BinaryReader.)
Public Method | ReadUInt64 | (Inherited from BinaryReader.)
Public Method | ReadVector2 | Reads a Vector2 value from the current stream.
Public Method | ReadVector3 | Reads a Vector3 value from the current stream.
Public Method | ReadVector4 | Reads a Vector4 value from the current stream.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from BinaryReader.)
Protected Method | FillBuffer | (Inherited from BinaryReader.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentReader Class
Microsoft.Xna.Framework.Content Namespace


ContentReader.ReadColor Method

ContentReader.ReadColor Method

Reads a Color value from the currently open stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Color ReadColor ()

Return Value

The Color value that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadDouble Method

ContentReader.ReadDouble Method

Reads a double value from the currently open stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override double ReadDouble ()

Return Value

The double value that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadExternalReference Generic Method

ContentReader.ReadExternalReference Generic Method

Reads a link to an external file.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public T ReadExternalReference<T> ()

Type Parameters

T
The type of asset stored in the external file.

Return Value

The asset stored in the external file.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadMatrix Method

ContentReader.ReadMatrix Method

Reads a Matrix value from the currently open stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Matrix ReadMatrix ()

Return Value

The Matrix that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadObject Method

ContentReader.ReadObject Method

Reads a single managed object from the current stream. Can be called recursively.

Expand image Overload List

Name | Description
ContentReader.ReadObject () | Reads a single managed object from the current stream. Can be called recursively.
ContentReader.ReadObject (ContentTypeReader) | Reads a single managed object from the current stream. Can be called recursively.
ContentReader.ReadObject (ContentTypeReader, T) | Reads a single managed object from the current stream. Can be called recursively.
ContentReader.ReadObject (T) | Reads a single managed object from the current stream. Can be called recursively.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace


ContentReader.ReadObject Generic Method ()

ContentReader.ReadObject Generic Method ()
See Also
CollapseAll image

Reads a single managed object from the current stream. Can be called recursively.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public T ReadObject<T> ()

Type Parameters

T
The type of object to read.

Return Value

The object that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadObject Generic Method (ContentTypeReader)

ContentReader.ReadObject Generic Method (ContentTypeReader)
See Also
CollapseAll image

Reads a single managed object from the current stream. Can be called recursively.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public T ReadObject<T> (
         ContentTypeReader typeReader
)

Type Parameters

T
The type of object to read.

Parameters

typeReader
The ContentTypeReader to use to read the object.

Return Value

The object that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadObject Generic Method (ContentTypeReader, T)

ContentReader.ReadObject Generic Method (ContentTypeReader, T)
See Also
CollapseAll image

Reads a single managed object from the current stream. Can be called recursively.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public T ReadObject<T> (
         ContentTypeReader typeReader,
         T existingInstance
)

Type Parameters

T
The type of object to read.

Parameters

typeReader
The ContentTypeReader to use to read the object.
existingInstance
An existing object to write into.

Return Value

The object that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadObject Generic Method (T)

ContentReader.ReadObject Generic Method (T)
See Also
CollapseAll image

Reads a single managed object from the current stream. Can be called recursively.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public T ReadObject<T> (
         T existingInstance
)

Type Parameters

T
The type of object to read.

Parameters

existingInstance
An existing object to write into.

Return Value

The object that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadQuaternion Method

ContentReader.ReadQuaternion Method

Reads a Quaternion value from the current stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Quaternion ReadQuaternion ()

Return Value

The Quaternion that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadRawObject Method

ContentReader.ReadRawObject Method

Reads a single managed object from the current stream as an instance of the specified type. If a base class of the actual object type is specified only data from the base type will be read.

Expand image Overload List

Name | Description
ContentReader.ReadRawObject () | Reads a single managed object from the current stream as an instance of the specified type. If you specify a base class of the actual object type, this method reads data only from the base type.
ContentReader.ReadRawObject (ContentTypeReader) | Reads a single managed object from the current stream as an instance of the specified type. If a base class of the actual object type is specified only data from the base type will be read.
ContentReader.ReadRawObject (ContentTypeReader, T) | Reads a single managed object from the current stream as an instance of the specified type. If you specify a base class of the actual object type, this method reads data only from the base type.
ContentReader.ReadRawObject (T) | Reads a single managed object from the current stream as an instance of the specified type. If you specify a base class of the actual object type, the method reads data only from the base type.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace


ContentReader.ReadRawObject Generic Method ()

ContentReader.ReadRawObject Generic Method ()
See Also
CollapseAll image

Reads a single managed object from the current stream as an instance of the specified type. If you specify a base class of the actual object type, this method reads data only from the base type.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public T ReadRawObject<T> ()

Type Parameters

T
The type of object to read.

Return Value

The object that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadRawObject Generic Method (ContentTypeReader)

ContentReader.ReadRawObject Generic Method (ContentTypeReader)
See Also
CollapseAll image

Reads a single managed object from the current stream as an instance of the specified type. If a base class of the actual object type is specified only data from the base type will be read.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public T ReadRawObject<T> (
         ContentTypeReader typeReader
)

Type Parameters

T
The type of object to read.

Parameters

typeReader
The ContentTypeReader to use to read the object.

Return Value

The object that was read.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | typeReader is null.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadRawObject Generic Method (ContentTypeReader, T)

ContentReader.ReadRawObject Generic Method (ContentTypeReader, T)
See Also
CollapseAll image

Reads a single managed object from the current stream as an instance of the specified type. If you specify a base class of the actual object type, this method reads data only from the base type.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public T ReadRawObject<T> (
         ContentTypeReader typeReader,
         T existingInstance
)

Type Parameters

T
The type of object to read.

Parameters

typeReader
The ContentTypeReader to use to read the object.
existingInstance
An existing object to write into.

Return Value

The object that was read.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | typeReader is null.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadRawObject Generic Method (T)

ContentReader.ReadRawObject Generic Method (T)
See Also
CollapseAll image

Reads a single managed object from the current stream as an instance of the specified type. If you specify a base class of the actual object type, the method reads data only from the base type.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public T ReadRawObject<T> (
         T existingInstance
)

Type Parameters

T
The type of object to read.

Parameters

existingInstance
An existing object to write into.

Return Value

The object that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadSharedResource Generic Method

ContentReader.ReadSharedResource Generic Method

Reads a shared resource ID, and records it for subsequent fix-up.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void ReadSharedResource<T> (
         Action<T> fixup
)

Type Parameters

T
The type of the shared resource.

Parameters

fixup
The fix-up action to perform.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | fixup is null.
ContentLoadException | Error loading the resource.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadSingle Method

ContentReader.ReadSingle Method

Reads a float value from the currently open stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override float ReadSingle ()

Return Value

The float value that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadVector2 Method

ContentReader.ReadVector2 Method

Reads a Vector2 value from the current stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 ReadVector2 ()

Return Value

The Vector2 that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadVector3 Method

ContentReader.ReadVector3 Method

Reads a Vector3 value from the current stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 ReadVector3 ()

Return Value

The Vector3 that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ReadVector4 Method

ContentReader.ReadVector4 Method

Reads a Vector4 value from the current stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ReadVector4 ()

Return Value

The Vector4 that was read.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader Properties

ContentReader Properties

Expand image Public Properties

 | Name | Description
Public Property | AssetName | Gets the name of the asset currently being read by this ContentReader.
Public Property | BaseStream | (Inherited from BinaryReader.)
Public Property | ContentManager | Gets the ContentManager associated with the ContentReader.

Expand image See Also

Reference

ContentReader Class
Microsoft.Xna.Framework.Content Namespace


ContentReader.AssetName Property

ContentReader.AssetName Property

Gets the name of the asset currently being read by this ContentReader.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string AssetName { get; }

Property Value

Name of the asset currently being read by this ContentReader.

Expand image Remarks

AssetName can be useful to include in the exception message if a custom ContentTypeReader encounters an error.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentReader.ContentManager Property

ContentReader.ContentManager Property

Gets the ContentManager associated with the ContentReader.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentManager ContentManager { get; }

Property Value

The ContentManager associated with the ContentReader.

Expand image See Also

Reference

ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerAttribute Class

ContentSerializerAttribute Class
See Also Members
CollapseAll image

A custom Attribute that marks a field or property to control how it is serialized or to indicate that protected or private data should be included in serialization.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[AttributeUsageAttribute(384)]
public sealed class ContentSerializerAttribute : Attribute

Expand image See Also

Reference

ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace

Programming Guide

Adding Content to a Game

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerAttribute Members

ContentSerializerAttribute Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the ContentSerializerAttribute type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentSerializerAttribute | Creates a new instance of ContentSerializerAttribute.

Expand image Public Properties

 | Name | Description
Public Property | AllowNull | Get or set a value indicating whether this member can have a null value (default=true).
Public Property | CollectionItemName | Gets or sets the XML element name for each item in a collection (default = "Item").
Public Property | ElementName | Gets or sets the XML element name (default=name of the managed type member).
Public Property | FlattenContent | Gets or sets a value idicating whether to write member contents directly into the current XML context rather than wrapping the member in a new XML element (default=false).
Public Property | HasCollectionItemName | Indicates whether an explicit CollectionItemName string is being used or the default value.
Public Property | Optional | Indicates whether to write this element if the member is null and skip past it if not found when deserializing XML (default=false).
Public Property | SharedResource | Indicates whether this member is referenced from multiple parents and should be serialized as a unique ID reference (default=false).

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a copy of the ContentSerializerAttribute.
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentSerializerAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerAttribute Constructor

ContentSerializerAttribute Constructor
See Also Example
CollapseAll image

Creates a new instance of ContentSerializerAttribute.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentSerializerAttribute ()

Expand image Example

C#
        [ContentSerializerAttribute()]

Expand image See Also

Reference

ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerAttribute Methods

ContentSerializerAttribute Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a copy of the ContentSerializerAttribute.
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentSerializerAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerAttribute.Clone Method

ContentSerializerAttribute.Clone Method

Creates a copy of the ContentSerializerAttribute.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentSerializerAttribute Clone ()

Return Value

The copy.

Expand image See Also

Reference

ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerAttribute Properties

ContentSerializerAttribute Properties

Expand image Public Properties

 | Name | Description
Public Property | AllowNull | Get or set a value indicating whether this member can have a null value (default=true).
Public Property | CollectionItemName | Gets or sets the XML element name for each item in a collection (default = "Item").
Public Property | ElementName | Gets or sets the XML element name (default=name of the managed type member).
Public Property | FlattenContent | Gets or sets a value idicating whether to write member contents directly into the current XML context rather than wrapping the member in a new XML element (default=false).
Public Property | HasCollectionItemName | Indicates whether an explicit CollectionItemName string is being used or the default value.
Public Property | Optional | Indicates whether to write this element if the member is null and skip past it if not found when deserializing XML (default=false).
Public Property | SharedResource | Indicates whether this member is referenced from multiple parents and should be serialized as a unique ID reference (default=false).

Expand image See Also

Reference

ContentSerializerAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerAttribute.AllowNull Property

ContentSerializerAttribute.AllowNull Property
See Also Example
CollapseAll image

Get or set a value indicating whether this member can have a null value (default=true).

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool AllowNull { get; set; }

Property Value

Value indicating whether this member can have a null value.

Expand image Example

ContentSerializerAttribute with AllowNull set to false.

C#
[ContentSerializerAttribute( AllowNull = false )]

Expand image See Also

Reference

ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerAttribute.CollectionItemName Property

ContentSerializerAttribute.CollectionItemName Property
See Also Example
CollapseAll image

Gets or sets the XML element name for each item in a collection (default = "Item").

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string CollectionItemName { get; set; }

Property Value

The XML element name for each item in the collection.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | CollectionItemName is null.

Expand image Example

ContentSerializerAttribute with CollectionItemName set to the string "PlayerName":

C#
[ContentSerializerAttribute( CollectionItemName = "PlayerName" )]

Expand image See Also

Reference

ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerAttribute.ElementName Property

ContentSerializerAttribute.ElementName Property
See Also Example
CollapseAll image

Gets or sets the XML element name (default=name of the managed type member).

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string ElementName { get; set; }

Property Value

The XML element name.

Expand image Example

ContentSerializerAttribute with ElementName set to the string "PlayerName".

C#
[ContentSerializerAttribute( ElementName = "PlayerName" )]

Expand image See Also

Reference

ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerAttribute.FlattenContent Property

ContentSerializerAttribute.FlattenContent Property
See Also Example
CollapseAll image

Gets or sets a value idicating whether to write member contents directly into the current XML context rather than wrapping the member in a new XML element (default=false).

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool FlattenContent { get; set; }

Property Value

Value idicating whether to write member contents directly into the current XML context rather than wrapping the member in a new XML element.

Expand image Example

ContentSerializerAttribute with FlattenContent set true.

C#
[ContentSerializerAttribute( FlattenContent = true )]

Expand image See Also

Reference

ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerAttribute.HasCollectionItemName Property

ContentSerializerAttribute.HasCollectionItemName Property
See Also Example
CollapseAll image

Indicates whether an explicit CollectionItemName string is being used or the default value.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasCollectionItemName { get; }

Property Value

true if an explicit CollectionItemName string is being used; false otherwise.

Expand image Example

ContentSerializerAttribute with HasCollectionItemName set true.

C#
[ContentSerializerAttribute( HasCollectionItemName = true )]

Expand image See Also

Reference

ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerAttribute.Optional Property

ContentSerializerAttribute.Optional Property
See Also Example
CollapseAll image

Indicates whether to write this element if the member is null and skip past it if not found when deserializing XML (default=false).

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Optional { get; set; }

Property Value

true if the member should be skipped when null.

Expand image Example

ContentSerializerAttribute with Optional set true.

C#
[ContentSerializerAttribute( Optional = true )]

Expand image See Also

Reference

ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerAttribute.SharedResource Property

ContentSerializerAttribute.SharedResource Property
See Also Example
CollapseAll image

Indicates whether this member is referenced from multiple parents and should be serialized as a unique ID reference (default=false).

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool SharedResource { get; set; }

Property Value

true if this member is referenced from multiple parents; false otherwise.

Expand image Example

ContentSerializerAttribute with SharedResource set true.

C#
[ContentSerializerAttribute( SharedResource = true )]

Expand image See Also

Reference

ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerCollectionItemNameAttribute Class

ContentSerializerCollectionItemNameAttribute Class
See Also Members
CollapseAll image

A custom Attribute that marks a collection class to specify the XML element name for each item in the collection.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[AttributeUsageAttribute(4)]
public sealed class ContentSerializerCollectionItemNameAttribute : Attribute

Expand image See Also

Reference

ContentSerializerCollectionItemNameAttribute Members
Microsoft.Xna.Framework.Content Namespace

Programming Guide

Adding Content to a Game

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerCollectionItemNameAttribute Members

ContentSerializerCollectionItemNameAttribute Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the ContentSerializerCollectionItemNameAttribute type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentSerializerCollectionItemNameAttribute | Creates a new instance of ContentSerializerCollectionItemNameAttribute.

Expand image Public Properties

 | Name | Description
Public Property | CollectionItemName | Gets the name that will be used for each item in the collection.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentSerializerCollectionItemNameAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerCollectionItemNameAttribute Constructor

ContentSerializerCollectionItemNameAttribute Constructor
See Also Example
CollapseAll image

Creates a new instance of ContentSerializerCollectionItemNameAttribute.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentSerializerCollectionItemNameAttribute (
         string collectionItemName
)

Parameters

collectionItemName
The name for each item in the collection.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | collectionItemName is null.

Expand image Example

C#
        [ContentSerializerCollectionItemNameAttribute( "CollectionItem" )]

Expand image See Also

Reference

ContentSerializerCollectionItemNameAttribute Class
ContentSerializerCollectionItemNameAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerCollectionItemNameAttribute Methods

ContentSerializerCollectionItemNameAttribute Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentSerializerCollectionItemNameAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerCollectionItemNameAttribute Properties

ContentSerializerCollectionItemNameAttribute Properties

Expand image Public Properties

 | Name | Description
Public Property | CollectionItemName | Gets the name that will be used for each item in the collection.

Expand image See Also

Reference

ContentSerializerCollectionItemNameAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerCollectionItemNameAttribute.CollectionItemName Property

ContentSerializerCollectionItemNameAttribute.CollectionItemName Property
See Also
CollapseAll image

Gets the name that will be used for each item in the collection.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string CollectionItemName { get; }

Property Value

The name used for each item in the collection.

Expand image See Also

Reference

ContentSerializerCollectionItemNameAttribute Class
ContentSerializerCollectionItemNameAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerIgnoreAttribute Class

ContentSerializerIgnoreAttribute Class
See Also Members
CollapseAll image

A custom Attribute that marks public fields or properties to prevent them from being serialized.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[AttributeUsageAttribute(384)]
public sealed class ContentSerializerIgnoreAttribute : Attribute

Expand image See Also

Reference

ContentSerializerIgnoreAttribute Members
Microsoft.Xna.Framework.Content Namespace

Programming Guide

Adding Content to a Game

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerIgnoreAttribute Members

ContentSerializerIgnoreAttribute Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the ContentSerializerIgnoreAttribute type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentSerializerIgnoreAttribute | Creates a new instance of ContentSerializerIgnoreAttribute.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentSerializerIgnoreAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerIgnoreAttribute Constructor

ContentSerializerIgnoreAttribute Constructor
See Also Example
CollapseAll image

Creates a new instance of ContentSerializerIgnoreAttribute.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentSerializerIgnoreAttribute ()

Expand image Example

C#
        [ContentSerializerIgnoreAttribute()]

Expand image See Also

Reference

ContentSerializerIgnoreAttribute Class
ContentSerializerIgnoreAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerIgnoreAttribute Methods

ContentSerializerIgnoreAttribute Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentSerializerIgnoreAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerIgnoreAttribute Properties

ContentSerializerIgnoreAttribute Properties

Expand image See Also

Reference

ContentSerializerIgnoreAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerRuntimeTypeAttribute Class

ContentSerializerRuntimeTypeAttribute Class
See Also Members
CollapseAll image

A custom Attribute that specifies the corresponding run-time type of this object. For more information, see Automatic Serialization of .XNB Files.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class ContentSerializerRuntimeTypeAttribute : Attribute

Expand image Remarks

You can apply multiple instances of this attribute to a single class, thus specifying different strong names for each target platform. If you don't specify the target platform, a single attribute provides a strong name for all platforms.

Expand image See Also

Reference

ContentSerializerRuntimeTypeAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerRuntimeTypeAttribute Members

ContentSerializerRuntimeTypeAttribute Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the ContentSerializerRuntimeTypeAttribute type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentSerializerRuntimeTypeAttribute | Creates a new instance of ContentSerializerRuntimeTypeAttribute.

Expand image Public Properties

 | Name | Description
Public Property | RuntimeType | Gets the run-time type for the object.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentSerializerRuntimeTypeAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerRuntimeTypeAttribute Constructor

ContentSerializerRuntimeTypeAttribute Constructor

Creates a new instance of ContentSerializerRuntimeTypeAttribute.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentSerializerRuntimeTypeAttribute (
         string runtimeType
)

Parameters

runtimeType
The run-time type name of the object.

Expand image See Also

Reference

ContentSerializerRuntimeTypeAttribute Class
ContentSerializerRuntimeTypeAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerRuntimeTypeAttribute Methods

ContentSerializerRuntimeTypeAttribute Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentSerializerRuntimeTypeAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerRuntimeTypeAttribute Properties

ContentSerializerRuntimeTypeAttribute Properties

Expand image Public Properties

 | Name | Description
Public Property | RuntimeType | Gets the run-time type for the object.

Expand image See Also

Reference

ContentSerializerRuntimeTypeAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerRuntimeTypeAttribute.RuntimeType Property

ContentSerializerRuntimeTypeAttribute.RuntimeType Property

Gets the run-time type for the object.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string RuntimeType { get; }

Property Value

The run-time type name of the object.

Expand image See Also

Reference

ContentSerializerRuntimeTypeAttribute Class
ContentSerializerRuntimeTypeAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerTypeVersionAttribute Class

ContentSerializerTypeVersionAttribute Class
See Also Members
CollapseAll image

A custom Attribute that specifies the corresponding run-time type version of this object. For more information, see Automatic Serialization of .XNB Files.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class ContentSerializerTypeVersionAttribute : Attribute

Expand image See Also

Reference

ContentSerializerTypeVersionAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerTypeVersionAttribute Members

ContentSerializerTypeVersionAttribute Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the ContentSerializerTypeVersionAttribute type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentSerializerTypeVersionAttribute | Creates a new instance of ContentSerializerTypeVersionAttribute.

Expand image Public Properties

 | Name | Description
Public Property | TypeVersion | Gets the run-time type version for the object.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentSerializerTypeVersionAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerTypeVersionAttribute Constructor

ContentSerializerTypeVersionAttribute Constructor

Creates a new instance of ContentSerializerTypeVersionAttribute.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentSerializerTypeVersionAttribute (
         int typeVersion
)

Parameters

typeVersion
The run-time type version of the object.

Expand image See Also

Reference

ContentSerializerTypeVersionAttribute Class
ContentSerializerTypeVersionAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentSerializerTypeVersionAttribute Methods

ContentSerializerTypeVersionAttribute Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentSerializerTypeVersionAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerTypeVersionAttribute Properties

ContentSerializerTypeVersionAttribute Properties

Expand image Public Properties

 | Name | Description
Public Property | TypeVersion | Gets the run-time type version for the object.

Expand image See Also

Reference

ContentSerializerTypeVersionAttribute Class
Microsoft.Xna.Framework.Content Namespace


ContentSerializerTypeVersionAttribute.TypeVersion Property

ContentSerializerTypeVersionAttribute.TypeVersion Property

Gets the run-time type version for the object.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int TypeVersion { get; }

Property Value

The run-time type version of the object.

Expand image See Also

Reference

ContentSerializerTypeVersionAttribute Class
ContentSerializerTypeVersionAttribute Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader Class

ContentTypeReader Class
See Also Members
CollapseAll image

Worker for reading a specific managed type from a binary format.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public abstract class ContentTypeReader

Expand image See Also

Reference

ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Programming Guide

Adding Content to a Game

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader Members

ContentTypeReader Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the ContentTypeReader type.

Expand image Protected Constructors

 | Name | Description
Protected Method | ContentTypeReader | Creates a new instance of ContentTypeReader.

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | Determines if deserialization into an existing object is possible.
Public Property | TargetType | Gets the type handled by this reader component.
Public Property | TypeVersion | Gets a format version number for this type.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | Initialize | Retrieves and caches nested type readers. Called by the framework at creation time.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | Read | Reads a strongly typed object from the current stream.

Expand image See Also

Reference

ContentTypeReader Class
Microsoft.Xna.Framework.Content Namespace


ContentTypeReader Constructor

ContentTypeReader Constructor

Creates a new instance of ContentTypeReader.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected ContentTypeReader (
         Type targetType
)

Parameters

targetType
The type handled by this reader component.

Expand image See Also

Reference

ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader Methods

ContentTypeReader Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | Initialize | Retrieves and caches nested type readers. Called by the framework at creation time.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | Read | Reads a strongly typed object from the current stream.

Expand image See Also

Reference

ContentTypeReader Class
Microsoft.Xna.Framework.Content Namespace


ContentTypeReader.Initialize Method

ContentTypeReader.Initialize Method

Retrieves and caches nested type readers. Called by the framework at creation time.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected internal virtual void Initialize (
         ContentTypeReaderManager manager
)

Parameters

manager
The content manager.

Expand image See Also

Reference

ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader.Read Method

ContentTypeReader.Read Method

Reads a strongly typed object from the current stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected internal abstract Object Read (
         ContentReader input,
         Object existingInstance
)

Parameters

input
The ContentReader used to read the object.
existingInstance
The object receiving the data, or null if a new instance of the object should be created.

Return Value

The object that was read.

Expand image See Also

Reference

ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader Properties

ContentTypeReader Properties

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | Determines if deserialization into an existing object is possible.
Public Property | TargetType | Gets the type handled by this reader component.
Public Property | TypeVersion | Gets a format version number for this type.

Expand image See Also

Reference

ContentTypeReader Class
Microsoft.Xna.Framework.Content Namespace


ContentTypeReader.CanDeserializeIntoExistingObject Property

ContentTypeReader.CanDeserializeIntoExistingObject Property

Determines if deserialization into an existing object is possible.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public virtual bool CanDeserializeIntoExistingObject { get; }

Property Value

true if the object can be deserialized into; false otherwise.

Expand image See Also

Reference

ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader.TargetType Property

ContentTypeReader.TargetType Property

Gets the type handled by this reader component.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Type TargetType { get; }

Property Value

The type handled by this reader component.

Expand image See Also

Reference

ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader.TypeVersion Property

ContentTypeReader.TypeVersion Property

Gets a format version number for this type.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public virtual int TypeVersion { get; }

Property Value

The version number for this type.

Expand image See Also

Reference

ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader Generic Class

ContentTypeReader Generic Class
See Also Members
CollapseAll image

Worker for reading a specific managed type from a binary format. Derive from this class to add new data types to the content pipeline system.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public abstract class ContentTypeReader<T> : ContentTypeReader

Expand image See Also

Reference

ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Programming Guide

Adding Content to a Game

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader Members

ContentTypeReader Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the ContentTypeReader type.

Expand image Protected Constructors

 | Name | Description
Protected Method | ContentTypeReader | Creates a new instance of ContentTypeReader.

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | (Inherited from ContentTypeReader.)
Public Property | TargetType | (Inherited from ContentTypeReader.)
Public Property | TypeVersion | (Inherited from ContentTypeReader.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Read | Overloaded. Reads a strongly typed object from the current stream.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeReader Generic Class
Microsoft.Xna.Framework.Content Namespace


ContentTypeReader Constructor

ContentTypeReader Constructor

Creates a new instance of ContentTypeReader.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected ContentTypeReader ()

Expand image See Also

Reference

ContentTypeReader Generic Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader Methods

ContentTypeReader Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Read | Overloaded. Reads a strongly typed object from the current stream.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeReader Generic Class
Microsoft.Xna.Framework.Content Namespace


ContentTypeReader.Read Method

ContentTypeReader.Read Method

Reads a strongly typed object from the current stream.

Expand image Overload List

Name | Description
ContentTypeReader.Read (ContentReader, Object) | Reads an object from the current stream.
ContentTypeReader.Read (ContentReader, T) | Reads a strongly typed object from the current stream.

Expand image See Also

Reference

ContentTypeReader Generic Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace


ContentTypeReader.Read Method (ContentReader, Object)

ContentTypeReader.Read Method (ContentReader, Object)
See Also
CollapseAll image

Reads an object from the current stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected internal override Object Read (
         ContentReader input,
         Object existingInstance
)

Parameters

input
The ContentReader used to read the object.
existingInstance
An existing object to read into.

Return Value

The object that was read.

Expand image Exceptions

Exception type | Condition
ContentLoadException | Error loading the object. File contains an object of a type other than the type requested.

Expand image See Also

Reference

ContentTypeReader Generic Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader.Read Method (ContentReader, T)

ContentTypeReader.Read Method (ContentReader, T)
See Also
CollapseAll image

Reads a strongly typed object from the current stream.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected internal abstract T Read (
         ContentReader input,
         T existingInstance
)

Parameters

input
The ContentReader used to read the object.
existingInstance
An existing object to read into.

Return Value

The type of object to read.

Expand image See Also

Reference

ContentTypeReader Generic Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReader Properties

ContentTypeReader Properties

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | (Inherited from ContentTypeReader.)
Public Property | TargetType | (Inherited from ContentTypeReader.)
Public Property | TypeVersion | (Inherited from ContentTypeReader.)

Expand image See Also

Reference

ContentTypeReader Generic Class
Microsoft.Xna.Framework.Content Namespace


ContentTypeReaderManager Class

ContentTypeReaderManager Class
See Also Members
CollapseAll image

A manager that constructs and keeps track of type reader objects.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class ContentTypeReaderManager

Expand image See Also

Reference

ContentTypeReaderManager Members
Microsoft.Xna.Framework.Content Namespace

Programming Guide

Adding Content to a Game

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ContentTypeReaderManager Members

ContentTypeReaderManager Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the ContentTypeReaderManager type.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetTypeReader | Looks up a reader for the specified type.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeReaderManager Class
Microsoft.Xna.Framework.Content Namespace


ContentTypeReaderManager Methods

ContentTypeReaderManager Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetTypeReader | Looks up a reader for the specified type.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeReaderManager Class
Microsoft.Xna.Framework.Content Namespace


ContentTypeReaderManager.GetTypeReader Method

ContentTypeReaderManager.GetTypeReader Method

Looks up a reader for the specified type.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ContentTypeReader GetTypeReader (
         Type targetType
)

Parameters

targetType
The type the reader will handle.

Return Value

The created ContentTypeReader.

Expand image Exceptions

Exception type | Condition
ContentLoadException | Cannot find the requested ContentTypeReader.
ArgumentNullException | targetType cannot be null.

Expand image See Also

Reference

ContentTypeReaderManager Class
ContentTypeReaderManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ResourceContentManager Class

ResourceContentManager Class
See Also Members
CollapseAll image

Subclass of ContentManager, which is specialized to read from .resx resource files rather than directly from individual files on disk.

See Loading Content for instructions for using ResourceContentManager.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class ResourceContentManager : ContentManager

Expand image See Also

Reference

ResourceContentManager Members
Microsoft.Xna.Framework.Content Namespace

Programming Guide

Adding Content to a Game

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ResourceContentManager Members

ResourceContentManager Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the ResourceContentManager type.

Expand image Public Constructors

 | Name | Description
Public Method | ResourceContentManager | Creates a new instance of ResourceContentManager.

Expand image Public Properties

 | Name | Description
Public Property | RootDirectory | (Inherited from ContentManager.)
Public Property | ServiceProvider | (Inherited from ContentManager.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from ContentManager.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Load | (Inherited from ContentManager.)
Public Method | ToString | (Inherited from Object.)
Public Method | Unload | (Inherited from ContentManager.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from ContentManager.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OpenStream | Opens a stream for reading the specified resource. Derived classes can replace this to implement pack files or asset compression.
Protected Method | ReadAsset | (Inherited from ContentManager.)

Expand image See Also

Reference

ResourceContentManager Class
Microsoft.Xna.Framework.Content Namespace


ResourceContentManager Constructor

ResourceContentManager Constructor

Creates a new instance of ResourceContentManager.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ResourceContentManager (
         IServiceProvider serviceProvider,
         ResourceManager resourceManager
)

Parameters

serviceProvider
The service provider the ContentManager should use to locate services.
resourceManager
The resource manager for the ResourceContentManager to read from.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | resourceManager is null.

Expand image See Also

Reference

ResourceContentManager Class
ResourceContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ResourceContentManager Methods

ResourceContentManager Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from ContentManager.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Load | (Inherited from ContentManager.)
Public Method | ToString | (Inherited from Object.)
Public Method | Unload | (Inherited from ContentManager.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from ContentManager.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OpenStream | Opens a stream for reading the specified resource. Derived classes can replace this to implement pack files or asset compression.
Protected Method | ReadAsset | (Inherited from ContentManager.)

Expand image See Also

Reference

ResourceContentManager Class
Microsoft.Xna.Framework.Content Namespace


ResourceContentManager.OpenStream Method

ResourceContentManager.OpenStream Method

Opens a stream for reading the specified resource. Derived classes can replace this to implement pack files or asset compression.

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected override Stream OpenStream (
         string assetName
)

Parameters

assetName
The name of the asset being read.

Return Value

The opened stream.

Expand image Exceptions

Exception type | Condition
ContentLoadException | Error loading assetName. The resource was not a binary resource, or the resource was not found.

Expand image See Also

Reference

ResourceContentManager Class
ResourceContentManager Members
Microsoft.Xna.Framework.Content Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ResourceContentManager Properties

ResourceContentManager Properties

Expand image Public Properties

 | Name | Description
Public Property | RootDirectory | (Inherited from ContentManager.)
Public Property | ServiceProvider | (Inherited from ContentManager.)

Expand image See Also

Reference

ResourceContentManager Class
Microsoft.Xna.Framework.Content Namespace


Microsoft.Xna.Framework.Design Namespace

Microsoft.Xna.Framework.Design Namespace

Note
This namespace is available only when developing for Windows.
Provides a unified way of converting types of values to other types.

Expand image Classes

 | Name | Description
Public Class | BoundingBoxConverter | Provides a unified way of converting BoundingBox values to other types, as well as for accessing standard values and subproperties.
Public Class | BoundingSphereConverter | Provides a unified way of converting BoundingSphere values to other types, as well as for accessing standard values and subproperties.
Public Class | ColorConverter | Provides a unified way of converting Color values to other types, as well as for accessing standard values and subproperties.
Public Class | MathTypeConverter | Provides a unified way of converting math type values to other types, as well as for accessing standard values and subproperties.
Public Class | MatrixConverter | Provides a unified way of converting Matrix values to other types, as well as for accessing standard values and subproperties.
Public Class | PlaneConverter | Provides a unified way of converting Plane values to other types, as well as for accessing standard values and subproperties.
Public Class | PointConverter | Provides a unified way of converting Point values to other types, as well as for accessing standard values and subproperties.
Public Class | QuaternionConverter | Provides a unified way of converting Quaternion values to other types, as well as for accessing standard values and subproperties.
Public Class | RayConverter | Provides a unified way of converting Ray values to other types, as well as for accessing standard values and subproperties.
Public Class | RectangleConverter | Provides a unified way of converting Rectangle values to other types, as well as for accessing standard values and subproperties.
Public Class | Vector2Converter | Provides a unified way of converting Vector2 values to other types, as well as for accessing standard values and subproperties.
Public Class | Vector3Converter | Provides a unified way of converting Vector3 values to other types, as well as for accessing standard values and subproperties.
Public Class | Vector4Converter | Provides a unified way of converting Vector4 values to other types, as well as for accessing standard values and subproperties.


BoundingBoxConverter Class

BoundingBoxConverter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting BoundingBox values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class BoundingBoxConverter : MathTypeConverter

Expand image See Also

Reference

BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


BoundingBoxConverter Members

BoundingBoxConverter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the BoundingBoxConverter type.

Expand image Public Constructors

 | Name | Description
Public Method | BoundingBoxConverter | Initializes a new instance of the BoundingBoxConverter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

BoundingBoxConverter Class
Microsoft.Xna.Framework.Design Namespace


BoundingBoxConverter Fields

BoundingBoxConverter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

BoundingBoxConverter Class
Microsoft.Xna.Framework.Design Namespace


BoundingBoxConverter Constructor

BoundingBoxConverter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the BoundingBoxConverter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public BoundingBoxConverter ()

Expand image See Also

Reference

BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


BoundingBoxConverter Methods

BoundingBoxConverter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

BoundingBoxConverter Class
Microsoft.Xna.Framework.Design Namespace


BoundingBoxConverter.ConvertFrom Method

BoundingBoxConverter.ConvertFrom Method

Converts the given value to the type of this converter.

Expand image Overload List

Name | Description
BoundingBoxConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) | Converts the given object to the type of this converter, using the specified context and culture information.

Expand image See Also

Reference

BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace


BoundingBoxConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)

BoundingBoxConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given object to the type of this converter, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertFrom (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value
)

Parameters

context
The format context.
culture
The current culture.
value
The object to convert.

Return Value

The converted value.

Expand image See Also

Reference

BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


BoundingBoxConverter.ConvertTo Method

BoundingBoxConverter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
BoundingBoxConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace


BoundingBoxConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

BoundingBoxConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


BoundingBoxConverter.CreateInstance Method

BoundingBoxConverter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
BoundingBoxConverter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this BoundingBoxConverter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace


BoundingBoxConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

BoundingBoxConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this BoundingBoxConverter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


BoundingSphereConverter Class

BoundingSphereConverter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting BoundingSphere values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class BoundingSphereConverter : MathTypeConverter

Expand image See Also

Reference

BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


BoundingSphereConverter Members

BoundingSphereConverter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the BoundingSphereConverter type.

Expand image Public Constructors

 | Name | Description
Public Method | BoundingSphereConverter | Initializes a new instance of the BoundingSphereConverter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

BoundingSphereConverter Class
Microsoft.Xna.Framework.Design Namespace


BoundingSphereConverter Fields

BoundingSphereConverter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

BoundingSphereConverter Class
Microsoft.Xna.Framework.Design Namespace


BoundingSphereConverter Constructor

BoundingSphereConverter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the BoundingSphereConverter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public BoundingSphereConverter ()

Expand image See Also

Reference

BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


BoundingSphereConverter Methods

BoundingSphereConverter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

BoundingSphereConverter Class
Microsoft.Xna.Framework.Design Namespace


BoundingSphereConverter.ConvertFrom Method

BoundingSphereConverter.ConvertFrom Method

Converts the given value to the type of this converter.

Expand image Overload List

Name | Description
BoundingSphereConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) | Converts the given object to the type of this converter, using the specified context and culture information.

Expand image See Also

Reference

BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace


BoundingSphereConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)

BoundingSphereConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given object to the type of this converter, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertFrom (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value
)

Parameters

context
The format context.
culture
The current culture.
value
The object to convert.

Return Value

The converted value.

Expand image See Also

Reference

BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


BoundingSphereConverter.ConvertTo Method

BoundingSphereConverter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
BoundingSphereConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace


BoundingSphereConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

BoundingSphereConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


BoundingSphereConverter.CreateInstance Method

BoundingSphereConverter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
BoundingSphereConverter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this BoundingSphereConverter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace


BoundingSphereConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

BoundingSphereConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this BoundingSphereConverter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


ColorConverter Class

ColorConverter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting Color values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class ColorConverter : MathTypeConverter

Expand image See Also

Reference

ColorConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


ColorConverter Members

ColorConverter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the ColorConverter type.

Expand image Public Constructors

 | Name | Description
Public Method | ColorConverter | Initializes a new instance of the ColorConverter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

ColorConverter Class
Microsoft.Xna.Framework.Design Namespace


ColorConverter Fields

ColorConverter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

ColorConverter Class
Microsoft.Xna.Framework.Design Namespace


ColorConverter Constructor

ColorConverter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the ColorConverter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ColorConverter ()

Expand image See Also

Reference

ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


ColorConverter Methods

ColorConverter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

ColorConverter Class
Microsoft.Xna.Framework.Design Namespace


ColorConverter.ConvertFrom Method

ColorConverter.ConvertFrom Method

Converts the given value to the type of this converter.

Expand image Overload List

Name | Description
ColorConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) | Converts the given value to the type of this converter.

Expand image See Also

Reference

ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace


ColorConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)

ColorConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value to the type of this converter.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertFrom (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value
)

Parameters

context
The format context.
culture
The current culture.
value
The object to convert.

Return Value

The converted value.

Expand image See Also

Reference

ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


ColorConverter.ConvertTo Method

ColorConverter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
ColorConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace


ColorConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

ColorConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Performance", "CA1800")]
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image See Also

Reference

ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


ColorConverter.CreateInstance Method

ColorConverter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
ColorConverter.CreateInstance (ITypeDescriptorContext, IDictionary) | Re-creates an object given a set of property values for the object.

Expand image See Also

Reference

ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace


ColorConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

ColorConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Re-creates an object given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MathTypeConverter Class

MathTypeConverter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting math type values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class MathTypeConverter : ExpandableObjectConverter

Expand image See Also

Reference

MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MathTypeConverter Members

MathTypeConverter Members
See Also Constructors Fields Methods
CollapseAll image

The following tables list the members exposed by the MathTypeConverter type.

Expand image Public Constructors

 | Name | Description
Public Method | MathTypeConverter | Initializes a new instance of the MathTypeConverter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | Represents a collection of PropertyDescriptor objects.
Protected Field | supportStringConvert | Returns whether string conversion is supported.

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | Overloaded. Returns whether this converter can convert an object of one type to the type of this converter.
Public Method | CanConvertTo | Overloaded. Returns whether this converter can convert the object to the specified type.
Public Method | ConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | (Overloaded. Inherited from TypeConverter.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | Overloaded. Returns whether changing a value on this object requires a call to the CreateInstance method to create a new value.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | Overloaded. Returns a collection of properties for the type of array specified by the value parameter.
Public Method | GetPropertiesSupported | Overloaded. Returns whether this object supports properties.
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

MathTypeConverter Class
Microsoft.Xna.Framework.Design Namespace


MathTypeConverter Fields

MathTypeConverter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | Represents a collection of PropertyDescriptor objects.
Protected Field | supportStringConvert | Returns whether string conversion is supported.

Expand image See Also

Reference

MathTypeConverter Class
Microsoft.Xna.Framework.Design Namespace


MathTypeConverter.propertyDescriptions Field

MathTypeConverter.propertyDescriptions Field

Note
This field is available only when developing for Windows.
Represents a collection of PropertyDescriptor objects.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected PropertyDescriptorCollection propertyDescriptions

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MathTypeConverter.supportStringConvert Field

MathTypeConverter.supportStringConvert Field

Note
This field is available only when developing for Windows.
Returns whether string conversion is supported.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
protected bool supportStringConvert

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MathTypeConverter Constructor

MathTypeConverter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the MathTypeConverter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public MathTypeConverter ()

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MathTypeConverter Methods

MathTypeConverter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | Overloaded. Returns whether this converter can convert an object of one type to the type of this converter.
Public Method | CanConvertTo | Overloaded. Returns whether this converter can convert the object to the specified type.
Public Method | ConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | (Overloaded. Inherited from TypeConverter.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | Overloaded. Returns whether changing a value on this object requires a call to the CreateInstance method to create a new value.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | Overloaded. Returns a collection of properties for the type of array specified by the value parameter.
Public Method | GetPropertiesSupported | Overloaded. Returns whether this object supports properties.
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

MathTypeConverter Class
Microsoft.Xna.Framework.Design Namespace


MathTypeConverter.CanConvertFrom Method

MathTypeConverter.CanConvertFrom Method

Returns whether this converter can convert an object of one type to the type of this converter.

Expand image Overload List

Name | Description
MathTypeConverter.CanConvertFrom (ITypeDescriptorContext, Type) | Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace


MathTypeConverter.CanConvertFrom Method (ITypeDescriptorContext, Type)

MathTypeConverter.CanConvertFrom Method (ITypeDescriptorContext, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool CanConvertFrom (
         ITypeDescriptorContext context,
         Type sourceType
)

Parameters

context
The format context.
sourceType
The type you want to convert from.

Return Value

true if this converter can perform the conversion; false otherwise.

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MathTypeConverter.CanConvertTo Method

MathTypeConverter.CanConvertTo Method

Returns whether this converter can convert the object to the specified type.

Expand image Overload List

Name | Description
MathTypeConverter.CanConvertTo (ITypeDescriptorContext, Type) | Returns whether this converter can convert an object of one type to the type of this converter.

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace


MathTypeConverter.CanConvertTo Method (ITypeDescriptorContext, Type)

MathTypeConverter.CanConvertTo Method (ITypeDescriptorContext, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Returns whether this converter can convert an object of one type to the type of this converter.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool CanConvertTo (
         ITypeDescriptorContext context,
         Type destinationType
)

Parameters

context
The format context.
destinationType
The destination type.

Return Value

true if this converter can perform the conversion; false otherwise.

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MathTypeConverter.GetCreateInstanceSupported Method

MathTypeConverter.GetCreateInstanceSupported Method

Returns whether changing a value on this object requires a call to the CreateInstance method to create a new value.

Expand image Overload List

Name | Description
MathTypeConverter.GetCreateInstanceSupported (ITypeDescriptorContext) | Returns whether changing a value on this object requires a call to CreateInstance to create a new value, using the specified context.

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace


MathTypeConverter.GetCreateInstanceSupported Method (ITypeDescriptorContext)

MathTypeConverter.GetCreateInstanceSupported Method (ITypeDescriptorContext)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Returns whether changing a value on this object requires a call to CreateInstance to create a new value, using the specified context.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool GetCreateInstanceSupported (
         ITypeDescriptorContext context
)

Parameters

context
The format context.

Return Value

true if changing a property on this object requires a call to CreateInstance to create a new value; false otherwise.

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MathTypeConverter.GetProperties Method

MathTypeConverter.GetProperties Method

Returns a collection of properties for the type of array specified by the value parameter.

Expand image Overload List

Name | Description
MathTypeConverter.GetProperties (ITypeDescriptorContext, Object, Attribute[]) | Returns a collection of properties for the type of array specified by the value parameter.

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace


MathTypeConverter.GetProperties Method (ITypeDescriptorContext, Object, Attribute[])

MathTypeConverter.GetProperties Method (ITypeDescriptorContext, Object, Attribute[])
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Returns a collection of properties for the type of array specified by the value parameter.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override PropertyDescriptorCollection GetProperties (
         ITypeDescriptorContext context,
         Object value,
         Attribute[] attributes
)

Parameters

context
The format context.
value
The type of array for which to get properties.
attributes
An array to use as a filter.

Return Value

The properties that are exposed for this data type, or null if there are no properties.

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MathTypeConverter.GetPropertiesSupported Method

MathTypeConverter.GetPropertiesSupported Method

Returns whether this object supports properties.

Expand image Overload List

Name | Description
MathTypeConverter.GetPropertiesSupported (ITypeDescriptorContext) | Returns whether this object supports properties, using the specified context.

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace


MathTypeConverter.GetPropertiesSupported Method (ITypeDescriptorContext)

MathTypeConverter.GetPropertiesSupported Method (ITypeDescriptorContext)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Returns whether this object supports properties, using the specified context.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool GetPropertiesSupported (
         ITypeDescriptorContext context
)

Parameters

context
The format context.

Return Value

true if GetProperties should be called to find the properties of this object; false otherwise.

Expand image See Also

Reference

MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MatrixConverter Class

MatrixConverter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting Matrix values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class MatrixConverter : MathTypeConverter

Expand image See Also

Reference

MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MatrixConverter Members

MatrixConverter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the MatrixConverter type.

Expand image Public Constructors

 | Name | Description
Public Method | MatrixConverter | Initializes a new instance of the MatrixConverter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

MatrixConverter Class
Microsoft.Xna.Framework.Design Namespace


MatrixConverter Fields

MatrixConverter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

MatrixConverter Class
Microsoft.Xna.Framework.Design Namespace


MatrixConverter Constructor

MatrixConverter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the MatrixConverter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public MatrixConverter ()

Expand image See Also

Reference

MatrixConverter Class
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MatrixConverter Methods

MatrixConverter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

MatrixConverter Class
Microsoft.Xna.Framework.Design Namespace


MatrixConverter.ConvertTo Method

MatrixConverter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
MatrixConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

MatrixConverter Class
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace


MatrixConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

MatrixConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

MatrixConverter Class
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


MatrixConverter.CreateInstance Method

MatrixConverter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
MatrixConverter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this MatrixConverter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

MatrixConverter Class
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace


MatrixConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

MatrixConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this MatrixConverter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

MatrixConverter Class
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


PlaneConverter Class

PlaneConverter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting Plane values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class PlaneConverter : MathTypeConverter

Expand image See Also

Reference

PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


PlaneConverter Members

PlaneConverter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the PlaneConverter type.

Expand image Public Constructors

 | Name | Description
Public Method | PlaneConverter | Initializes a new instance of the PlaneConverter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

PlaneConverter Class
Microsoft.Xna.Framework.Design Namespace


PlaneConverter Fields

PlaneConverter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

PlaneConverter Class
Microsoft.Xna.Framework.Design Namespace


PlaneConverter Constructor

PlaneConverter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the PlaneConverter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PlaneConverter ()

Expand image See Also

Reference

PlaneConverter Class
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


PlaneConverter Methods

PlaneConverter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

PlaneConverter Class
Microsoft.Xna.Framework.Design Namespace


PlaneConverter.ConvertTo Method

PlaneConverter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
PlaneConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

PlaneConverter Class
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace


PlaneConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

PlaneConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

PlaneConverter Class
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


PlaneConverter.CreateInstance Method

PlaneConverter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
PlaneConverter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this PlaneConverter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

PlaneConverter Class
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace


PlaneConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

PlaneConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this PlaneConverter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

PlaneConverter Class
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


PointConverter Class

PointConverter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting Point values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class PointConverter : MathTypeConverter

Expand image See Also

Reference

PointConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


PointConverter Members

PointConverter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the PointConverter type.

Expand image Public Constructors

 | Name | Description
Public Method | PointConverter | Initializes a new instance of the PointConverter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

PointConverter Class
Microsoft.Xna.Framework.Design Namespace


PointConverter Fields

PointConverter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

PointConverter Class
Microsoft.Xna.Framework.Design Namespace


PointConverter Constructor

PointConverter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the PointConverter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PointConverter ()

Expand image See Also

Reference

PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


PointConverter Methods

PointConverter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

PointConverter Class
Microsoft.Xna.Framework.Design Namespace


PointConverter.ConvertFrom Method

PointConverter.ConvertFrom Method

Converts the given value to the type of this converter.

Expand image Overload List

Name | Description
PointConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) | Converts the given object to the type of this converter, using the specified context and culture information.

Expand image See Also

Reference

PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace


PointConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)

PointConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given object to the type of this converter, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertFrom (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value
)

Parameters

context
The format context.
culture
The current culture.
value
The object to convert.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentException | Invalid string format.

Expand image See Also

Reference

PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


PointConverter.ConvertTo Method

PointConverter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
PointConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace


PointConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

PointConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


PointConverter.CreateInstance Method

PointConverter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
PointConverter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this PointConverter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace


PointConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

PointConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this PointConverter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


QuaternionConverter Class

QuaternionConverter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting Quaternion values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class QuaternionConverter : MathTypeConverter

Expand image See Also

Reference

QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


QuaternionConverter Members

QuaternionConverter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the QuaternionConverter type.

Expand image Public Constructors

 | Name | Description
Public Method | QuaternionConverter | Initializes a new instance of the QuaternionConverter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

QuaternionConverter Class
Microsoft.Xna.Framework.Design Namespace


QuaternionConverter Fields

QuaternionConverter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

QuaternionConverter Class
Microsoft.Xna.Framework.Design Namespace


QuaternionConverter Constructor

QuaternionConverter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the QuaternionConverter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public QuaternionConverter ()

Expand image See Also

Reference

QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


QuaternionConverter Methods

QuaternionConverter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

QuaternionConverter Class
Microsoft.Xna.Framework.Design Namespace


QuaternionConverter.ConvertFrom Method

QuaternionConverter.ConvertFrom Method

Converts the given value to the type of this converter.

Expand image Overload List

Name | Description
QuaternionConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) | Converts the given object to the type of this converter, using the specified context and culture information.

Expand image See Also

Reference

QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace


QuaternionConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)

QuaternionConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given object to the type of this converter, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertFrom (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value
)

Parameters

context
The format context.
culture
The current culture.
value
The object to convert.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentException | Invalid string format.

Expand image See Also

Reference

QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


QuaternionConverter.ConvertTo Method

QuaternionConverter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
QuaternionConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace


QuaternionConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

QuaternionConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


QuaternionConverter.CreateInstance Method

QuaternionConverter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
QuaternionConverter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this QuaternionConverter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace


QuaternionConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

QuaternionConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this QuaternionConverter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


RayConverter Class

RayConverter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting Ray values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class RayConverter : MathTypeConverter

Expand image See Also

Reference

RayConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


RayConverter Members

RayConverter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the RayConverter type.

Expand image Public Constructors

 | Name | Description
Public Method | RayConverter | Initializes a new instance of the RayConverter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

RayConverter Class
Microsoft.Xna.Framework.Design Namespace


RayConverter Fields

RayConverter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

RayConverter Class
Microsoft.Xna.Framework.Design Namespace


RayConverter Constructor

RayConverter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the RayConverter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public RayConverter ()

Expand image See Also

Reference

RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


RayConverter Methods

RayConverter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

RayConverter Class
Microsoft.Xna.Framework.Design Namespace


RayConverter.ConvertFrom Method

RayConverter.ConvertFrom Method

Converts the given value to the type of this converter.

Expand image Overload List

Name | Description
RayConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) | Converts the given object to the type of this converter, using the specified context and culture information.

Expand image See Also

Reference

RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace


RayConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)

RayConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given object to the type of this converter, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertFrom (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value
)

Parameters

context
The format context.
culture
The current culture.
value
The object to convert.

Return Value

The converted value.

Expand image See Also

Reference

RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


RayConverter.ConvertTo Method

RayConverter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
RayConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace


RayConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

RayConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


RayConverter.CreateInstance Method

RayConverter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
RayConverter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this RayConverter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace


RayConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

RayConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this RayConverter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


RectangleConverter Class

RectangleConverter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting Rectangle values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class RectangleConverter : MathTypeConverter

Expand image See Also

Reference

RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


RectangleConverter Members

RectangleConverter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the RectangleConverter type.

Expand image Public Constructors

 | Name | Description
Public Method | RectangleConverter | Initializes a new instance of the RectangleConverter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

RectangleConverter Class
Microsoft.Xna.Framework.Design Namespace


RectangleConverter Fields

RectangleConverter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

RectangleConverter Class
Microsoft.Xna.Framework.Design Namespace


RectangleConverter Constructor

RectangleConverter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the RectangleConverter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public RectangleConverter ()

Expand image See Also

Reference

RectangleConverter Class
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


RectangleConverter Methods

RectangleConverter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

RectangleConverter Class
Microsoft.Xna.Framework.Design Namespace


RectangleConverter.ConvertTo Method

RectangleConverter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
RectangleConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

RectangleConverter Class
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace


RectangleConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

RectangleConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

RectangleConverter Class
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


RectangleConverter.CreateInstance Method

RectangleConverter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
RectangleConverter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this RectangleConverter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

RectangleConverter Class
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace


RectangleConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

RectangleConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this RectangleConverter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

RectangleConverter Class
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector2Converter Class

Vector2Converter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting Vector2 values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class Vector2Converter : MathTypeConverter

Expand image See Also

Reference

Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector2Converter Members

Vector2Converter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the Vector2Converter type.

Expand image Public Constructors

 | Name | Description
Public Method | Vector2Converter | Initializes a new instance of the Vector2Converter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

Vector2Converter Class
Microsoft.Xna.Framework.Design Namespace


Vector2Converter Fields

Vector2Converter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

Vector2Converter Class
Microsoft.Xna.Framework.Design Namespace


Vector2Converter Constructor

Vector2Converter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the Vector2Converter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2Converter ()

Expand image See Also

Reference

Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector2Converter Methods

Vector2Converter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

Vector2Converter Class
Microsoft.Xna.Framework.Design Namespace


Vector2Converter.ConvertFrom Method

Vector2Converter.ConvertFrom Method

Converts the given value to the type of this converter.

Expand image Overload List

Name | Description
Vector2Converter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) | Converts the given object to the type of this converter, using the specified context and culture information.

Expand image See Also

Reference

Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace


Vector2Converter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)

Vector2Converter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given object to the type of this converter, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertFrom (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value
)

Parameters

context
The format context.
culture
The current culture.
value
The object to convert.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentException | Invalid string format.

Expand image See Also

Reference

Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector2Converter.ConvertTo Method

Vector2Converter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
Vector2Converter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace


Vector2Converter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

Vector2Converter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector2Converter.CreateInstance Method

Vector2Converter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
Vector2Converter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this Vector2Converter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace


Vector2Converter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

Vector2Converter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this Vector2Converter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector3Converter Class

Vector3Converter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting Vector3 values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class Vector3Converter : MathTypeConverter

Expand image See Also

Reference

Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector3Converter Members

Vector3Converter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the Vector3Converter type.

Expand image Public Constructors

 | Name | Description
Public Method | Vector3Converter | Initializes a new instance of the Vector3Converter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

Vector3Converter Class
Microsoft.Xna.Framework.Design Namespace


Vector3Converter Fields

Vector3Converter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

Vector3Converter Class
Microsoft.Xna.Framework.Design Namespace


Vector3Converter Constructor

Vector3Converter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the Vector3Converter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3Converter ()

Expand image See Also

Reference

Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector3Converter Methods

Vector3Converter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

Vector3Converter Class
Microsoft.Xna.Framework.Design Namespace


Vector3Converter.ConvertFrom Method

Vector3Converter.ConvertFrom Method

Converts the given value to the type of this converter.

Expand image Overload List

Name | Description
Vector3Converter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) | Converts the given object to the type of this converter, using the specified context and culture information.

Expand image See Also

Reference

Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace


Vector3Converter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)

Vector3Converter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given object to the type of this converter, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertFrom (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value
)

Parameters

context
The format context.
culture
The current culture.
value
The object to convert.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentException | Invalid string format.

Expand image See Also

Reference

Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector3Converter.ConvertTo Method

Vector3Converter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
Vector3Converter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace


Vector3Converter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

Vector3Converter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector3Converter.CreateInstance Method

Vector3Converter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
Vector3Converter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this Vector3Converter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace


Vector3Converter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

Vector3Converter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this Vector3Converter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector4Converter Class

Vector4Converter Class
See Also Members
CollapseAll image

Note
This class is available only when developing for Windows.
Provides a unified way of converting Vector4 values to other types, as well as for accessing standard values and subproperties.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class Vector4Converter : MathTypeConverter

Expand image See Also

Reference

Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector4Converter Members

Vector4Converter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the Vector4Converter type.

Expand image Public Constructors

 | Name | Description
Public Method | Vector4Converter | Initializes a new instance of the Vector4Converter class.

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

Vector4Converter Class
Microsoft.Xna.Framework.Design Namespace


Vector4Converter Fields

Vector4Converter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | propertyDescriptions | (Inherited from MathTypeConverter.)
Protected Field | supportStringConvert | (Inherited from MathTypeConverter.)

Expand image See Also

Reference

Vector4Converter Class
Microsoft.Xna.Framework.Design Namespace


Vector4Converter Constructor

Vector4Converter Constructor

Note
This constructor is available only when developing for Windows.
Initializes a new instance of the Vector4Converter class.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4Converter ()

Expand image See Also

Reference

Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector4Converter Methods

Vector4Converter Methods

Expand image Public Methods

 | Name | Description
Public Method | CanConvertFrom | (Overloaded. Inherited from TypeConverter.)
Public Method | CanConvertTo | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFrom | Overloaded. Converts the given value to the type of this converter.
Public Method | ConvertFromInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertFromString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertTo | Overloaded. Converts the given value object to the specified type, using the specified context and culture information.
Public Method | ConvertToInvariantString | (Overloaded. Inherited from TypeConverter.)
Public Method | ConvertToString | (Overloaded. Inherited from TypeConverter.)
Public Method | CreateInstance | Overloaded. Re-creates an object given a set of property values for the object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetCreateInstanceSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProperties | (Overloaded. Inherited from TypeConverter.)
Public Method | GetPropertiesSupported | (Overloaded. Inherited from MathTypeConverter.)
Public Method | GetStandardValues | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesExclusive | (Overloaded. Inherited from TypeConverter.)
Public Method | GetStandardValuesSupported | (Overloaded. Inherited from TypeConverter.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsValid | (Overloaded. Inherited from TypeConverter.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetConvertFromException | (Inherited from TypeConverter.)
Protected Method | GetConvertToException | (Inherited from TypeConverter.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SortProperties | (Inherited from TypeConverter.)

Expand image See Also

Reference

Vector4Converter Class
Microsoft.Xna.Framework.Design Namespace


Vector4Converter.ConvertFrom Method

Vector4Converter.ConvertFrom Method

Converts the given value to the type of this converter.

Expand image Overload List

Name | Description
Vector4Converter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) | Converts the given object to the type of this converter, using the specified context and culture information.

Expand image See Also

Reference

Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace


Vector4Converter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)

Vector4Converter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given object to the type of this converter, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertFrom (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value
)

Parameters

context
The format context.
culture
The current culture.
value
The object to convert.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentException | Invalid string format.

Expand image See Also

Reference

Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector4Converter.ConvertTo Method

Vector4Converter.ConvertTo Method

Converts the given value object to the specified type, using the specified context and culture information.

Expand image Overload List

Name | Description
Vector4Converter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) | Converts the given value object to the specified type, using the specified context and culture information.

Expand image See Also

Reference

Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace


Vector4Converter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

Vector4Converter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Converts the given value object to the specified type, using the specified context and culture information.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object ConvertTo (
         ITypeDescriptorContext context,
         CultureInfo culture,
         Object value,
         Type destinationType
)

Parameters

context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.

Return Value

The converted value.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationType is null.

Expand image See Also

Reference

Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Vector4Converter.CreateInstance Method

Vector4Converter.CreateInstance Method

Re-creates an object given a set of property values for the object.

Expand image Overload List

Name | Description
Vector4Converter.CreateInstance (ITypeDescriptorContext, IDictionary) | Creates an instance of the type that this Vector4Converter is associated with, using the specified context, given a set of property values for the object.

Expand image See Also

Reference

Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace


Vector4Converter.CreateInstance Method (ITypeDescriptorContext, IDictionary)

Vector4Converter.CreateInstance Method (ITypeDescriptorContext, IDictionary)
See Also
CollapseAll image

Note
This method is available only when developing for Windows.
Creates an instance of the type that this Vector4Converter is associated with, using the specified context, given a set of property values for the object.

Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override Object CreateInstance (
         ITypeDescriptorContext context,
         IDictionary propertyValues
)

Parameters

context
The format context.
propertyValues
The new property values.

Return Value

An object representing propertyValues, or null if the object cannot be created.

Expand image See Also

Reference

Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


Microsoft.Xna.Framework.GamerServices Namespace

Microsoft.Xna.Framework.GamerServices Namespace

Contains classes that implement various services related to gamers. These services communicate directly with the gamer, the gamer's data, or otherwise reflect choices the gamer makes. Gamer services include input device and profile data APIs.

Expand image Classes

 | Name | Description
Public Class | Achievement | Describes a single achievement, including the achievement name, description, picture, and whether it has been achieved by the currently signed in gamer.
Public Class | AchievementCollection | Collection holding the achievements belonging to a signed-in gamer.
Public Class | AvatarAnimation | Provides methods and properties for animating an avatar using standard animations (for example, celebrate).
Public Class | AvatarDescription | Provides access to the methods and properties of the description data for an avatar.
Public Class | AvatarRenderer | Provides properties and methods for rendering a standard avatar.
Public Class | FriendCollection | Represents the complete friends list of a local gamer.
Public Class | FriendGamer | Provides the presence information of a friend of the local gamer.
Public Class | GameDefaults | Describes a gamer's preferred settings.
Public Class | Gamer | Abstract base class for types that represent game players (profiles that have an associated gamertag). The concrete types SignedInGamer and NetworkGamer derive from this.
Public Class | GamerCollection | Represents a collection of gamers. This collection cannot be modified and is updated automatically during the call to Update.
Public Class | GamerPresence | Provides properties to set the rich presence state for a locally signed-in gamer profile.
Public Class | GamerPrivilegeException | Thrown if a gamer services or multiplayer API is called without a valid, signed-in profile.
Public Class | GamerPrivileges | Describes what operations a gamer is allowed to perform.
Public Class | GamerProfile | Profile settings describing information about a gamer such as the gamer's motto, reputation, and gamer picture. This data is accessible for both locally signed in profiles and remote gamers that you are playing with in a multiplayer session.
Public Class | GamerServicesComponent | Wraps the functionality of the GamerServicesDispatcher.
Public Class | GamerServicesDispatcher | Implements the Windows-specific portion of a GamerServicesDispatcher class.
Public Class | GamerServicesNotAvailableException | Thrown if the gamer services system cannot be successfully initialized.
Public Class | GameUpdateRequiredException | The exception thrown when a game (title) update is required in order to use Xbox LIVE.
Public Class | Guide | Provides access to the Guide user interface.
Public Class | GuideAlreadyVisibleException | Thrown if an attmept is made to display a component of the Guide user interface when a Guide component is already displayed.
Public Class | InviteAcceptedEventArgs | Represents the arguments passed to an InviteAccepted event.
Public Class | LeaderboardEntry | Class representing a single row of a leaderboard, holding all the information a specific gamer has uploaded to the board.
Public Class | LeaderboardReader | Reads data from leaderboards.
Public Class | LeaderboardWriter | Records leaderboard data for players in a NetworkSession.
Public Class | NetworkException | Thrown if there is a network communication failure.
Public Class | NetworkNotAvailableException | Thrown if a network connection is unavailable.
Public Class | PropertyDictionary | Holds a set of properties used to define presence states or leaderboard column values.
Public Class | SignedInEventArgs | Represents the arguments passed to a SignedIn event.
Public Class | SignedInGamer | Represents a gamer (a profile that has an associated gamertag) on the local system.
Public Class | SignedInGamerCollection | Represents a collection of gamers on the local system.
Public Class | SignedOutEventArgs | Represents the arguments passed to a SignedOut event.

Expand image Interfaces

 | Name | Description
Public Interface | IAvatarAnimation | Provides methods and properties for animating an avatar using custom animations. Allows for easier integration between custom animations and built-in animations.

Expand image Structures

 | Name | Description
Public Structure | AvatarExpression | Contains the various components of the avatar's face, such as the left and right eyebrows.
Public Structure | GamerCollection.GamerCollectionEnumerator | Provides the ability to iterate through the gamers in an GamerCollection.
Public Structure | LeaderboardIdentity | Contains leaderboard identity information for a particular leaderboard.

Expand image Enumerations

 | Name | Description
Public Enumeration | AvatarAnimationPreset | Defines standard animations for avatars.
Public Enumeration | AvatarBodyType | Defines the body type of the avatar.
Public Enumeration | AvatarBone | Defines a list of the useful bones of the avatar model.
Public Enumeration | AvatarEye | Defines the standard animation textures for an avatar's eyes.
Public Enumeration | AvatarEyebrow | Defines the standard animation textures for an avatar's eyebrows.
Public Enumeration | AvatarMouth | Defines the standard animation textures for an avatar's mouth.
Public Enumeration | AvatarRendererState | Indicates avatar state.
Public Enumeration | ControllerSensitivity | Indicates how sensitive this gamer prefers controller input to be.
Public Enumeration | GameDifficulty | Indicates how difficult this gamer likes things to be.
Public Enumeration | GamerPresenceMode | Settings defining the status string that will appear when you view a friend through the Xbox LIVE Guide or on Xbox.com. Use the PresenceMode property to set this option.
Public Enumeration | GamerPrivilegeSetting | Describes the conditions in which a privilege is available.
Public Enumeration | GamerZone | This style of social gaming preferred by this Xbox LIVE member.
Public Enumeration | LeaderboardKey | Values used with LeaderboardIdentity.Create to select which leaderboard to access.
Public Enumeration | LeaderboardOutcome | Values used to provide an outcome for a player's leaderboard entry.
Public Enumeration | MessageBoxIcon | Defines the different icons for a message box.
Public Enumeration | NotificationPosition | Determines where notifications appear on the screen.
Public Enumeration | RacingCameraAngle | Indicates which camera angle this gamer prefers to use in racing games.

Expand image Remarks

Important

Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

Expand image See Also

Concepts

Introduction to Gamer Services


Achievement Class

Achievement Class
See Also Members
CollapseAll image

Describes a single achievement, including the achievement name, description, picture, and whether it has been achieved by the currently signed in gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class Achievement

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Achievement Members

Achievement Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Achievement type.

Expand image Public Properties

 | Name | Description
Public Property | Description | Gets the localized achievement description string.
Public Property | DisplayBeforeEarned | Gets whether this achievement should be displayed before it is earned.
Public Property | EarnedDateTime | Gets the date at which this achievement was earned.
Public Property | EarnedOnline | Gets whether this achievement was earned while online.
Public Property | GamerScore | Gets the amount of gamer score awarded for earning this achievement.
Public Property | HowToEarn | Gets the localized description of the steps necessary to earn the achievement.
Public Property | IsEarned | Gets whether the current player has earned this achievement.
Public Property | Key | Gets the achievement key string.
Public Property | Name | Gets the localized achievement name string, for display to the user.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPicture | Gets the image associated with this achievement.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

Achievement Class
Microsoft.Xna.Framework.GamerServices Namespace


Achievement Methods

Achievement Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPicture | Gets the image associated with this achievement.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

Achievement Class
Microsoft.Xna.Framework.GamerServices Namespace


Achievement.GetPicture Method

Achievement.GetPicture Method

Gets the image associated with this achievement.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public Stream GetPicture ()

Return Value

A stream containing the image data for this achievement.

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Use FromStream to convert the stream to a Texture2D.

Expand image See Also

Reference

Achievement Class
Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Achievement Properties

Achievement Properties

Expand image Public Properties

 | Name | Description
Public Property | Description | Gets the localized achievement description string.
Public Property | DisplayBeforeEarned | Gets whether this achievement should be displayed before it is earned.
Public Property | EarnedDateTime | Gets the date at which this achievement was earned.
Public Property | EarnedOnline | Gets whether this achievement was earned while online.
Public Property | GamerScore | Gets the amount of gamer score awarded for earning this achievement.
Public Property | HowToEarn | Gets the localized description of the steps necessary to earn the achievement.
Public Property | IsEarned | Gets whether the current player has earned this achievement.
Public Property | Key | Gets the achievement key string.
Public Property | Name | Gets the localized achievement name string, for display to the user.

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

Achievement Class
Microsoft.Xna.Framework.GamerServices Namespace


Achievement.Description Property

Achievement.Description Property

Gets the localized achievement description string.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public string Description { get; }

Property Value

The localized achievement description string.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Achievement Class
Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Achievement.DisplayBeforeEarned Property

Achievement.DisplayBeforeEarned Property

Gets whether this achievement should be displayed before it is earned.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool DisplayBeforeEarned { get; }

Property Value

true if this achievement should be displayed before it is earned; false otherwise.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Achievement Class
Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Achievement.EarnedDateTime Property

Achievement.EarnedDateTime Property

Gets the date at which this achievement was earned.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public DateTime EarnedDateTime { get; }

Property Value

The date at which this achievement was earned.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Achievement Class
Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Achievement.EarnedOnline Property

Achievement.EarnedOnline Property

Gets whether this achievement was earned while online.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool EarnedOnline { get; }

Property Value

true if this achievement was earned while online; false otherwise.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Achievement Class
Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Achievement.GamerScore Property

Achievement.GamerScore Property

Gets the amount of gamer score awarded for earning this achievement.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int GamerScore { get; }

Property Value

The amount of gamer score awarded for earning this achievement.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Achievement Class
Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Achievement.HowToEarn Property

Achievement.HowToEarn Property

Gets the localized description of the steps necessary to earn the achievement.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public string HowToEarn { get; }

Property Value

The localized description of the steps necessary to earn the achievement.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Achievement Class
Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Achievement.IsEarned Property

Achievement.IsEarned Property

Gets whether the current player has earned this achievement.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsEarned { get; }

Property Value

true if the current player has earned this achievement; false otherwise.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Achievement Class
Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Achievement.Key Property

Achievement.Key Property

Gets the achievement key string.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public string Key { get; }

Property Value

The achievement key string.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Achievements can be looked up from the AchievementCollection by key, and the key is passed to the SignedInGamer.BeginAwardAchievement method.

Expand image See Also

Achievement Class
Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Achievement.Name Property

Achievement.Name Property

Gets the localized achievement name string, for display to the user.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The localized achievement name string.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Achievement Class
Achievement Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AchievementCollection Class

AchievementCollection Class
See Also Members
CollapseAll image

Collection holding the achievements belonging to a signed-in gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class AchievementCollection : IList<Achievement>, ICollection<Achievement>, IEnumerable<Achievement>, IEnumerable, IDisposable

Expand image Remarks

This collection may be indexed by key string or integer order. When you are indexing achievements by integer order or iterating over the collection, achievements are ordered with earned achievements first. They are sorted by most-recently earned, then sorted by unearned non-hidden achievements in the order they were defined using XLAST, and finally sorted by any unearned hidden achievements in XLAST order.

Expand image See Also

Reference

AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AchievementCollection Members

AchievementCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the AchievementCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of objects in the collection.
Public Property | IsDisposed | Indicates whether the object is disposed.
Public Property | Item | Overloaded. Overloaded properties that retrieve an achievement from the collection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through this AchievementCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.IsReadOnly | Gets a value indicating whether this collection is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Add | Adds a new Achievement to this AchievementCollection.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Clear | Removes all Achievement instances from this AchievementCollection.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Contains | Determines whether the specified achievement is in this AchievementCollection.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.CopyTo | Copies the collection of achievements to an array, starting at the specified index.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets a strongly-typed enumerator that can iterate through the collection.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.IndexOf | Gets the index of an achievement in the collection.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.Insert | Inserts a new Achievement into this collection of achievements.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.RemoveAt | Removes the Achievement at the specified index position.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Remove | Removes the specified Achievement from the collection.

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

AchievementCollection Class
Microsoft.Xna.Framework.GamerServices Namespace


AchievementCollection Methods

AchievementCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through this AchievementCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.IsReadOnly | Gets a value indicating whether this collection is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Add | Adds a new Achievement to this AchievementCollection.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Clear | Removes all Achievement instances from this AchievementCollection.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Contains | Determines whether the specified achievement is in this AchievementCollection.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.CopyTo | Copies the collection of achievements to an array, starting at the specified index.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets a strongly-typed enumerator that can iterate through the collection.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.IndexOf | Gets the index of an achievement in the collection.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.Insert | Inserts a new Achievement into this collection of achievements.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.RemoveAt | Removes the Achievement at the specified index position.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Remove | Removes the specified Achievement from the collection.

Expand image See Also

Reference

AchievementCollection Class
Microsoft.Xna.Framework.GamerServices Namespace


AchievementCollection.Dispose Method

AchievementCollection.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AchievementCollection.GetEnumerator Method

AchievementCollection.GetEnumerator Method

Gets an enumerator that can iterate through this AchievementCollection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public IEnumerator<Achievement> GetEnumerator ()

Return Value

An enumerator for this AchievementCollection.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.ICollection{T}.Add Method

System.Collections.Generic.ICollection{T}.Add Method

Adds a new Achievement to this AchievementCollection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.Add (
         Achievement item
)

Parameters

item
The achievement to add.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.ICollection{T}.Clear Method

System.Collections.Generic.ICollection{T}.Clear Method

Removes all Achievement instances from this AchievementCollection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.Clear ()

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.ICollection{T}.Contains Method

System.Collections.Generic.ICollection{T}.Contains Method

Determines whether the specified achievement is in this AchievementCollection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.Contains (
         Achievement item
)

Parameters

item
The Achievement to locate in this AchievementCollection.

Return Value

true if the achievement is in this collection; false otherwise.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.ICollection{T}.CopyTo Method

System.Collections.Generic.ICollection{T}.CopyTo Method

Copies the collection of achievements to an array, starting at the specified index.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.CopyTo (
         Achievement[] array,
         int arrayIndex
)

Parameters

array
Array that will receive the copied elements.
arrayIndex
Index into which to begin inserting elements.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.ICollection{T}.Remove Method

System.Collections.Generic.ICollection{T}.Remove Method

Removes the specified Achievement from the collection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.Remove (
         Achievement item
)

Parameters

item
The achievement to remove.

Return Value

true if the achievment was present and is successfully removed; false otherwise.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.IList{T}.IndexOf Method

System.Collections.Generic.IList{T}.IndexOf Method

Gets the index of an achievement in the collection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private int System.Collections.Generic.IList{T}.IndexOf (
         Achievement item
)

Parameters

item
The achievement to locate in this collection.

Return Value

The zero-based index of the achievement in the collection.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.IList{T}.Insert Method

System.Collections.Generic.IList{T}.Insert Method

Inserts a new Achievement into this collection of achievements.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private void System.Collections.Generic.IList{T}.Insert (
         int index,
         Achievement item
)

Parameters

index
Position at which to place this achievement in the collection.
item
The achievement to insert into the collection.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.IList{T}.RemoveAt Method

System.Collections.Generic.IList{T}.RemoveAt Method

Removes the Achievement at the specified index position.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private void System.Collections.Generic.IList{T}.RemoveAt (
         int index
)

Parameters

index
Index of the Achievement to remove.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Gets a strongly-typed enumerator that can iterate through the collection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

An enumerator for this AchievementCollection.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AchievementCollection Properties

AchievementCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of objects in the collection.
Public Property | IsDisposed | Indicates whether the object is disposed.
Public Property | Item | Overloaded. Overloaded properties that retrieve an achievement from the collection.

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

AchievementCollection Class
Microsoft.Xna.Framework.GamerServices Namespace


AchievementCollection.Count Property

AchievementCollection.Count Property

Gets the number of objects in the collection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

The number of objects in the collection.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AchievementCollection.IsDisposed Property

AchievementCollection.IsDisposed Property

Indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AchievementCollection.Item Property

AchievementCollection.Item Property

Overloaded properties that retrieve an achievement from the collection.

Expand image Overload List

Name | Description
AchievementCollection.Item (Int32) | Gets a specific element in the collection using an index value.
AchievementCollection.Item (String) | Retrieves the Achievement matching a specified achievement key string.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace


AchievementCollection.Item Property (Int32)

AchievementCollection.Item Property (Int32)
See Also
CollapseAll image

Gets a specific element in the collection using an index value.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public Achievement this [
         int index
] { get; }

Property Value

The achievement at the specified index.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AchievementCollection.Item Property (String)

AchievementCollection.Item Property (String)
See Also
CollapseAll image

Retrieves the Achievement matching a specified achievement key string.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public Achievement this [
         string achievementKey
] { get; }

Property Value

The achievement matching the specified key.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AchievementCollection.System.Collections.Generic.ICollection{T}.IsReadOnly Property

AchievementCollection.System.Collections.Generic.ICollection{T}.IsReadOnly Property
See Also
CollapseAll image

Gets a value indicating whether this collection is read-only.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.IsReadOnly { get; }

Property Value

true if this collection is read-only; false otherwise.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

AchievementCollection Class
AchievementCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AvatarAnimation Class

AvatarAnimation Class
See Also Members
CollapseAll image

Provides methods and properties for animating an avatar using standard animations (for example, celebrate). For more information on the standard animations available to avatars, see AvatarAnimationPreset.

Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public class AvatarAnimation : IAvatarAnimation, IDisposable

Expand image Remarks

Use this class, in conjunction with AvatarRenderer, to provide standard animations for the avatar model. For more information, see Rendering and Animating Avatars (Xbox 360).

Expand image See Also

Reference

AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimation Members

AvatarAnimation Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the AvatarAnimation type.

Expand image Public Constructors

 | Name | Description
Public Method | AvatarAnimation | Creates a new instance of AvatarAnimation, and initializes it with the specified animation.

Expand image Public Properties

 | Name | Description
Public Property | BoneTransforms | Gets the current position of the bones at the time specified by CurrentPosition.
Public Property | CurrentPosition | Gets or sets the current time position in the animation.
Public Property | Expression | Gets the expression of the related animation at the current time position.
Public Property | IsDisposed | Gets the disposed state of the avatar animation.
Public Property | Length | Gets the length of the current animation.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Updates the current time position of the avatar animation.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows the avatar animation to attempt to free resources, and it performs other cleanup operations before garbage collection reclaims the animation.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AvatarAnimation Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarAnimation Constructor

AvatarAnimation Constructor

Creates a new instance of AvatarAnimation, and initializes it with the specified animation.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarAnimation (
         AvatarAnimationPreset animationPreset
)

Parameters

animationPreset
The specified standard animation.

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimation Methods

AvatarAnimation Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Updates the current time position of the avatar animation.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows the avatar animation to attempt to free resources, and it performs other cleanup operations before garbage collection reclaims the animation.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AvatarAnimation Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarAnimation.Dispose Method

AvatarAnimation.Dispose Method

Immediately releases the unmanaged resources used by this object.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Expand image Overload List

Name | Description
AvatarAnimation.Dispose () | Immediately releases the unmanaged resources used by this object.
AvatarAnimation.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace


AvatarAnimation.Dispose Method ()

AvatarAnimation.Dispose Method ()
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimation.Dispose Method (Boolean)

AvatarAnimation.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool disposing
)

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimation.Finalize Method

AvatarAnimation.Finalize Method

Allows the avatar animation to attempt to free resources, and it performs other cleanup operations before garbage collection reclaims the animation.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimation.Update Method

AvatarAnimation.Update Method

Updates the current time position of the avatar animation.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public void Update (
         TimeSpan elapsedAnimationTime,
         bool loop
)

Parameters

elapsedAnimationTime
Elapsed time since the last animation frame. This value can be either a positive or negative time span. If the value is negative, animation playback is reversed.
loop
true if the animation playback is to be looped; otherwise, false.

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimation Properties

AvatarAnimation Properties

Expand image Public Properties

 | Name | Description
Public Property | BoneTransforms | Gets the current position of the bones at the time specified by CurrentPosition.
Public Property | CurrentPosition | Gets or sets the current time position in the animation.
Public Property | Expression | Gets the expression of the related animation at the current time position.
Public Property | IsDisposed | Gets the disposed state of the avatar animation.
Public Property | Length | Gets the length of the current animation.

Expand image See Also

Reference

AvatarAnimation Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarAnimation.BoneTransforms Property

AvatarAnimation.BoneTransforms Property

Gets the current position of the bones at the time specified by CurrentPosition. The positions are in local bone space relative to their parent bones.

Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public ReadOnlyCollection<Matrix> BoneTransforms { get; }

Property Value

Collection of bone transforms.

Expand image Remarks

You can pass this matrix list to AvatarRenderer.Draw using the bones parameter. This allows the developer to modify the position of one or more avatar bones before rendering the model.

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimation.CurrentPosition Property

AvatarAnimation.CurrentPosition Property

Gets or sets the current time position in the animation.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public TimeSpan CurrentPosition { get; set; }

Property Value

Current time position of the animation.

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimation.Expression Property

AvatarAnimation.Expression Property

Gets the expression of the related animation at the current time position.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarExpression Expression { get; }

Property Value

Expression of the avatar.

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimation.IsDisposed Property

AvatarAnimation.IsDisposed Property

Gets the disposed state of the avatar animation.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the animation has been disposed; otherwise, false.

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimation.Length Property

AvatarAnimation.Length Property

Gets the length of the current animation.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public TimeSpan Length { get; }

Property Value

Length of the animation.

Expand image See Also

Reference

AvatarAnimation Class
AvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarAnimationPreset Enumeration

AvatarAnimationPreset Enumeration

Defines standard animations for avatars.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public enum AvatarAnimationPreset

Expand image Members

Member name | Description
Celebrate | Gender-neutral, celebrating.
Clap | Gender-neutral, applauding.
FemaleAngry | Female, angry.
FemaleConfused | Female, confused.
FemaleCry | Female, cry.
FemaleIdleCheckNails | Female, checking nails.
FemaleIdleFixShoe | Female, fixing shoe.
FemaleIdleLookAround | Female, looking around.
FemaleIdleShiftWeight | Female, shifting weight from one foot to another
FemaleLaugh | Female, laughing.
FemaleShocked | Female, shocked or surprised.
FemaleYawn | Female, yawning.
MaleAngry | Male, angry.
MaleConfused | Male, confused.
MaleCry | Male, crying.
MaleIdleCheckHand | Male, checking hand.
MaleIdleLookAround | Male, looking around.
MaleIdleShiftWeight | Male, shifting weight from one foot to another.
MaleIdleStretch | Male, stretching.
MaleLaugh | Male, laughing.
MaleSurprised | Male, surprised.
MaleYawn | Male, yawning.
Stand0 | Gender-neutral, standing, variation 0.
Stand1 | Gender-neutral, standing, variation 1.
Stand2 | Gender-neutral, standing, variation 2.
Stand3 | Gender-neutral, standing, variation 3.
Stand4 | Gender-neutral, standing, variation 4.
Stand5 | Gender-neutral, standing, variation 5.
Stand6 | Gender-neutral, standing, variation 6.
Stand7 | Gender-neutral, standing, variation 7.
Wave | Gender-neutral, waving.

Expand image See Also

Reference

Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarBodyType Enumeration

AvatarBodyType Enumeration

Defines the body type of the avatar.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public enum AvatarBodyType

Expand image Members

Member name | Description
Female | Female avatar.
Male | Male avatar.

Expand image See Also

Reference

Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarBone Enumeration

AvatarBone Enumeration

Defines a list of the useful bones of the avatar model. This is not a complete list of avatar bones. Some values are not listed. Unlisted bone indices are special and used only when building an animation in an animation package.

Bone indices are sorted by depth value.

Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public enum AvatarBone

Expand image Members

Member name | Value | Description
AnkleLeft | 11 | Left ankle.
AnkleRight | 15 | Right ankle.
BackLower | 1 | Lower back.
BackUpper | 5 | Upper back.
CollarLeft | 12 | Left collar.
CollarRight | 16 | Right collar
ElbowLeft | 25 | Left elbow
ElbowRight | 28 | Right elbow
FingerIndex2Left | 51 | Left index finger, 2nd joint.
FingerIndex2Right | 56 | Right index finger, 2nd joint.
FingerIndex3Left | 61 | Left index finger, 3rd joint.
FingerIndex3Right | 66 | Right index finger, 3rd joint.
FingerIndexLeft | 37 | Left index finger, 1st joint.
FingerIndexRight | 44 | Right index finger, 1st joint.
FingerMiddle2Left | 52 | Left middle finger, 2nd joint.
FingerMiddle2Right | 57 | Right middle finger, 2nd joint.
FingerMiddle3Left | 62 | Left middle finger, 3rd joint.
FingerMiddle3Right | 67 | Right middle finger, 3rd joint.
FingerMiddleLeft | 38 | Left middle finger, 1st joint.
FingerMiddleRight | 45 | Right middle finger, 1st joint.
FingerRing2Left | 53 | Left ring finger, 2nd joint.
FingerRing2Right | 58 | Right ring finger, 2nd joint.
FingerRing3Left | 63 | Left ring finger, 3rd joint.
FingerRing3Right | 68 | Right ring finger, 3rd joint.
FingerRingLeft | 39 | Left ring finger, 1st joint.
FingerRingRight | 46 | Right ring finger, 1st joint.
FingerSmall2Left | 54 | Left pinky finger, 2nd joint.
FingerSmall2Right | 59 | Right pinky finger, 2nd joint.
FingerSmall3Left | 64 | Left pinky finger, 3rd joint.
FingerSmall3Right | 69 | Right pinky finger, 3rd joint.
FingerSmallLeft | 40 | Left pinky finger, 1st joint.
FingerSmallRight | 47 | Right pinky finger, 2nd joint.
FingerThumb2Left | 55 | Left thumb, 2nd joint.
FingerThumb2Right | 60 | Right thumb, 2nd joint.
FingerThumb3Left | 65 | Left thumb, 3rd joint.
FingerThumb3Right | 70 | Right thumb, 3rd joint.
FingerThumbLeft | 43 | Left thumb, 1st joint.
FingerThumbRight | 50 | Right thumb, 1st joint.
Head | 19 | Head
HipLeft | 2 | Left hip.
HipRight | 3 | Right hip.
KneeLeft | 6 | Left knee.
Neck | 14 | Neck.
PropLeft | 41 | A separate object held in the left hand.
PropRight | 48 | A separate object held in the left hand.
KneeRight | 8 | Right knee.
Root | 0 | Root bone of the avatar skeleton.
ShoulderLeft | 20 | Left shoulder.
ShoulderRight | 22 | Right shoulder.
SpecialLeft | 42 | A special bone located near the left hand of the avatar model.
SpecialRight | 49 | A special bone located near the right hand of the avatar model.
ToeLeft | 21 | Left toe.
ToeRight | 23 | Right toe.
WristLeft | 33 | Left wrist.
WristRight | 36 | Right wrist.

Expand image See Also

Reference

Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription Class

AvatarDescription Class
See Also Members
CollapseAll image

Provides access to the methods and properties of the description data for an avatar.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public class AvatarDescription

Expand image Remarks

The AvatarDescription object contains an internal data buffer used by the avatar renderer when loading and animating a gamer's avatar. There are also methods for getting the height and gender of the avatar.

AvatarDescription also provides a number of methods that you can use to create a new random AvatarDescription object or to retrieve one from an existing avatar description buffer.

Expand image See Also

Reference

AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription Members

AvatarDescription Members
See Also Constructors Events Methods Properties
CollapseAll image

The following tables list the members exposed by the AvatarDescription type.

Expand image Public Constructors

 | Name | Description
Public Method | AvatarDescription | Creates a new instance of AvatarDescription using an existing data buffer.

Expand image Public Properties

 | Name | Description
Public Property | BodyType | Gets the body type of the avatar based on the description data.
Public Property | Description | Internal description buffer of the avatar, stored as a byte buffer.
Public Property | Height | Height of the avatar, from the feet to the top of the head.
Public Property | IsValid | Determines whether the internal data buffer is valid.

Expand image Public Methods

 | Name | Description
 | BeginGetFromGamer | Begins the process of getting a AvatarDescription object for a specified gamertag.
 | CreateRandom | Overloaded. Creates an AvatarDescription object with random gender, features, and clothing.
 | EndGetFromGamer | Ends the process of getting an AvatarDescription object for a specified gamertag.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Changed | Occurs when a gamer's avatar changes.

Expand image See Also

Reference

AvatarDescription Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarDescription Constructor

AvatarDescription Constructor

Creates a new instance of AvatarDescription using an existing data buffer.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarDescription (
         byte[] data
)

Parameters

data

Existing buffer used to store the information of the newly-created avatar.

Use the buffer specified by the Description property of a valid AvatarDescription object. Common scenarios include the recreation of random avatars that were created earlier or when avatar decription data is sent over a network to all signed-in gamers. Once that data is received, local avatar descriptions and renderers are created for each remote gamer avatar.

Results are undefined if buffers from other sources are used.

Expand image See Also

Reference

AvatarDescription Class
AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription Methods

AvatarDescription Methods

Expand image Public Methods

 | Name | Description
 | BeginGetFromGamer | Begins the process of getting a AvatarDescription object for a specified gamertag.
 | CreateRandom | Overloaded. Creates an AvatarDescription object with random gender, features, and clothing.
 | EndGetFromGamer | Ends the process of getting an AvatarDescription object for a specified gamertag.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AvatarDescription Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarDescription.BeginGetFromGamer Method

AvatarDescription.BeginGetFromGamer Method

Begins the process of getting a AvatarDescription object for a specified gamertag.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public static IAsyncResult BeginGetFromGamer (
         Gamer gamer,
         AsyncCallback callback,
         Object state
)

Parameters

gamer
Gamer to request the AvatarDescription for.
callback
The method to be called once the asynchronous operation has finished.
state
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method. Call EndGetFromGamer to access these results.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

AvatarDescription Class
AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription.CreateRandom Method

AvatarDescription.CreateRandom Method

Creates an AvatarDescription object with random gender, features, and clothing.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Expand image Overload List

Name | Description
AvatarDescription.CreateRandom () | Creates an avatar of random gender, features, and clothing.
AvatarDescription.CreateRandom (AvatarBodyType) | Creates an avatar of the specified body type with random features and clothing.

Expand image See Also

Reference

AvatarDescription Class
AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace


AvatarDescription.CreateRandom Method ()

AvatarDescription.CreateRandom Method ()
See Also
CollapseAll image

Creates an avatar of random gender, features, and clothing.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public static AvatarDescription CreateRandom ()

Return Value

Description of the created avatar.

Expand image See Also

Reference

AvatarDescription Class
AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription.CreateRandom Method (AvatarBodyType)

AvatarDescription.CreateRandom Method (AvatarBodyType)
See Also
CollapseAll image

Creates an avatar of the specified body type with random features and clothing.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public static AvatarDescription CreateRandom (
         AvatarBodyType bodyType
)

Parameters

bodyType
Body type of the randomly-created avatar.

Return Value

Description of the created avatar.

Expand image Remarks

It is possible that a newly-created random AvatarDescription object could be an invalid avatar description buffer. For instance, the related AvatarDescription object was created by a call to CreateRandom, from within a Windows application.

Expand image See Also

Reference

AvatarDescription Class
AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription.EndGetFromGamer Method

AvatarDescription.EndGetFromGamer Method

Ends the process of getting an AvatarDescription object for a specified gamertag.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public static AvatarDescription EndGetFromGamer (
         IAsyncResult result
)

Parameters

result
An IAsyncResult used to track the progress of the operation.

Return Value

The AvatarDescription object for the specified gamertag.

Expand image See Also

Reference

AvatarDescription Class
AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription Properties

AvatarDescription Properties

Expand image Public Properties

 | Name | Description
Public Property | BodyType | Gets the body type of the avatar based on the description data.
Public Property | Description | Internal description buffer of the avatar, stored as a byte buffer.
Public Property | Height | Height of the avatar, from the feet to the top of the head.
Public Property | IsValid | Determines whether the internal data buffer is valid.

Expand image See Also

Reference

AvatarDescription Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarDescription.BodyType Property

AvatarDescription.BodyType Property

Gets the body type of the avatar based on the description data.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarBodyType BodyType { get; }

Property Value

Body type of the avatar.

Expand image See Also

Reference

AvatarDescription Class
AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription.Description Property

AvatarDescription.Description Property

Internal description buffer of the avatar, stored as a byte buffer.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public byte[] Description { get; }

Property Value

Description buffer of the avatar.

Expand image See Also

Reference

AvatarDescription Class
AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription.Height Property

AvatarDescription.Height Property

Height of the avatar, from the feet to the top of the head.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public float Height { get; }

Property Value

Height, in meters, of the avatar.

Expand image See Also

Reference

AvatarDescription Class
AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription.IsValid Property

AvatarDescription.IsValid Property

Determines whether the internal data buffer is valid.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public bool IsValid { get; }

Property Value

true if the related AvatarDescription object contains a valid avatar description, usable by an AvatarRenderer object; otherwise, false.

IsValid always returns false on Windows because currently there is no Windows-based avatar implementation.

Expand image Remarks

This property is provided only as a quick verification method for developers that receive an AvatarDescription object from the XNA framework. For example, a value of false could indicate that the user does not have an avatar.

Expand image See Also

Reference

AvatarDescription Class
AvatarDescription Members
AvatarDescription
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarDescription Events

AvatarDescription Events

Expand image Public Events

 | Name | Description
Public Event | Changed | Occurs when a gamer's avatar changes.

Expand image See Also

Reference

AvatarDescription Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarDescription.Changed Event

AvatarDescription.Changed Event

Occurs when a gamer's avatar changes.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Changed

Expand image See Also

Reference

AvatarDescription Class
AvatarDescription Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarExpression Structure

AvatarExpression Structure

Contains the various components of the avatar's face, such as the left and right eyebrows.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public struct AvatarExpression

Expand image See Also

Reference

AvatarExpression Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarExpression Members

AvatarExpression Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the AvatarExpression type.

Expand image Public Properties

 | Name | Description
Public Property | LeftEye | Gets or sets the current texture for the avatar's left eye.
Public Property | LeftEyebrow | Gets or sets the current texture for the avatar's left eye.
Public Property | Mouth | Gets or sets the current texture for the avatar's mouth.
Public Property | RightEye | Gets or sets the current texture for the avatar's right eye.
Public Property | RightEyebrow | Gets or sets the current texture for the avatar's right eyebrow.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AvatarExpression Structure
Microsoft.Xna.Framework.GamerServices Namespace


AvatarExpression Methods

AvatarExpression Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AvatarExpression Structure
Microsoft.Xna.Framework.GamerServices Namespace


AvatarExpression Properties

AvatarExpression Properties

Expand image Public Properties

 | Name | Description
Public Property | LeftEye | Gets or sets the current texture for the avatar's left eye.
Public Property | LeftEyebrow | Gets or sets the current texture for the avatar's left eye.
Public Property | Mouth | Gets or sets the current texture for the avatar's mouth.
Public Property | RightEye | Gets or sets the current texture for the avatar's right eye.
Public Property | RightEyebrow | Gets or sets the current texture for the avatar's right eyebrow.

Expand image See Also

Reference

AvatarExpression Structure
Microsoft.Xna.Framework.GamerServices Namespace


AvatarExpression.LeftEye Property

AvatarExpression.LeftEye Property

Gets or sets the current texture for the avatar's left eye.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarEye LeftEye { get; set; }

Property Value

Texture of the avatar's left eye.

Expand image See Also

Reference

AvatarExpression Structure
AvatarExpression Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarExpression.LeftEyebrow Property

AvatarExpression.LeftEyebrow Property

Gets or sets the current texture for the avatar's left eye.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarEyebrow LeftEyebrow { get; set; }

Property Value

Texture of the avatar's left eyebrow.

Expand image See Also

Reference

AvatarExpression Structure
AvatarExpression Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarExpression.Mouth Property

AvatarExpression.Mouth Property

Gets or sets the current texture for the avatar's mouth.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarMouth Mouth { get; set; }

Property Value

Texture of the avatar's mouth.

Expand image See Also

Reference

AvatarExpression Structure
AvatarExpression Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarExpression.RightEye Property

AvatarExpression.RightEye Property

Gets or sets the current texture for the avatar's right eye.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarEye RightEye { get; set; }

Property Value

Texture of the avatar's right eye.

Expand image See Also

Reference

AvatarExpression Structure
AvatarExpression Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarExpression.RightEyebrow Property

AvatarExpression.RightEyebrow Property

Gets or sets the current texture for the avatar's right eyebrow.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarEyebrow RightEyebrow { get; set; }

Property Value

Texture of the avatar's right eyebrow.

Expand image See Also

Reference

AvatarExpression Structure
AvatarExpression Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarEye Enumeration

AvatarEye Enumeration

Defines the standard animation textures for an avatar's eyes.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public enum AvatarEye

Expand image Members

Member name | Description
Angry | Angry eye position.
Blink | Blinking eye position.
Confused | Confused eye position.
Happy | Happy eye position.
Laughing | Laughing eye position.
LookDown | Looking down eye position.
LookLeft | Looking left position.
LookRight | Looking right eye position.
LookUp | Looking up eye position.
Neutral | Neutral eye position.
Sad | Sad eye position.
Shocked | Shocked eye position.
Sleeping | Sleeping eye position.
Yawning | Yawning eye position.

Expand image See Also

Reference

Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarEyebrow Enumeration

AvatarEyebrow Enumeration

Defines the standard animation textures for an avatar's eyebrows.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public enum AvatarEyebrow

Expand image Members

Member name | Description
Angry | Angry eyebrow position.
Confused | Confused eyebrow position.
Neutral | Neutral eyebrow position.
Raised | Raised eyebrow position.
Sad | Sad eyebrow position.

Expand image See Also

Reference

Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarMouth Enumeration

AvatarMouth Enumeration

Defines the standard animation textures for an avatar's mouth.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public enum AvatarMouth

Expand image Members

Member name | Description
Angry | Angry mouth position.
Confused | Confused mouth position.
Happy | Happy mouth position.
Laughing | Laughing mouth position.
Neutral | Neutral mouth position.
PhoneticAi | Phonetic "ai" mouth position (for lip sync).
PhoneticDth | Phonetic "dth" mouth position (for lip sync).
PhoneticEe | Phonetic "ee" mouth position (for lip sync).
PhoneticFv | Phonetic "fv" mouth position (for lip sync).
PhoneticL | Phonetic "l" mouth position (for lip sync).
PhoneticO | Phonetic "o" mouth position (for lip sync).
PhoneticW | Phonetic "w" mouth position (for lip sync).
Sad | Sad mouth position.
Shocked | Shocked mouth position.

Expand image See Also

Reference

Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer Class

AvatarRenderer Class
See Also Members
CollapseAll image

Provides properties and methods for rendering a standard avatar.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public class AvatarRenderer : IDisposable

Expand image Remarks

Use this class, in conjunction with AvatarAnimation, to render an avatar model using standard animations. For more information, see Rendering and Animating Avatars (Xbox 360).

Expand image See Also

Reference

AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer Members

AvatarRenderer Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the AvatarRenderer type.

Expand image Public Constructors

 | Name | Description
Public Method | AvatarRenderer | Overloaded. Creates a new instance of AvatarRenderer.

Expand image Public Fields

 | Name | Description
Public Field | BoneCount | Number of bones in the avatar model.

Expand image Public Properties

 | Name | Description
Public Property | AmbientLightColor | Gets or sets the color of the ambient light used by the avatar renderer.
Public Property | BindPose | Gets the collection of bind pose positions for each bone of the avatar model.
Public Property | IsDisposed | Gets the disposed state of the avatar renderer.
Public Property | LightColor | Gets or sets the color of the directional light used by the avatar renderer.
Public Property | LightDirection | Gets or sets the color of the directional light used by the avatar renderer.
Public Property | ParentBones | Collection of the parent indices for each bone in the related BindPose collection.
Public Property | Projection | Gets or sets the projection matrix for the avatar.
Public Property | State | Gets the state of the avatar.
Public Property | View | Gets or sets the view matrix for the avatar.
Public Property | World | Gets or sets the world matrix for the avatar.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Draw | Overloaded. Draws the avatar to the current render target.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows the avatar renderer to attempt to free resources and perform other cleanup operations before garbage collection reclaims the renderer.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AvatarRenderer Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarRenderer Fields

AvatarRenderer Fields

Expand image Public Fields

 | Name | Description
Public Field | BoneCount | Number of bones in the avatar model.

Expand image See Also

Reference

AvatarRenderer Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarRenderer.BoneCount Field

AvatarRenderer.BoneCount Field

Number of bones in the avatar model.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public const int BoneCount

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer Constructor

AvatarRenderer Constructor

Creates a new instance of AvatarRenderer.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Expand image Overload List

Name | Description
AvatarRenderer (AvatarDescription) | Creates a new instance of AvatarRenderer with the specified description.
AvatarRenderer (AvatarDescription, Boolean) | Creates a new instance of AvatarRenderer with the specified description.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace


AvatarRenderer Constructor (AvatarDescription)

AvatarRenderer Constructor (AvatarDescription)
See Also
CollapseAll image

Creates a new instance of AvatarRenderer with the specified description.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarRenderer (
         AvatarDescription avatarDescription
)

Parameters

avatarDescription
Description of the avatar to be rendered.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer Constructor (AvatarDescription, Boolean)

AvatarRenderer Constructor (AvatarDescription, Boolean)
See Also
CollapseAll image

Creates a new instance of AvatarRenderer with the specified description. The standard loading effect can also be requested. This effect is animated, indicating that the avatar currently is loading.

Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Figure 1. Avatar loading effect

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarRenderer (
         AvatarDescription avatarDescription,
         bool useLoadingEffect
)

Parameters

avatarDescription
Description of the avatar to be rendered.
useLoadingEffect
true if the standard effect is to be used during loading; otherwise, false.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer Methods

AvatarRenderer Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Draw | Overloaded. Draws the avatar to the current render target.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows the avatar renderer to attempt to free resources and perform other cleanup operations before garbage collection reclaims the renderer.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AvatarRenderer Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarRenderer.Dispose Method

AvatarRenderer.Dispose Method

Immediately releases the unmanaged resources used by this object.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Expand image Overload List

Name | Description
AvatarRenderer.Dispose () | Immediately releases the unmanaged resources used by this object.
AvatarRenderer.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace


AvatarRenderer.Dispose Method ()

AvatarRenderer.Dispose Method ()
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.Dispose Method (Boolean)

AvatarRenderer.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool disposing
)

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.Draw Method

AvatarRenderer.Draw Method

Draws the avatar to the current render target.

Expand image Overload List

Name | Description
AvatarRenderer.Draw (Generic IList, AvatarExpression) | Draws the avatar to the current render target.
AvatarRenderer.Draw (IAvatarAnimation) | Draws the avatar to the current render target.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace


AvatarRenderer.Draw Method (Generic IList, AvatarExpression)

AvatarRenderer.Draw Method (Generic IList, AvatarExpression)
See Also
CollapseAll image

Draws the avatar to the current render target.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public void Draw (
         IList<Matrix> bones,
         AvatarExpression expression
)

Parameters

bones
Collection of current bone transforms for the avatar. The transforms are in local bone space relative to their parent.
expression
Current expression textures for the avatar.

Expand image Remarks

If any avatar assets are not loaded, the standard loading effect is displayed (determined by the renderer's constructor call). Determine the current loading state by checking the value of the State property.

The avatar model is always rendered as if FillMode.Solid is the current fill mode value.

Note
The AvatarRenderer class requires each bone transformation to be decomposable. Passing a bone transformation matrix that is not decomposable to AvatarRenderer.Draw will result in a InvalidOperationException exception. Use Decompose on each matrix to ensure each matrix in the bone matrix collection is decomposable. If the matrix in question is not decomposable, Decompose will return false.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.Draw Method (IAvatarAnimation)

AvatarRenderer.Draw Method (IAvatarAnimation)
See Also
CollapseAll image

Draws the avatar to the current render target.

Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public void Draw (
         IAvatarAnimation animation
)

Parameters

animation
The animation to draw.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.Finalize Method

AvatarRenderer.Finalize Method

Allows the avatar renderer to attempt to free resources and perform other cleanup operations before garbage collection reclaims the renderer.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer Properties

AvatarRenderer Properties

Expand image Public Properties

 | Name | Description
Public Property | AmbientLightColor | Gets or sets the color of the ambient light used by the avatar renderer.
Public Property | BindPose | Gets the collection of bind pose positions for each bone of the avatar model.
Public Property | IsDisposed | Gets the disposed state of the avatar renderer.
Public Property | LightColor | Gets or sets the color of the directional light used by the avatar renderer.
Public Property | LightDirection | Gets or sets the color of the directional light used by the avatar renderer.
Public Property | ParentBones | Collection of the parent indices for each bone in the related BindPose collection.
Public Property | Projection | Gets or sets the projection matrix for the avatar.
Public Property | State | Gets the state of the avatar.
Public Property | View | Gets or sets the view matrix for the avatar.
Public Property | World | Gets or sets the world matrix for the avatar.

Expand image See Also

Reference

AvatarRenderer Class
Microsoft.Xna.Framework.GamerServices Namespace


AvatarRenderer.AmbientLightColor Property

AvatarRenderer.AmbientLightColor Property

Gets or sets the color of the ambient light used by the avatar renderer.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public Vector3 AmbientLightColor { get; set; }

Property Value

Color of the ambient light.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.BindPose Property

AvatarRenderer.BindPose Property

Gets the collection of bind pose positions for each bone of the avatar model. These positions are in local space, and are relative to the parent bone.

Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public ReadOnlyCollection<Matrix> BindPose { get; }

Property Value

Collection of bind pose positions for the bones of the avatar model.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.IsDisposed Property

AvatarRenderer.IsDisposed Property

Gets the disposed state of the avatar renderer.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the renderer has been disposed; otherwise false.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.LightColor Property

AvatarRenderer.LightColor Property

Gets or sets the color of the directional light used by the avatar renderer.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public Vector3 LightColor { get; set; }

Property Value

Color of the directional light.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.LightDirection Property

AvatarRenderer.LightDirection Property

Gets or sets the color of the directional light used by the avatar renderer.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public Vector3 LightDirection { get; set; }

Property Value

Vector of the directional light.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.ParentBones Property

AvatarRenderer.ParentBones Property

Collection of the parent indices for each bone in the related BindPose collection.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public ReadOnlyCollection<int> ParentBones { get; }

Property Value

Collection of parent bone indices.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.Projection Property

AvatarRenderer.Projection Property

Gets or sets the projection matrix for the avatar.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public Matrix Projection { get; set; }

Property Value

Projection matrix used by the avatar renderer.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.State Property

AvatarRenderer.State Property

Gets the state of the avatar.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarRendererState State { get; }

Property Value

Avatar state.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
AvatarRendererState Enumeration
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.View Property

AvatarRenderer.View Property

Gets or sets the view matrix for the avatar.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public Matrix View { get; set; }

Property Value

View matrix used by the avatar renderer.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRenderer.World Property

AvatarRenderer.World Property

Gets or sets the world matrix for the avatar.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public Matrix World { get; set; }

Property Value

World matrix used by the avatar renderer.

Expand image See Also

Reference

AvatarRenderer Class
AvatarRenderer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvatarRendererState Enumeration

AvatarRendererState Enumeration

Indicates avatar state.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public enum AvatarRendererState

Expand image Members

Member name | Value | Description
Loading | 0 | The avatar is still loading required assets.
Ready | 1 | Loading is complete.
Unavailable | 2 | The avatar is unavailable.

Expand image See Also

Reference

Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


ControllerSensitivity Enumeration

ControllerSensitivity Enumeration

Indicates how sensitive this gamer prefers controller input to be.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public enum ControllerSensitivity

Expand image Members

Member name | Description
High | Highly sensitive controller input is preferred.
Low | Below average sensitivity is preferred.
Medium | Average controller sensitivity is preferred.

Expand image See Also

Reference

GameDefaults.ControllerSensitivity Property
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendCollection Class

FriendCollection Class
See Also Members
CollapseAll image

Represents the complete friends list of a local gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class FriendCollection : GamerCollection<FriendGamer>, IDisposable

Expand image See Also

Reference

FriendCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendCollection Members

FriendCollection Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the FriendCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from GamerCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FriendCollection Class
Microsoft.Xna.Framework.GamerServices Namespace


FriendCollection Methods

FriendCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from GamerCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FriendCollection Class
Microsoft.Xna.Framework.GamerServices Namespace


FriendCollection.Dispose Method

FriendCollection.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image Remarks

Call Dispose when you are finished using the FriendCollection. The Dispose method leaves the FriendCollection in an unusable state. After calling Dispose, you must release all references to the FriendCollection so the garbage collector can reclaim the memory that the FriendCollection was occupying.
Note
Always call Dispose before you release your last reference to the FriendCollection.

Expand image See Also

Reference

FriendCollection Class
FriendCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendCollection Properties

FriendCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

FriendCollection Class
Microsoft.Xna.Framework.GamerServices Namespace


FriendCollection.IsDisposed Property

FriendCollection.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

FriendCollection Class
FriendCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer Class

FriendGamer Class
See Also Members
CollapseAll image

Provides the presence information of a friend of the local gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class FriendGamer : Gamer

Expand image See Also

Reference

FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer Members

FriendGamer Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the FriendGamer type.

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | (Inherited from Gamer.)
Public Property | FriendRequestReceivedFrom | Gets whether the local gamer who requested the friends list has received a friend request from this gamer.
Public Property | FriendRequestSentTo | Gets whether the local gamer who requested the friends list has sent a friend request to this gamer.
Public Property | Gamertag | (Inherited from Gamer.)
Public Property | HasVoice | Gets whether this friend currently has voice capability.
Public Property | InviteAccepted | Gets whether this friend has accepted an invitation from the local gamer who requested the friends list.
Public Property | InviteReceivedFrom | Gets whether the local gamer who requested the friends list has received an invitation from this friend.
Public Property | InviteRejected | Gets whether this friend has rejected an invitation from the local gamer who requested the friends list.
Public Property | InviteSentTo | Gets whether the local gamer who requested the friends list has sent an invitation to this friend.
Public Property | IsAway | Gets whether this friend is currently away from the computer or console.
Public Property | IsBusy | Gets whether this friend is currently busy.
Public Property | IsDisposed | (Inherited from Gamer.)
Public Property | IsJoinable | Gets whether this friend is currently in a public session that can be joined.
Public Property | IsOnline | Gets whether this friend is currently online.
Public Property | IsPlaying | Gets whether this friend is currently playing a game.
Public Property | LeaderboardWriter | (Inherited from Gamer.)
Public Property | Presence | Gets a title-defined presence string describing what this friend is currently doing.
Public Property | Tag | (Inherited from Gamer.)

Expand image Public Methods

 | Name | Description
Public Method | BeginGetProfile | (Inherited from Gamer.)
Public Method | EndGetProfile | (Inherited from Gamer.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProfile | (Inherited from Gamer.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Gamer.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FriendGamer Class
Microsoft.Xna.Framework.GamerServices Namespace


FriendGamer Methods

FriendGamer Methods

Expand image Public Methods

 | Name | Description
Public Method | BeginGetProfile | (Inherited from Gamer.)
Public Method | EndGetProfile | (Inherited from Gamer.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProfile | (Inherited from Gamer.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Gamer.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FriendGamer Class
Microsoft.Xna.Framework.GamerServices Namespace


FriendGamer Properties

FriendGamer Properties

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | (Inherited from Gamer.)
Public Property | FriendRequestReceivedFrom | Gets whether the local gamer who requested the friends list has received a friend request from this gamer.
Public Property | FriendRequestSentTo | Gets whether the local gamer who requested the friends list has sent a friend request to this gamer.
Public Property | Gamertag | (Inherited from Gamer.)
Public Property | HasVoice | Gets whether this friend currently has voice capability.
Public Property | InviteAccepted | Gets whether this friend has accepted an invitation from the local gamer who requested the friends list.
Public Property | InviteReceivedFrom | Gets whether the local gamer who requested the friends list has received an invitation from this friend.
Public Property | InviteRejected | Gets whether this friend has rejected an invitation from the local gamer who requested the friends list.
Public Property | InviteSentTo | Gets whether the local gamer who requested the friends list has sent an invitation to this friend.
Public Property | IsAway | Gets whether this friend is currently away from the computer or console.
Public Property | IsBusy | Gets whether this friend is currently busy.
Public Property | IsDisposed | (Inherited from Gamer.)
Public Property | IsJoinable | Gets whether this friend is currently in a public session that can be joined.
Public Property | IsOnline | Gets whether this friend is currently online.
Public Property | IsPlaying | Gets whether this friend is currently playing a game.
Public Property | LeaderboardWriter | (Inherited from Gamer.)
Public Property | Presence | Gets a title-defined presence string describing what this friend is currently doing.
Public Property | Tag | (Inherited from Gamer.)

Expand image See Also

Reference

FriendGamer Class
Microsoft.Xna.Framework.GamerServices Namespace


FriendGamer.FriendRequestReceivedFrom Property

FriendGamer.FriendRequestReceivedFrom Property

Gets whether the local gamer who requested the friends list has received a friend request from this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool FriendRequestReceivedFrom { get; }

Property Value

true if the local gamer who requested the friends list has received a friend request from this gamer; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.FriendRequestSentTo Property

FriendGamer.FriendRequestSentTo Property

Gets whether the local gamer who requested the friends list has sent a friend request to this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool FriendRequestSentTo { get; }

Property Value

true if the local gamer who requested the friends list has sent a friend request to this gamer; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.HasVoice Property

FriendGamer.HasVoice Property

Gets whether this friend currently has voice capability.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool HasVoice { get; }

Property Value

true if this friend currently has voice capability; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.InviteAccepted Property

FriendGamer.InviteAccepted Property

Gets whether this friend has accepted an invitation from the local gamer who requested the friends list.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool InviteAccepted { get; }

Property Value

true if this friend has accepted an invitation from the local gamer who requested the friends list; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.InviteReceivedFrom Property

FriendGamer.InviteReceivedFrom Property

Gets whether the local gamer who requested the friends list has received an invitation from this friend.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool InviteReceivedFrom { get; }

Property Value

true if the local gamer who requested the friends list has received an invitation from this friend; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.InviteRejected Property

FriendGamer.InviteRejected Property

Gets whether this friend has rejected an invitation from the local gamer who requested the friends list.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool InviteRejected { get; }

Property Value

true if this friend has rejected an invitation from the local gamer who requested the friends list; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.InviteSentTo Property

FriendGamer.InviteSentTo Property

Gets whether the local gamer who requested the friends list has sent an invitation to this friend.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool InviteSentTo { get; }

Property Value

true if the local gamer who requested the friends list has sent an invitation to this friend; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.IsAway Property

FriendGamer.IsAway Property

Gets whether this friend is currently away from the computer or console.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsAway { get; }

Property Value

true if this friend is currently away from the computer or console; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.IsBusy Property

FriendGamer.IsBusy Property

Gets whether this friend is currently busy.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsBusy { get; }

Property Value

true if this friend is currently busy; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.IsJoinable Property

FriendGamer.IsJoinable Property

Gets whether this friend is currently in a public session that can be joined.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsJoinable { get; }

Property Value

true if this friend is currently in a public session that can be joined; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.IsOnline Property

FriendGamer.IsOnline Property

Gets whether this friend is currently online.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsOnline { get; }

Property Value

true if this friend is currently online; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.IsPlaying Property

FriendGamer.IsPlaying Property

Gets whether this friend is currently playing a game.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsPlaying { get; }

Property Value

true if this friend is currently playing a game; false otherwise.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


FriendGamer.Presence Property

FriendGamer.Presence Property

Gets a title-defined presence string describing what this friend is currently doing.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public string Presence { get; }

Property Value

Title-defined presence string describing what this friend is currently doing.

Expand image See Also

Reference

FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults Class

GameDefaults Class
See Also Members
CollapseAll image

Describes a gamer's preferred settings.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class GameDefaults

Expand image Remarks

Wherever possible, games should default to the values specified in GameDefaults.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults Members

GameDefaults Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the GameDefaults type.

Expand image Public Properties

 | Name | Description
Public Property | AccelerateWithButtons | Gets the gamer's preference for using controller buttons to accelerate in racing games.
Public Property | AutoAim | Gets whether the title should automatically correct the gamer's aim.
Public Property | AutoCenter | Gets whether the title should automatically center the view when the gamer moves.
Public Property | BrakeWithButtons | Gets the gamer's preference for using controller buttons to brake in racing games.
Public Property | ControllerSensitivity | Gets the preferred controller sensitivity setting for this gamer.
Public Property | GameDifficulty | Gets the preferred difficulty setting for this gamer.
Public Property | InvertYAxis | Gets the gamer's preference for inverting the y-axis input of the controller.
Public Property | ManualTransmission | Gets the gamer's preference for driving a manual shift transmission in racing games.
Public Property | MoveWithRightThumbStick | Gets the gamer's preference for moving by using the right thumbstick.
Public Property | PrimaryColor | Gets the preferred color for the player character.
Public Property | RacingCameraAngle | Gets the gamer's preferred camera angle for racing games.
Public Property | SecondaryColor | Gets a secondary color selection for the player character.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
Microsoft.Xna.Framework.GamerServices Namespace


GameDefaults Methods

GameDefaults Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameDefaults Class
Microsoft.Xna.Framework.GamerServices Namespace


GameDefaults Properties

GameDefaults Properties

Expand image Public Properties

 | Name | Description
Public Property | AccelerateWithButtons | Gets the gamer's preference for using controller buttons to accelerate in racing games.
Public Property | AutoAim | Gets whether the title should automatically correct the gamer's aim.
Public Property | AutoCenter | Gets whether the title should automatically center the view when the gamer moves.
Public Property | BrakeWithButtons | Gets the gamer's preference for using controller buttons to brake in racing games.
Public Property | ControllerSensitivity | Gets the preferred controller sensitivity setting for this gamer.
Public Property | GameDifficulty | Gets the preferred difficulty setting for this gamer.
Public Property | InvertYAxis | Gets the gamer's preference for inverting the y-axis input of the controller.
Public Property | ManualTransmission | Gets the gamer's preference for driving a manual shift transmission in racing games.
Public Property | MoveWithRightThumbStick | Gets the gamer's preference for moving by using the right thumbstick.
Public Property | PrimaryColor | Gets the preferred color for the player character.
Public Property | RacingCameraAngle | Gets the gamer's preferred camera angle for racing games.
Public Property | SecondaryColor | Gets a secondary color selection for the player character.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
Microsoft.Xna.Framework.GamerServices Namespace


GameDefaults.AccelerateWithButtons Property

GameDefaults.AccelerateWithButtons Property

Gets the gamer's preference for using controller buttons to accelerate in racing games.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool AccelerateWithButtons { get; }

Property Value

true if the gamer prefers to use controller buttons to accelerate in racing games; false otherwise. If false, use triggers for acceleration.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always false.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.AutoAim Property

GameDefaults.AutoAim Property

Gets whether the title should automatically correct the gamer's aim.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool AutoAim { get; }

Property Value

true if the title should automatically correct the gamer's aim; false otherwise.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always true.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.AutoCenter Property

GameDefaults.AutoCenter Property

Gets whether the title should automatically center the view when the gamer moves.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool AutoCenter { get; }

Property Value

true if the title should automatically center the view when the gamer moves; false otherwise.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always true.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.BrakeWithButtons Property

GameDefaults.BrakeWithButtons Property

Gets the gamer's preference for using controller buttons to brake in racing games.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool BrakeWithButtons { get; }

Property Value

true if the gamer prefers to use controller buttons to brake in racing games; false otherwise. If false, use the triggers for braking.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always false.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.ControllerSensitivity Property

GameDefaults.ControllerSensitivity Property

Gets the preferred controller sensitivity setting for this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public ControllerSensitivity ControllerSensitivity { get; }

Property Value

The preferred controller sensitivity setting for this gamer.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always Medium.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.GameDifficulty Property

GameDefaults.GameDifficulty Property

Gets the preferred difficulty setting for this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GameDifficulty GameDifficulty { get; }

Property Value

The preferred difficulty setting for this gamer.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always Normal.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.InvertYAxis Property

GameDefaults.InvertYAxis Property

Gets the gamer's preference for inverting the y-axis input of the controller.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool InvertYAxis { get; }

Property Value

true if the gamer prefers to invert the y-axis input of the controller; false otherwise.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always false.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.ManualTransmission Property

GameDefaults.ManualTransmission Property

Gets the gamer's preference for driving a manual shift transmission in racing games.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool ManualTransmission { get; }

Property Value

true if the gamer prefers to drive a manual shift transmission in racing games; false otherwise.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always false.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.MoveWithRightThumbStick Property

GameDefaults.MoveWithRightThumbStick Property

Gets the gamer's preference for moving by using the right thumbstick.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool MoveWithRightThumbStick { get; }

Property Value

true if the gamer prefers to move by using the right thumbstick; false otherwise. If this value is false, use the left thumbstick for player movement.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always false.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.PrimaryColor Property

GameDefaults.PrimaryColor Property

Gets the preferred color for the player character.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public Nullable<Color> PrimaryColor { get; }

Property Value

The preferred color for the player character.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always null.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.RacingCameraAngle Property

GameDefaults.RacingCameraAngle Property

Gets the gamer's preferred camera angle for racing games.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public RacingCameraAngle RacingCameraAngle { get; }

Property Value

The gamer's preferred camera angle for racing games.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always Back.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDefaults.SecondaryColor Property

GameDefaults.SecondaryColor Property

Gets a secondary color selection for the player character.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public Nullable<Color> SecondaryColor { get; }

Property Value

A secondary color selection for the player character.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property is always null.

Expand image See Also

Reference

SignedInGamer.GameDefaults Property
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameDifficulty Enumeration

GameDifficulty Enumeration

Indicates how difficult this gamer likes things to be.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public enum GameDifficulty

Expand image Members

Member name | Description
Easy | Below-average difficulty.
Hard | Above-average difficulty.
Normal | Average difficulty.

Expand image See Also

Reference

GameDefaults.GameDifficulty Property
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer Class

Gamer Class
See Also Members
CollapseAll image

Abstract base class for types that represent game players (profiles that have an associated gamertag). The concrete types SignedInGamer and NetworkGamer derive from this.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public abstract class Gamer

Expand image See Also

Reference

Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer Members

Gamer Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Gamer type.

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | Gets the display name string for the gamer.
Public Property | Gamertag | Gets the gamertag string.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | LeaderboardWriter | Gets an object that can be used to write leaderboard statistics for this gamer.
 | SignedInGamers | Represents a collection of all gamers on the local system.
Public Property | Tag | Gets or sets a custom object which can be used to attach arbitrary user defined data to the gamer.

Expand image Public Methods

 | Name | Description
 | BeginGetFromGamertag | Begins the process of getting a Gamer object for a specified gamertag.
 | BeginGetPartnerToken | Begins the asynchronous process of getting the partner token for this gamer.
Public Method | BeginGetProfile | Starts an asynchronous profile read operation.
 | EndGetFromGamertag | Ends the process of getting a Gamer object for a specified gamertag.
 | EndGetPartnerToken | Retrieves the results from an asynchronous request for the partner token for this gamer.
Public Method | EndGetProfile | Ends an asynchronous profile read operation.
Public Method | Equals | (Inherited from Object.)
 | GetFromGamertag | Returns a Gamer object for the specified gamertag.
Public Method | GetHashCode | (Inherited from Object.)
 | GetPartnerToken | Gets the partner token for this gamer.
Public Method | GetProfile | Reads profile data for this gamer.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Gamer Class
Microsoft.Xna.Framework.GamerServices Namespace


Gamer Methods

Gamer Methods

Expand image Public Methods

 | Name | Description
 | BeginGetFromGamertag | Begins the process of getting a Gamer object for a specified gamertag.
 | BeginGetPartnerToken | Begins the asynchronous process of getting the partner token for this gamer.
Public Method | BeginGetProfile | Starts an asynchronous profile read operation.
 | EndGetFromGamertag | Ends the process of getting a Gamer object for a specified gamertag.
 | EndGetPartnerToken | Retrieves the results from an asynchronous request for the partner token for this gamer.
Public Method | EndGetProfile | Ends an asynchronous profile read operation.
Public Method | Equals | (Inherited from Object.)
 | GetFromGamertag | Returns a Gamer object for the specified gamertag.
Public Method | GetHashCode | (Inherited from Object.)
 | GetPartnerToken | Gets the partner token for this gamer.
Public Method | GetProfile | Reads profile data for this gamer.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Gamer Class
Microsoft.Xna.Framework.GamerServices Namespace


Gamer.BeginGetFromGamertag Method

Gamer.BeginGetFromGamertag Method

Begins the process of getting a Gamer object for a specified gamertag.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static IAsyncResult BeginGetFromGamertag (
         string gamertag,
         AsyncCallback callback,
         Object asyncState
)

Parameters

gamertag
The Xbox LIVE gamertag for the gamer requested.
callback
The method to call once the asynchronous operation is finished.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method. Call EndGetFromGamertag to access these results.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.BeginGetPartnerToken Method

Gamer.BeginGetPartnerToken Method

Begins the asynchronous process of getting the partner token for this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static IAsyncResult BeginGetPartnerToken (
         string audienceUri,
         AsyncCallback callback,
         Object asyncState
)

Parameters

audienceUri
URI associated with the service to use with this token. This cannot be null.
callback
Method to call once the asynchronous operation is finished.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method. Call EndGetPartnerToken to access these results.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

A partner token contains authentication information that identifies both the application and gamer for communication with Xbox LIVE.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.BeginGetProfile Method

Gamer.BeginGetProfile Method

Starts an asynchronous profile read operation.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public IAsyncResult BeginGetProfile (
         AsyncCallback callback,
         Object asyncState
)

Parameters

callback
The method to call once the asynchronous operation is finished.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method. Call EndGetProfile to access these results.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | This object already is disposed.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

GetProfile
EndGetProfile
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.EndGetFromGamertag Method

Gamer.EndGetFromGamertag Method

Ends the process of getting a Gamer object for a specified gamertag.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static Gamer EndGetFromGamertag (
         IAsyncResult result
)

Parameters

result
An IAsyncResult used to track the progress of the operation.

Return Value

A Gamer object for the specified gamertag.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.EndGetPartnerToken Method

Gamer.EndGetPartnerToken Method

Retrieves the results from an asynchronous request for the partner token for this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static string EndGetPartnerToken (
         IAsyncResult result
)

Parameters

result
An IAsyncResult used to track the progress of the operation.

Return Value

The Xbox LIVE partner token for the gamer.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

A partner token contains authentication information that identifies both the application and gamer for communication with Xbox LIVE.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.EndGetProfile Method

Gamer.EndGetProfile Method

Ends an asynchronous profile read operation.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerProfile EndGetProfile (
         IAsyncResult result
)

Parameters

result
An IAsyncResult used to track the progress of the operation.

Return Value

The profile data for this gamer.

Expand image See Also

Reference

GetProfile
BeginGetProfile
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.GetFromGamertag Method

Gamer.GetFromGamertag Method

Returns a Gamer object for the specified gamertag.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static Gamer GetFromGamertag (
         string gamertag
)

Parameters

gamertag
The Xbox LIVE gamertag for the gamer requested.

Return Value

A Gamer object for the specified gamertag.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.GetPartnerToken Method

Gamer.GetPartnerToken Method

Gets the partner token for this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static string GetPartnerToken (
         string audienceUri
)

Parameters

audienceUri
URI associated with the service that will be used with this token. This cannot be null.

Return Value

The Xbox LIVE partner token for the gamer.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

A partner token contains authentication information that identifies both the application and gamer for communication with Xbox LIVE.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.GetProfile Method

Gamer.GetProfile Method

Reads profile data for this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerProfile GetProfile ()

Return Value

The profile data for this gamer.

Expand image Remarks

This operation can take some time if called on a remote gamer instance, in which case you might prefer to use the non-blocking alternative BeginGetProfile, but will complete quickly when used with a locally signed in profile.

Expand image See Also

Reference

BeginGetProfile
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.ToString Method

Gamer.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer Properties

Gamer Properties

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | Gets the display name string for the gamer.
Public Property | Gamertag | Gets the gamertag string.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | LeaderboardWriter | Gets an object that can be used to write leaderboard statistics for this gamer.
 | SignedInGamers | Represents a collection of all gamers on the local system.
Public Property | Tag | Gets or sets a custom object which can be used to attach arbitrary user defined data to the gamer.

Expand image See Also

Reference

Gamer Class
Microsoft.Xna.Framework.GamerServices Namespace


Gamer.DisplayName Property

Gamer.DisplayName Property

Gets the display name string for the gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public string DisplayName { get; set; }

Property Value

The display name for the gamer.

Expand image Remarks

Windows Phone Specific Information

On Windows Phone this property always returns a localized string.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.Gamertag Property

Gamer.Gamertag Property

Gets the gamertag string.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public string Gamertag { get; }

Property Value

Name of the gamertag.

Expand image Remarks

Windows Phone Specific Information

This is optional on Windows Phone. Use the DisplayName property to get a string that represents this gamer.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.IsDisposed Property

Gamer.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.LeaderboardWriter Property

Gamer.LeaderboardWriter Property

Gets an object that can be used to write leaderboard statistics for this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public LeaderboardWriter LeaderboardWriter { get; }

Property Value

A LeaderboardWriter that can be used to write leaderboard statistics for this gamer. Will be null if leaderboards are not available for this gamer.

Expand image Remarks

Leaderboards can be written from local, player match, or ranked sessions, using the following rules:

  • Ranked sessions can write to both arbitrated and non-arbitrated leaderboards.
  • Other session types can only write to non-arbitrated leaderboards.
  • Arbitrated statistics should be written by all machines for all gamers.
  • Non-arbitrated statistics should only be written by their local machine.
  • In ranked sessions, all machines should report TrueSkill for all gamers.
  • In other session types, only the host should report TrueSkill data.

Leaderboards can only be written when the session is actually playing the game, not when it is in the lobby state. This property will return null if leaderboards are not available for this gamer, which occurs in system link sessions, or if the gamer profile is a guest or not signed into Xbox LIVE, or if the game is in trial mode.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.SignedInGamers Property

Gamer.SignedInGamers Property

Represents a collection of all gamers on the local system. The collection is sorted by the gamer index, skipping nonexistent gamer indices. For example, if gamers 1 and 3 are signed in, the collection contains two instances of SignedInGamer, with gamer 1 first in the collection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static SignedInGamerCollection SignedInGamers { get; }

Property Value

Collection of current gamers on the local system.

Expand image Remarks

Windows Phone Specific Information

At the start of the game on Windows Phone, this property is empty. Once the gamer is signed in, the property contains one value representing the gamer associated with this device.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Gamer.Tag Property

Gamer.Tag Property

Gets or sets a custom object which can be used to attach arbitrary user defined data to the gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public Object Tag { get; set; }

Property Value

A custom object used to attach arbitrary user defined data to the gamer.

Expand image See Also

Reference

Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerCollection Generic Class

GamerCollection Generic Class
See Also Members
CollapseAll image

Represents a collection of gamers. This collection cannot be modified and is updated automatically during the call to Update.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public class GamerCollection<T> : ReadOnlyCollection<T>, IEnumerable<Gamer>, IEnumerable where T : Gamer

Expand image Remarks

Access this collection using the following methods.

  • AllGamers
  • LocalGamers
  • RemoteGamers

Expand image See Also

Reference

GamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerCollection Members

GamerCollection Members
See Also Methods Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the GamerCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns a strongly typed GamerCollection.GamerCollectionEnumerator Structure that can iterate through a GamerCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.IEnumerable{T}.GetEnumerator | Returns an enumerator that can iterate through the collection.

Expand image See Also

Reference

GamerCollection Generic Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerCollection Methods

GamerCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns a strongly typed GamerCollection.GamerCollectionEnumerator Structure that can iterate through a GamerCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.IEnumerable{T}.GetEnumerator | Returns an enumerator that can iterate through the collection.

Expand image See Also

Reference

GamerCollection Generic Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerCollection.GetEnumerator Method

GamerCollection.GetEnumerator Method

Returns a strongly typed GamerCollection.GamerCollectionEnumerator Structure that can iterate through a GamerCollection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerCollectionEnumerator<T> GetEnumerator ()

Return Value

The GamerCollection.GamerCollectionEnumerator Structure.

Expand image See Also

Reference

GamerCollection Generic Class
GamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.IEnumerable{T}.GetEnumerator Method

System.Collections.Generic.IEnumerable{T}.GetEnumerator Method
See Also
CollapseAll image

Returns an enumerator that can iterate through the collection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private IEnumerator<Gamer> System.Collections.Generic.IEnumerable{T}.GetEnumerator ()

Return Value

Enumerator that can iterate through the collection.

Expand image See Also

Reference

GamerCollection Generic Class
GamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerCollection Properties

GamerCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

GamerCollection Generic Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerCollection.GamerCollectionEnumerator Structure

GamerCollection.GamerCollectionEnumerator Structure

Provides the ability to iterate through the gamers in an GamerCollection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public struct GamerCollection.GamerCollectionEnumerator : IEnumerator<T>, IDisposable, IEnumerator

Expand image See Also

Reference

GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerCollection.GamerCollectionEnumerator Members

GamerCollection.GamerCollectionEnumerator Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the GamerCollection.GamerCollectionEnumerator type.

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the GamerCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the GamerCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the GamerCollection as a Object.
Explicit Interface Implementation | System#Collections#IEnumerator#Reset | Sets the enumerator to its initial position, which is before the first element in the GamerCollection.

Expand image See Also

Reference

GamerCollection.GamerCollectionEnumerator Structure
Microsoft.Xna.Framework.GamerServices Namespace


GamerCollection.GamerCollectionEnumerator Methods

GamerCollection.GamerCollectionEnumerator Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the GamerCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the GamerCollection as a Object.
Explicit Interface Implementation | System#Collections#IEnumerator#Reset | Sets the enumerator to its initial position, which is before the first element in the GamerCollection.

Expand image See Also

Reference

GamerCollection.GamerCollectionEnumerator Structure
Microsoft.Xna.Framework.GamerServices Namespace


GamerCollection.GamerCollectionEnumerator.Dispose Method

GamerCollection.GamerCollectionEnumerator.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

GamerCollection.GamerCollectionEnumerator Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerCollection.GamerCollectionEnumerator.MoveNext Method

GamerCollection.GamerCollectionEnumerator.MoveNext Method

Advances the enumerator to the next element of the GamerCollection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool MoveNext ()

Return Value

true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The collection was modified after the enumerator was created.

Expand image Remarks

After an enumerator is created or after a call to the System#Collections#IEnumerator#Reset Method method, an enumerator is positioned before the first element of the collection, and the first call to the MoveNext method moves the enumerator over the first element of the collection.

After the end of the collection is passed, subsequent calls to MoveNext return false until System#Collections#IEnumerator#Reset Method is called.

An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or System#Collections#IEnumerator#Reset Method throws an InvalidOperationException.

Expand image See Also

Reference

GamerCollection.GamerCollectionEnumerator Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System#Collections#IEnumerator#Reset Method

System#Collections#IEnumerator#Reset Method

Sets the enumerator to its initial position, which is before the first element in the GamerCollection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private void System#Collections#IEnumerator#Reset ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The collection was modified after the enumerator was created.

Expand image Remarks

An enumerator remains valid as long as the collection remains unchanged. If you make changes to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated, and the next call to the MoveNext method or the System#Collections#IEnumerator#Reset method throws an InvalidOperationException.

Note
Notes to Implementers: All calls to System#Collections#IEnumerator#Reset must result in the same state for the enumerator. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This invalidates the enumerator if the collection has been modified since the enumerator was created, which is consistent with MoveNext and Current.

Expand image See Also

Reference

GamerCollection.GamerCollectionEnumerator Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerCollection.GamerCollectionEnumerator Properties

GamerCollection.GamerCollectionEnumerator Properties

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the GamerCollection.

Expand image See Also

Reference

GamerCollection.GamerCollectionEnumerator Structure
Microsoft.Xna.Framework.GamerServices Namespace


GamerCollection.GamerCollectionEnumerator.Current Property

GamerCollection.GamerCollectionEnumerator.Current Property

Gets the current element in the GamerCollection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public T Current { get; }

Property Value

The current element in the GamerCollection.

Expand image See Also

Reference

GamerCollection.GamerCollectionEnumerator Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerCollection.GamerCollectionEnumerator.System.Collections.IEnumerator.Current Property

GamerCollection.GamerCollectionEnumerator.System.Collections.IEnumerator.Current Property
See Also
CollapseAll image

Gets the current element in the GamerCollection as a Object.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private Object System.Collections.IEnumerator.Current { get; }

Property Value

The current element in the GamerCollection as a Object.

Expand image See Also

Reference

GamerCollection.GamerCollectionEnumerator Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPresence Class

GamerPresence Class
See Also Members
CollapseAll image

Provides properties to set the rich presence state for a locally signed-in gamer profile.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class GamerPresence

Expand image Remarks

Expand image See Also

Tasks

Setting Presence Information

Reference

SignedInGamer.Presence Property
Gamer.SignedInGamers Property
GamerPresence Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPresence Members

GamerPresence Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the GamerPresence type.

Expand image Public Properties

 | Name | Description
Public Property | PresenceMode | Gets or sets the current presence mode for this gamer.
Public Property | PresenceValue | Gets or sets a custom presence value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Setting Presence Information

Reference

SignedInGamer.Presence Property
Gamer.SignedInGamers Property
GamerPresence Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerPresence Methods

GamerPresence Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Setting Presence Information

Reference

SignedInGamer.Presence Property
Gamer.SignedInGamers Property
GamerPresence Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerPresence Properties

GamerPresence Properties

Expand image Public Properties

 | Name | Description
Public Property | PresenceMode | Gets or sets the current presence mode for this gamer.
Public Property | PresenceValue | Gets or sets a custom presence value.

Expand image See Also

Tasks

Setting Presence Information

Reference

SignedInGamer.Presence Property
Gamer.SignedInGamers Property
GamerPresence Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerPresence.PresenceMode Property

GamerPresence.PresenceMode Property

Gets or sets the current presence mode for this gamer. You will see this status string when you view a friend through the Guide or on Xbox.com.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerPresenceMode PresenceMode { get; set; }

Property Value

The current presence mode for this gamer.

Expand image Remarks

Zune Specific Information
Setting presence information is not supported on the Zune platform. On the Zune platform, setting presence information for a signed-in gamer will not change the presence information on Xbox LIVE.

Some of the presence mode options include a number that can be set using the PresenceValue property:

  • GamerPresenceMode.Stage

  • GamerPresenceMode.Level

  • GamerPresenceMode.Score

  • GamerPresenceMode.CoopStage

  • GamerPresenceMode.CoopLevel

  • GamerPresenceMode.VersusScore

Note

A game title is not displayed in a player's presence information on Xbox LIVE Service until that game passes peer review. Once a game passes peer review, the presence information for a player shows three things: a confirmation the player is playing an Xbox LIVE Indie Game, the game's title, and the presence information set by SignedInGamer.Presence.

For example:

        Xbox LIVE Indie Game
        My Game Title
        Fighting the Boss

While a game is in development, but before it passes peer review, presence information indicates the developer is using XNA Creators Club as shown:

        XNA Creators Club
        creators.xna.com
        Fighting the Boss

Expand image See Also

Tasks

Setting Presence Information

Reference

GamerPresence.PresenceValue Property
SignedInGamer.Presence Property
Gamer.SignedInGamers Property
GamerPresence Class
GamerPresence Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPresence.PresenceValue Property

GamerPresence.PresenceValue Property

Gets or sets a custom presence value. You can insert this into the presence string if you select one of the presence modes that includes a value. For example, you might select GamerPresenceMode.Score or GamerPresenceMode.Level.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int PresenceValue { get; set; }

Property Value

A custom presence value, which indicates a stage, score, or level to display as a part of the presence string.

Expand image Remarks

Zune Specific Information
Setting presence information is not supported on the Zune platform. On the Zune platform, setting presence information for a signed-in gamer will not change the presence information on Xbox LIVE.

The following GamerPresenceMode settings, specified in PresenceMode, may include a numeric value as specified by PresenceValue:

  • GamerPresenceMode.Stage

  • GamerPresenceMode.Level

  • GamerPresenceMode.Score

  • GamerPresenceMode.CoopStage

  • GamerPresenceMode.CoopLevel

  • GamerPresenceMode.VersusScore

Expand image See Also

Reference

GamerPresence.PresenceMode Property
SignedInGamer.Presence Property
Gamer.SignedInGamers Property
GamerPresence Class
GamerPresence Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPresenceMode Enumeration

GamerPresenceMode Enumeration

Settings defining the status string that will appear when you view a friend through the Xbox LIVE Guide or on Xbox.com. Use the PresenceMode property to set this option.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public enum GamerPresenceMode

Expand image Members

Member name | Description
ArcadeMode | Arcade Mode
AtMenu | At Menu
BattlingBoss | Battling Boss
CampaignMode | Campaign Mode
ChallengeMode | Challenge Mode
ConfiguringSettings | Configuring Settings
CoOpLevel | Co-Op: Level. Includes a numeric value specified with PresenceValue.
CoOpStage | Co-Op: Stage. Includes a numeric value specified with PresenceValue.
CornflowerBlue | Cornflower Blue
CustomizingPlayer | Customizing Player
DifficultyEasy | Difficulty: Easy
DifficultyExtreme | Difficulty: Extreme
DifficultyHard | Difficulty: Hard
DifficultyMedium | Difficulty: Medium
EditingLevel | Editing Level
ExplorationMode | Exploration Mode
FoundSecret | Found Secret
FreePlay | Free Play
GameOver | Game Over
InCombat | In Combat
InGameStore | In Game Store
Level | Level. Includes a numeric value specified with PresenceValue.
LocalCoOp | Local Co-Op
LocalVersus | Local Versus
LookingForGames | Looking For Games
Losing | Losing
Multiplayer | Multiplayer
NearlyFinished | Nearly Finished
None | No Presence String Displayed
OnARoll | On a Roll
OnlineCoOp | Online Co-Op
OnlineVersus | Online Versus
Outnumbered | Outnumbered
Paused | Paused
PlayingMinigame | Playing Minigame
PlayingWithFriends | Playing With Friends
PracticeMode | Practice Mode
PuzzleMode | Puzzle Mode
ScenarioMode | Scenario Mode
Score | Score. Includes a numeric value specified with PresenceValue.
ScoreIsTied | Score is Tied
SettingUpMatch | Setting Up Match
SinglePlayer | Single Player
Stage | Stage. Includes a numeric value specified with PresenceValue.
StartingGame | Starting Game
StoryMode | Story Mode
StuckOnAHardBit | Stuck on a Hard Bit
SurvivalMode | Survival Mode
TimeAttack | Time Attack
TryingForRecord | Trying For Record
TutorialMode | Tutorial Mode
VersusComputer | Versus Computer
VersusScore | Versus: Score. Includes a numeric value specified with PresenceValue.
WaitingForPlayers | Waiting For Players
WaitingInLobby | Waiting In Lobby
WastingTime | Wasting Time
WatchingCredits | Watching Credits
WatchingCutscene | Watching Cutscene
Winning | Winning
WonTheGame | Won the Game

Expand image Remarks

The following GamerPresenceMode settings, specified in PresenceMode, may include a numeric value as specified by PresenceValue:

  • GamerPresenceMode.Stage

  • GamerPresenceMode.Level

  • GamerPresenceMode.Score

  • GamerPresenceMode.CoopStage

  • GamerPresenceMode.CoopLevel

  • GamerPresenceMode.VersusScore

Expand image See Also

Reference

GamerPresence.PresenceMode Property
GamerPresence.PresenceValue Property
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivilegeException Class

GamerPrivilegeException Class
See Also Members
CollapseAll image

Thrown if a gamer services or multiplayer API is called without a valid, signed-in profile.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
[SerializableAttribute]
public class GamerPrivilegeException : Exception

Expand image Remarks

This exception is thrown if any of the following conditons are met.

  • No profile is currently signed in.
  • The signed-in profile has parental control settings prohibiting the requested action.

Expand image See Also

Reference

GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivilegeException Members

GamerPrivilegeException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the GamerPrivilegeException type.

Expand image Public Constructors

 | Name | Description
Public Method | GamerPrivilegeException | Overloaded. Creates an empty instance of GamerPrivilegeException.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerPrivilegeException Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerPrivilegeException Constructor

GamerPrivilegeException Constructor

Creates an empty instance of GamerPrivilegeException.

Expand image Overload List

Name | Description
GamerPrivilegeException () | Creates an instance of GamerPrivilegeException.
GamerPrivilegeException (SerializationInfo, StreamingContext) | Initializes a new instance of GamerPrivilegeException with the specified streaming context.
GamerPrivilegeException (String) | Initializes a new instance of GamerPrivilegeException with the specified error message.
GamerPrivilegeException (String, Exception) | Initializes a new instance of GamerPrivilegeException with the specified error message and inner exception.

Expand image See Also

Reference

GamerPrivilegeException Class
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace


GamerPrivilegeException Constructor ()

GamerPrivilegeException Constructor ()
See Also
CollapseAll image

Creates an instance of GamerPrivilegeException.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerPrivilegeException ()

Expand image See Also

Reference

GamerPrivilegeException Class
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivilegeException Constructor (SerializationInfo, StreamingContext)

GamerPrivilegeException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Note
This constructor is available only when developing for Windows.
Initializes a new instance of GamerPrivilegeException with the specified streaming context.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
protected GamerPrivilegeException (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
Describes the gamer services or multiplayer API being accessed when the exception occurred.
context
Describes the stream where the exception occurred.

Expand image See Also

Reference

GamerPrivilegeException Class
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


GamerPrivilegeException Constructor (String)

GamerPrivilegeException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of GamerPrivilegeException with the specified error message.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerPrivilegeException (
         string message
)

Parameters

message
A message that describes the error.

Expand image See Also

Reference

GamerPrivilegeException Class
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivilegeException Constructor (String, Exception)

GamerPrivilegeException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of GamerPrivilegeException with the specified error message and inner exception.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerPrivilegeException (
         string message,
         Exception innerException
)

Parameters

message
A message that describes the error.
innerException
The inner exception related to this exception.

Expand image See Also

Reference

GamerPrivilegeException Class
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivilegeException Methods

GamerPrivilegeException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerPrivilegeException Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerPrivilegeException Properties

GamerPrivilegeException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

GamerPrivilegeException Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerPrivileges Class

GamerPrivileges Class
See Also Members
CollapseAll image

Describes what operations a gamer is allowed to perform.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class GamerPrivileges

Expand image Remarks

GamerPrivileges can be defined by parental control settings, and will also be set automatically in response to things like age, region, and whether the gamer has a LIVE Gold or LIVE Silver account. Games do not need to explicitly check privileges, because a GamerPrivilegeException will be thrown if they try to perform an unsupported operation, but these privilege bits may be useful to detect that an operation is unavailable before calling it so as to grey-out the relevant menu option.

Expand image See Also

Reference

SignedInGamer.Privileges Property
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivileges Members

GamerPrivileges Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the GamerPrivileges type.

Expand image Public Properties

 | Name | Description
Public Property | AllowCommunication | Checks if this gamer is allowed to send and receive communications using voice, text, messaging, or game invites.
Public Property | AllowOnlineSessions | Checks if this gamer is allowed to play in online multiplayer sessions.
Public Property | AllowPremiumContent | Checks if this gamer is allowed to access premium content.
Public Property | AllowProfileViewing | Checks if this gamer is allowed to view the profiles of other gamers.
Public Property | AllowPurchaseContent | Checks if this gamer is allowed to purchase content from LIVE Marketplace.
Public Property | AllowTradeContent | Checks if this gamer is allowed to trade content with other gamers.
Public Property | AllowUserCreatedContent | Checks if this gamer is allowed to access user content created by other gamers.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerPrivileges Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerPrivileges Methods

GamerPrivileges Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerPrivileges Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerPrivileges Properties

GamerPrivileges Properties

Expand image Public Properties

 | Name | Description
Public Property | AllowCommunication | Checks if this gamer is allowed to send and receive communications using voice, text, messaging, or game invites.
Public Property | AllowOnlineSessions | Checks if this gamer is allowed to play in online multiplayer sessions.
Public Property | AllowPremiumContent | Checks if this gamer is allowed to access premium content.
Public Property | AllowProfileViewing | Checks if this gamer is allowed to view the profiles of other gamers.
Public Property | AllowPurchaseContent | Checks if this gamer is allowed to purchase content from LIVE Marketplace.
Public Property | AllowTradeContent | Checks if this gamer is allowed to trade content with other gamers.
Public Property | AllowUserCreatedContent | Checks if this gamer is allowed to access user content created by other gamers.

Expand image See Also

Reference

GamerPrivileges Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerPrivileges.AllowCommunication Property

GamerPrivileges.AllowCommunication Property

Checks if this gamer is allowed to send and receive communications using voice, text, messaging, or game invites.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerPrivilegeSetting AllowCommunication { get; }

Property Value

true if this gamer is allowed to send and receive communications using voice, text, messaging, or game invites; false otherwise.

Expand image Remarks

Titles do not need to do anything special to disable voice if this privilege is disabled. The XNA Framework will handle that automatically.

Windows Phone Specific Information

This property is always true on Windows Phone.

Expand image See Also

Reference

SignedInGamer.Privileges Property
Guide.BeginShowMessageBox Method
Guide.ShowComposeMessage Method
Guide.ShowGameInvite Method
LocalNetworkGamer.EnableSendVoice Method
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivileges.AllowOnlineSessions Property

GamerPrivileges.AllowOnlineSessions Property

Checks if this gamer is allowed to play in online multiplayer sessions.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool AllowOnlineSessions { get; }

Property Value

true if this gamer is allowed to play in online multiplayer sessions; false otherwise.

Expand image Remarks

Note
On Windows Phone, there is no concept of game sessions. Instead, this property is used to determine if this gamer can engage in multiplayer games with other gamers, whether or not the game uses sessions or is an asynchronous (turn-by-turn) game.

This may be disabled based on parental control settings. Also, it is disabled if the gamer does not have an Xbox LIVE Gold membership or an Xbox LIVE Silver membership. This property does not affect system link sessions, which are always available.

While in limited trial mode, this property returns false, which means gamers are unable to use Xbox LIVE servers to connect to other machines over the Internet. It is possible that the game may change from trial mode at any time, including during actual gameplay. For more information, see Guide.IsTrialMode.

Windows Phone Specific Information

This property is always true on Windows Phone.

Expand image See Also

Reference

Guide.IsTrialMode Property
SignedInGamer.Privileges Property
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivileges.AllowPremiumContent Property

GamerPrivileges.AllowPremiumContent Property

Checks if this gamer is allowed to access premium content.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool AllowPremiumContent { get; }

Property Value

Returns true if the gamer is allowed to access premium content, false otherwise.

Expand image Remarks

Windows Phone Specific Information

This property is always false on Windows Phone.

Expand image See Also

Reference

GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivileges.AllowProfileViewing Property

GamerPrivileges.AllowProfileViewing Property

Checks if this gamer is allowed to view the profiles of other gamers.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerPrivilegeSetting AllowProfileViewing { get; }

Property Value

true if this gamer is allowed to view the profiles of other gamers; false otherwise.

Expand image Remarks

Windows Phone Specific Information

This property is always true on Windows Phone.

Expand image See Also

Reference

SignedInGamer.Privileges Property
Guide.ShowGamerCard Method
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivileges.AllowPurchaseContent Property

GamerPrivileges.AllowPurchaseContent Property

Checks if this gamer is allowed to purchase content from LIVE Marketplace.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool AllowPurchaseContent { get; }

Property Value

true if this gamer is allowed to purchase content from LIVE Marketplace; false otherwise.

Expand image Remarks

Windows Phone Specific Information

This property is always true on Windows Phone.

Expand image See Also

Reference

Guide.ShowMarketplace Method
SignedInGamer.Privileges Property
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivileges.AllowTradeContent Property

GamerPrivileges.AllowTradeContent Property

Checks if this gamer is allowed to trade content with other gamers.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool AllowTradeContent { get; }

Property Value

true if this gamer is allowed to trade content with other gamers; false otherwise.

Expand image Remarks

Windows Phone Specific Information

This property is always true on Windows Phone.

Expand image See Also

Reference

SignedInGamer.Privileges Property
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivileges.AllowUserCreatedContent Property

GamerPrivileges.AllowUserCreatedContent Property

Checks if this gamer is allowed to access user content created by other gamers.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerPrivilegeSetting AllowUserCreatedContent { get; }

Property Value

true if this gamer is allowed to access user content created by other gamers; false otherwise.

Expand image Remarks

Windows Phone Specific Information

This property is always true on Windows Phone.

Expand image See Also

Reference

SignedInGamer.Privileges Property
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerPrivilegeSetting Enumeration

GamerPrivilegeSetting Enumeration

Describes the conditions in which a privilege is available.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public enum GamerPrivilegeSetting

Expand image Members

Member name | Description
Blocked | This privilege is not available for the current gamer profile.
Everyone | This privilege is available for the current gamer profile.
FriendsOnly | This privilege is only available for friends of the current gamer profile. Use the IsFriend method to check which gamers are friends.

Expand image See Also

Reference

GamerPrivileges.AllowProfileViewing Property
GamerPrivileges.AllowCommunication Property
GamerPrivileges.AllowUserCreatedContent Property
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile Class

GamerProfile Class
See Also Members
CollapseAll image

Profile settings describing information about a gamer such as the gamer's motto, reputation, and gamer picture. This data is accessible for both locally signed in profiles and remote gamers that you are playing with in a multiplayer session.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class GamerProfile : IDisposable

Expand image See Also

Reference

GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile Members

GamerProfile Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the GamerProfile type.

Expand image Public Properties

 | Name | Description
Public Property | GamerScore | Gets the GamerScore of this gamer.
Public Property | GamerZone | Gets the GamerZone setting.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | Motto | Gets the gamer motto string.
Public Property | Region | Gets the region of this gamer.
Public Property | Reputation | Gets the gamer reputation, as a number of stars ranging 0 to 5.
Public Property | TitlesPlayed | Gets the number of titles this gamer has played.
Public Property | TotalAchievements | Gets the total number of achievements this gamer has obtained.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetGamerPicture | Gets the gamer picture associated with this profile.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Getting Gamer Profiles

Reference

Gamer.SignedInGamers Property
GamerProfile Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerProfile Methods

GamerProfile Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetGamerPicture | Gets the gamer picture associated with this profile.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerProfile Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerProfile.Dispose Method

GamerProfile.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile.GetGamerPicture Method

GamerProfile.GetGamerPicture Method

Gets the gamer picture associated with this profile.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public Stream GetGamerPicture ()

Return Value

The gamer picture, as a stream.

Expand image Remarks

To convert the stream returned by this method into a Texture2D, use the FromStream member, as shown:

    // Read the gamer picture.
    Stream stream = profile.GetGamerPicture();
    Texture2D picture = Texture2D.FromStream(deviceManager.GraphicsDevice, stream);

Expand image See Also

Reference

GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile Properties

GamerProfile Properties

Expand image Public Properties

 | Name | Description
Public Property | GamerScore | Gets the GamerScore of this gamer.
Public Property | GamerZone | Gets the GamerZone setting.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | Motto | Gets the gamer motto string.
Public Property | Region | Gets the region of this gamer.
Public Property | Reputation | Gets the gamer reputation, as a number of stars ranging 0 to 5.
Public Property | TitlesPlayed | Gets the number of titles this gamer has played.
Public Property | TotalAchievements | Gets the total number of achievements this gamer has obtained.

Expand image See Also

Reference

GamerProfile Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerProfile.GamerScore Property

GamerProfile.GamerScore Property

Gets the GamerScore of this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int GamerScore { get; }

Property Value

The GamerScore of this gamer.

Expand image See Also

Reference

GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile.GamerZone Property

GamerProfile.GamerZone Property

Gets the GamerZone setting.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerZone GamerZone { get; }

Property Value

The GamerZone setting.

Expand image See Also

Reference

GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile.IsDisposed Property

GamerProfile.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile.Motto Property

GamerProfile.Motto Property

Gets the gamer motto string.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public string Motto { get; }

Property Value

The gamer motto.

Expand image See Also

Reference

GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile.Region Property

GamerProfile.Region Property

Gets the region of this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public RegionInfo Region { get; }

Property Value

The region of this gamer.

Expand image See Also

Reference

GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile.Reputation Property

GamerProfile.Reputation Property

Gets the gamer reputation, as a number of stars ranging 0 to 5.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public float Reputation { get; }

Property Value

The gamer reputation, representing a number of stars ranging 0 to 5.

Expand image See Also

Reference

GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile.TitlesPlayed Property

GamerProfile.TitlesPlayed Property

Gets the number of titles this gamer has played.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int TitlesPlayed { get; }

Property Value

The number of titles this gamer has played.

Expand image See Also

Reference

GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerProfile.TotalAchievements Property

GamerProfile.TotalAchievements Property

Gets the total number of achievements this gamer has obtained.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int TotalAchievements { get; }

Property Value

The total number of achievements this gamer has obtained.

Expand image See Also

Reference

GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesComponent Class

GamerServicesComponent Class
See Also Members
CollapseAll image

Wraps the functionality of the GamerServicesDispatcher.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public class GamerServicesComponent : GameComponent

Expand image Remarks

If a game will use gamer services, a GamerServicesComponent should be added to the game's Components collection. GamerServicesComponent will take care of initializing and updating the GamerServicesDispatcher at the appropriate times.

Expand image See Also

Reference

GamerServicesComponent Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesComponent Members

GamerServicesComponent Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the GamerServicesComponent type.

Expand image Public Constructors

 | Name | Description
Public Method | GamerServicesComponent | Creates a new GamerServicesComponent.

Expand image Public Properties

 | Name | Description
Public Property | Enabled | (Inherited from GameComponent.)
Public Property | Game | (Inherited from GameComponent.)
Public Property | UpdateOrder | (Inherited from GameComponent.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GameComponent.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Initialize | Initializes the GamerServicesDispatcher.
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Updates the GamerServicesDispatcher.

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from GameComponent.)
Protected Method | Finalize | (Inherited from GameComponent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnEnabledChanged | (Inherited from GameComponent.)
Protected Method | OnUpdateOrderChanged | (Inherited from GameComponent.)

Expand image Public Events

 | Name | Description
Public Event | Disposed | (Inherited from GameComponent.)
Public Event | EnabledChanged | (Inherited from GameComponent.)
Public Event | UpdateOrderChanged | (Inherited from GameComponent.)

Expand image See Also

Reference

GamerServicesComponent Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesComponent Constructor

GamerServicesComponent Constructor

Creates a new GamerServicesComponent.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public GamerServicesComponent (
         Game game
)

Parameters

game
The game that will be associated with this component.

Expand image Exceptions

Exception type | Condition
GamerServicesNotAvailableException
  • If the current game uses the XNA Framework Redistributable. This file does not include Games for Windows – LIVE functionality.
  • If another Games for Windows – LIVE title is running already.
ArgumentNullException | serviceProvider is null.
InvalidOperationException | The gamer services functionality is already initialized.

Expand image Remarks

Important

Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

Expand image See Also

Reference

GamerServicesComponent Class
GamerServicesComponent Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesComponent Methods

GamerServicesComponent Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GameComponent.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Initialize | Initializes the GamerServicesDispatcher.
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Updates the GamerServicesDispatcher.

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from GameComponent.)
Protected Method | Finalize | (Inherited from GameComponent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnEnabledChanged | (Inherited from GameComponent.)
Protected Method | OnUpdateOrderChanged | (Inherited from GameComponent.)

Expand image See Also

Reference

GamerServicesComponent Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesComponent.Initialize Method

GamerServicesComponent.Initialize Method

Initializes the GamerServicesDispatcher.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public override void Initialize ()

Expand image Exceptions

Exception type | Condition
GamerServicesNotAvailableException
  • If the current game uses the XNA Framework Redistributable. This file does not include Games for Windows – LIVE functionality.
  • If another Games for Windows – LIVE title is running already.
ArgumentNullException | serviceProvider is null.
InvalidOperationException | The gamer services functionality is already initialized.

Expand image Remarks

Important

Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

Expand image See Also

Reference

GamerServicesComponent Class
GamerServicesComponent Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesComponent.Update Method

GamerServicesComponent.Update Method

Updates the GamerServicesDispatcher.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Expand image Syntax

C#
public override void Update (
         GameTime gameTime
)

Parameters

gameTime
The game timing state.

Expand image See Also

Reference

GamerServicesComponent Class
GamerServicesComponent Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesComponent Properties

GamerServicesComponent Properties

Expand image Public Properties

 | Name | Description
Public Property | Enabled | (Inherited from GameComponent.)
Public Property | Game | (Inherited from GameComponent.)
Public Property | UpdateOrder | (Inherited from GameComponent.)

Expand image See Also

Reference

GamerServicesComponent Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesComponent Events

GamerServicesComponent Events

Expand image Public Events

 | Name | Description
Public Event | Disposed | (Inherited from GameComponent.)
Public Event | EnabledChanged | (Inherited from GameComponent.)
Public Event | UpdateOrderChanged | (Inherited from GameComponent.)

Expand image See Also

Reference

GamerServicesComponent Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesDispatcher Class

GamerServicesDispatcher Class
See Also Members
CollapseAll image

Implements the Windows-specific portion of a GamerServicesDispatcher class.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static class GamerServicesDispatcher

Expand image Remarks

Use the GamerServicesDispatcher class to access gamer services functionality from your game. This functionality includes, among other services, displaying the guide from your game, determining which profiles are checked in, and determining the privileges for a specific gamer profile.

During startup of your game, initialize an instance of GamerServicesDispatcher. During the lifetime of your game, call Update for every frame.

Commonly, you do not directly interact with the GamerServicesDispatcher object. Instead, use the GamerServicesComponent class, which wraps the functionality of GamerServicesDispatcher. However, for applications that do not use the default game template, you must interact with the GamerServicesDispatcher instance of your application.

Expand image See Also

Tasks

Initializing and Updating Gamer Services

Concepts

Introduction to Gamer Services

Reference

GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesDispatcher Members

GamerServicesDispatcher Members
See Also Events Methods Properties
CollapseAll image

The following tables list the members exposed by the GamerServicesDispatcher type.

Expand image Public Properties

Name | Description
IsInitialized | Determines if Initialize has been called.
WindowHandle | Gets or sets the handle to the underlying game window.

Expand image Public Methods

Name | Description
Initialize | Initializes gamer services functionality for the game, automatically choosing the most appropriate gamer service type for the platform.
Update | Updates the status of gamer services and raises related events.

Expand image Public Events

Name | Description
InstallingTitleUpdate | Notifies the game when a Games for Windows - LIVE title update is being installed.

Expand image See Also

Tasks

Initializing and Updating Gamer Services

Concepts

Introduction to Gamer Services

Reference

GamerServicesDispatcher Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesDispatcher Methods

GamerServicesDispatcher Methods

Expand image Public Methods

Name | Description
Initialize | Initializes gamer services functionality for the game, automatically choosing the most appropriate gamer service type for the platform.
Update | Updates the status of gamer services and raises related events.

Expand image See Also

Reference

GamerServicesDispatcher Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesDispatcher.Initialize Method

GamerServicesDispatcher.Initialize Method

Initializes gamer services functionality for the game, automatically choosing the most appropriate gamer service type for the platform.

Call this method during startup of your game.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void Initialize (
         IServiceProvider serviceProvider
)

Parameters

serviceProvider
The service provider to be used when locating additional services services. For example, IGraphicsDeviceService.

Expand image Exceptions

Exception type | Condition
GamerServicesNotAvailableException
  • If the current game uses the XNA Framework Redistributable. This file does not include Games for Windows – LIVE functionality.
  • If another Games for Windows – LIVE title is running already.
ArgumentNullException | serviceProvider is null.
InvalidOperationException | Gamer services has already been initialized.

Expand image Remarks

Important

Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

This method automatically chooses the default gamer service type for your platform (Xbox LIVE for Xbox 360 and Windows, or Xbox LIVE-enabled for Windows Phone). If you need to explicitly choose the gamer service type, use GamerServicesDispatcher.Initialize(System.IServiceProvider, Microsoft.Xna.Framework.GamerServices.GamerServiceType).

Expand image See Also

Tasks

Initializing and Updating Gamer Services

Concepts

Introduction to Gamer Services

Reference

GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesDispatcher.Update Method

GamerServicesDispatcher.Update Method

Updates the status of gamer services and raises related events. It is recommended that you call this method once per frame.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void Update ()

Expand image See Also

Tasks

Initializing and Updating Gamer Services

Concepts

Introduction to Gamer Services

Reference

GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesDispatcher Properties

GamerServicesDispatcher Properties

Expand image Public Properties

Name | Description
IsInitialized | Determines if Initialize has been called.
WindowHandle | Gets or sets the handle to the underlying game window.

Expand image See Also

Reference

GamerServicesDispatcher Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesDispatcher.IsInitialized Property

GamerServicesDispatcher.IsInitialized Property

Determines if Initialize has been called.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static bool IsInitialized { get; }

Property Value

true if gamer services have been initialized; false otherwise.

Expand image See Also

Reference

GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesDispatcher.WindowHandle Property

GamerServicesDispatcher.WindowHandle Property

Gets or sets the handle to the underlying game window.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static IntPtr WindowHandle { get; set; }

Property Value

Handle to a window.

Expand image See Also

Reference

GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesDispatcher Events

GamerServicesDispatcher Events

Expand image Public Events

Name | Description
InstallingTitleUpdate | Notifies the game when a Games for Windows - LIVE title update is being installed.

Expand image See Also

Reference

GamerServicesDispatcher Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesDispatcher.InstallingTitleUpdate Event

GamerServicesDispatcher.InstallingTitleUpdate Event

Notifies the game when a Games for Windows - LIVE title update is being installed.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static event EventHandler<EventArgs> InstallingTitleUpdate

Expand image Remarks

Gamer services and networking functionality is no longer available after this event has been raised: games should typically exit in response to InstallingTitleUpdate. If you are using the GamerServicesComponent, this event is automatically hooked up to call Exit, so you do not need to do anything special to handle title updates.

Expand image See Also

Reference

GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesNotAvailableException Class

GamerServicesNotAvailableException Class
See Also Members
CollapseAll image

Thrown if the gamer services system cannot be successfully initialized.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
[SerializableAttribute]
public class GamerServicesNotAvailableException : Exception

Expand image Remarks

The following are likely causes for this exception.

  • If the current game uses the XNA Framework Redistributable. This file does not include Games for Windows – LIVE functionality.
  • If another Games for Windows – LIVE title is running already.
Important

Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

Expand image See Also

Reference

GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesNotAvailableException Members

GamerServicesNotAvailableException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the GamerServicesNotAvailableException type.

Expand image Public Constructors

 | Name | Description
Public Method | GamerServicesNotAvailableException | Overloaded. Creates an instance of GamerServicesNotAvailableException.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerServicesNotAvailableException Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesNotAvailableException Constructor

GamerServicesNotAvailableException Constructor

Creates an instance of GamerServicesNotAvailableException.

Expand image Overload List

Name | Description
GamerServicesNotAvailableException () | Creates an empty instance of GamerServicesNotAvailableException.
GamerServicesNotAvailableException (SerializationInfo, StreamingContext) | Initializes a new instance of GamerServicesNotAvailableException with the specified streaming context.
GamerServicesNotAvailableException (String) | Initializes a new instance of GamerServicesNotAvailableException with the specified error message.
GamerServicesNotAvailableException (String, Exception) | Initializes a new instance of GamerServicesNotAvailableException with the specified error message and the inner exception.

Expand image See Also

Reference

GamerServicesNotAvailableException Class
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesNotAvailableException Constructor ()

GamerServicesNotAvailableException Constructor ()
See Also
CollapseAll image

Creates an empty instance of GamerServicesNotAvailableException.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerServicesNotAvailableException ()

Expand image See Also

Reference

GamerServicesNotAvailableException Class
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesNotAvailableException Constructor (SerializationInfo, StreamingContext)

GamerServicesNotAvailableException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Note
This constructor is available only when developing for Windows.
Initializes a new instance of GamerServicesNotAvailableException with the specified streaming context.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
protected GamerServicesNotAvailableException (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
Describes the gamer services being accessed when the exception occurred.
context
Describes the stream where the exception occurred.

Expand image See Also

Reference

GamerServicesNotAvailableException Class
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


GamerServicesNotAvailableException Constructor (String)

GamerServicesNotAvailableException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of GamerServicesNotAvailableException with the specified error message.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerServicesNotAvailableException (
         string message
)

Parameters

message
A message that describes the error.

Expand image See Also

Reference

GamerServicesNotAvailableException Class
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesNotAvailableException Constructor (String, Exception)

GamerServicesNotAvailableException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of GamerServicesNotAvailableException with the specified error message and the inner exception.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerServicesNotAvailableException (
         string message,
         Exception innerException
)

Parameters

message
A message that describes the error.
innerException
The inner exception related to this exception.

Expand image See Also

Reference

GamerServicesNotAvailableException Class
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamerServicesNotAvailableException Methods

GamerServicesNotAvailableException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerServicesNotAvailableException Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerServicesNotAvailableException Properties

GamerServicesNotAvailableException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

GamerServicesNotAvailableException Class
Microsoft.Xna.Framework.GamerServices Namespace


GamerZone Enumeration

GamerZone Enumeration

This style of social gaming preferred by this Xbox LIVE member.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public enum GamerZone

Expand image Members

Member name | Description
Family | Family-friendly game play.
Pro | Competitive game play.
Recreation | Non-competitive game play.
Underground | Alternative approach to game play.
Unknown | Unknown.

Expand image See Also

Reference

GamerProfile.GamerZone Property
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameUpdateRequiredException Class

GameUpdateRequiredException Class
See Also Members
CollapseAll image

The exception thrown when a game (title) update is required in order to use Xbox LIVE.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public class GameUpdateRequiredException : Exception

Expand image See Also

Reference

GameUpdateRequiredException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameUpdateRequiredException Members

GameUpdateRequiredException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the GameUpdateRequiredException type.

Expand image Public Constructors

 | Name | Description
Public Method | GameUpdateRequiredException | Overloaded. Overloaded methods that initialize a new GameUpdateRequiredException.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameUpdateRequiredException Class
Microsoft.Xna.Framework.GamerServices Namespace


GameUpdateRequiredException Constructor

GameUpdateRequiredException Constructor

Overloaded methods that initialize a new GameUpdateRequiredException.

Expand image Overload List

Name | Description
GameUpdateRequiredException () | Initializes a new GameUpdateRequiredException.
GameUpdateRequiredException (SerializationInfo, StreamingContext) | Initializes a new GameUpdateRequiredException with specified serialization information and a streaming context.
GameUpdateRequiredException (String) | Initializes a new GameUpdateRequiredException with a specified error message.
GameUpdateRequiredException (String, Exception) | Initializes a new GameUpdateRequiredException, with a specified error message and a reference to the inner exception that caused the error.

Expand image See Also

Reference

GameUpdateRequiredException Class
GameUpdateRequiredException Members
Microsoft.Xna.Framework.GamerServices Namespace


GameUpdateRequiredException Constructor ()

GameUpdateRequiredException Constructor ()
See Also
CollapseAll image

Initializes a new GameUpdateRequiredException.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GameUpdateRequiredException ()

Expand image Remarks

When this constructor is used, both the Message and InnerException properties are null.

Expand image See Also

Reference

GameUpdateRequiredException Class
GameUpdateRequiredException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameUpdateRequiredException Constructor (SerializationInfo, StreamingContext)

GameUpdateRequiredException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Note
This constructor is available only when developing for Windows.
Initializes a new GameUpdateRequiredException with specified serialization information and a streaming context.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
protected GameUpdateRequiredException (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
Describes the gamer services or multiplayer API being accessed when the exception occurred.
context
Describes the stream where the exception occurred.

Expand image See Also

Reference

GameUpdateRequiredException Class
GameUpdateRequiredException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


GameUpdateRequiredException Constructor (String)

GameUpdateRequiredException Constructor (String)
See Also
CollapseAll image

Initializes a new GameUpdateRequiredException with a specified error message.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GameUpdateRequiredException (
         string message
)

Parameters

message
Text that describes the error.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor must ensure the string is localized for the current system culture.

Expand image See Also

Reference

GameUpdateRequiredException Class
GameUpdateRequiredException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameUpdateRequiredException Constructor (String, Exception)

GameUpdateRequiredException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new GameUpdateRequiredException, with a specified error message and a reference to the inner exception that caused the error.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GameUpdateRequiredException (
         string message,
         Exception innerException
)

Parameters

message
Text that describes the error.
innerException
The exception that is the cause of the GameUpdateRequiredException. If this parameter is not null, the exception is raised in a catch block that handles the inner exception.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor must ensure the string is localized for the current system culture.

An exception thrown as a direct result of a previous exception should include a reference to that previous exception in the innerException parameter. The InnerException property returns the same value that is passed into this constructor, or null if the caller did not supply the inner exception parameter to the constructor.

Expand image See Also

Reference

GameUpdateRequiredException Class
GameUpdateRequiredException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GameUpdateRequiredException Methods

GameUpdateRequiredException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameUpdateRequiredException Class
Microsoft.Xna.Framework.GamerServices Namespace


GameUpdateRequiredException Properties

GameUpdateRequiredException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

GameUpdateRequiredException Class
Microsoft.Xna.Framework.GamerServices Namespace


Guide Class

Guide Class
See Also Members
CollapseAll image

Provides access to the Guide user interface. This interface contains message boxes, a text entry system, and other common interface elements.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static class Guide

Expand image See Also

Reference

Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide Members

Guide Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Guide type.

Expand image Public Properties

Name | Description
IsScreenSaverEnabled | Gets or sets the current state of the screen saver.
IsTrialMode | Determines whether the game is running currently in limited trial mode.
IsVisible | Determines if a Guide user interface screen is active.
NotificationPosition | Retrieves or sets the location where notifications will appear on the screen.
SimulateTrialMode | Allows titles to simulate trial mode restrictions when testing using the Development configuration.

Expand image Public Methods

Name | Description
BeginShowKeyboardInput | Overloaded. Overloads for showing the software keyboard interface asynchronously.
BeginShowMessageBox | Overloaded. Begins the process of displaying a message box with the specified parameters.
DelayNotifications | Delays system notifications for a specified time.
EndShowKeyboardInput | Ends the display of the keyboard input dialog box.
EndShowMessageBox | Ends the display of a message box.
ShowComposeMessage | Shows the Compose Message user interface.
ShowFriendRequest | Shows the Friend Request user interface.
ShowFriends | Shows the Friends user interface.
ShowGameInvite | Overloaded. Overloads to display the game invitation user interface.
ShowGamerCard | Shows the Gamer Card user interface.
ShowMarketplace | Displays the marketplace user interface.
ShowMessages | Shows the Messages user interface.
ShowParty | Shows the Xbox LIVE Party screen.
ShowPartySessions | Shows the Play with Party Member screen.
ShowPlayerReview | Shows the Player Review user interface.
ShowPlayers | Shows the Players user interface.
ShowSignIn | Shows the user interface a gamer uses for signing into Xbox LIVE.

Expand image See Also

Reference

Guide Class
Microsoft.Xna.Framework.GamerServices Namespace


Guide Methods

Guide Methods

Expand image Public Methods

Name | Description
BeginShowKeyboardInput | Overloaded. Overloads for showing the software keyboard interface asynchronously.
BeginShowMessageBox | Overloaded. Begins the process of displaying a message box with the specified parameters.
DelayNotifications | Delays system notifications for a specified time.
EndShowKeyboardInput | Ends the display of the keyboard input dialog box.
EndShowMessageBox | Ends the display of a message box.
ShowComposeMessage | Shows the Compose Message user interface.
ShowFriendRequest | Shows the Friend Request user interface.
ShowFriends | Shows the Friends user interface.
ShowGameInvite | Overloaded. Overloads to display the game invitation user interface.
ShowGamerCard | Shows the Gamer Card user interface.
ShowMarketplace | Displays the marketplace user interface.
ShowMessages | Shows the Messages user interface.
ShowParty | Shows the Xbox LIVE Party screen.
ShowPartySessions | Shows the Play with Party Member screen.
ShowPlayerReview | Shows the Player Review user interface.
ShowPlayers | Shows the Players user interface.
ShowSignIn | Shows the user interface a gamer uses for signing into Xbox LIVE.

Expand image See Also

Reference

Guide Class
Microsoft.Xna.Framework.GamerServices Namespace


Guide.BeginShowKeyboardInput Method

Guide.BeginShowKeyboardInput Method

Overloads for showing the software keyboard interface asynchronously.

Expand image Overload List

Name | Description
Guide.BeginShowKeyboardInput (PlayerIndex, String, String, String, AsyncCallback, Object) | Begins the process for displaying asynchronously the software keyboard interface for a gamer.
Guide.BeginShowKeyboardInput (PlayerIndex, String, String, String, AsyncCallback, Object, Boolean) | Begins the process for displaying asynchronously the software keyboard interface for a gamer by using the password mode if it is specified.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace


Guide.BeginShowKeyboardInput Method (PlayerIndex, String, String, String, AsyncCallback, Object)

Guide.BeginShowKeyboardInput Method (PlayerIndex, String, String, String, AsyncCallback, Object)
See Also
CollapseAll image

Begins the process for displaying asynchronously the software keyboard interface for a gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static IAsyncResult BeginShowKeyboardInput (
         PlayerIndex player,
         string title,
         string description,
         string defaultText,
         AsyncCallback callback,
         Object state
)

Parameters

player
Index of the player providing input. On platforms such as Windows Phone or Windows that support only one player, the valid value is PlayerIndex.One.
title
Title of the interface dialog box.
description
Text of the interface dialog box.
defaultText
Default text displayed in the input area when the interface dialog box is first shown.
callback
The method to be called once the asynchronous operation is finished.
state
A user-created object uniquely identifying this request.

Return Value

An IAsyncResult used to track the progress of the method.

Expand image Exceptions

Exception type | Condition
ArgumentException | title, description, or defaultText is larger than the maximum allowed string length of 260 characters.
ArgumentOutOfRangeException | player is not a valid value. On Windows and Windows Phone, the only valid option is PlayerIndex.One.

Expand image See Also

Tasks

Displaying a Software Input Panel (Windows Phone, Xbox 360)
Working with Asynchronous Methods in XNA Game Studio

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.BeginShowKeyboardInput Method (PlayerIndex, String, String, String, AsyncCallback, Object, Boolean)

Guide.BeginShowKeyboardInput Method (PlayerIndex, String, String, String, AsyncCallback, Object, Boolean)
See Also
CollapseAll image

Begins the process for displaying asynchronously the software keyboard interface for a gamer by using the password mode if it is specified.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static IAsyncResult BeginShowKeyboardInput (
         PlayerIndex player,
         string title,
         string description,
         string defaultText,
         AsyncCallback callback,
         Object state,
         bool usePasswordMode
)

Parameters

player
Index of the player providing input. On platforms such as Windows Phone or Windows that support only one player, the valid value is PlayerIndex.One.
title
Title of the interface dialog box.
description
Text of the interface dialog box.
defaultText
Default text displayed in the input area when the interface dialog box is first shown.
callback
Method to be called once the asynchronous operation is finished.
state
User-created object uniquely identifying this request.
usePasswordMode
Specify true to enable password mode, or false to disable it. If the password mode is specified, the characters that the player types are not echoed in the input area.

Return Value

An IAsyncResult used to track the progress of the method.

Expand image Exceptions

Exception type | Condition
ArgumentException | title, description, or defaultText is larger than the maximum allowed string length of 260 characters.
ArgumentOutOfRangeException | player is not a valid value. On Windows and Windows Phone, the only valid option is PlayerIndex.One.

Expand image See Also

Tasks

Displaying a Software Input Panel (Windows Phone, Xbox 360)
Working with Asynchronous Methods in XNA Game Studio

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.BeginShowMessageBox Method

Guide.BeginShowMessageBox Method

Begins the process of displaying a message box with the specified parameters. The display operation is performed asynchronously.

Expand image Overload List

Name | Description
Guide.BeginShowMessageBox (PlayerIndex, String, String, Generic IEnumerable, Int32, MessageBoxIcon, AsyncCallback, Object) | Begins the process of displaying a message box for a particular player.
Guide.BeginShowMessageBox (String, String, Generic IEnumerable, Int32, MessageBoxIcon, AsyncCallback, Object) | Begins the process of displaying a message box to which any user on the system can respond.

Expand image See Also

Reference

GamerPrivileges.AllowCommunication Property
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace


Guide.BeginShowMessageBox Method (PlayerIndex, String, String, Generic IEnumerable, Int32, MessageBoxIcon, AsyncCallback, Object)

Guide.BeginShowMessageBox Method (PlayerIndex, String, String, Generic IEnumerable, Int32, MessageBoxIcon, AsyncCallback, Object)
See Also
CollapseAll image

Begins the process of displaying a message box for a particular player.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static IAsyncResult BeginShowMessageBox (
         PlayerIndex player,
         string title,
         string text,
         IEnumerable<string> buttons,
         int focusButton,
         MessageBoxIcon icon,
         AsyncCallback callback,
         Object state
)

Parameters

player
Target player of the message box. On Windows or Windows Phone, the only valid option is PlayerIndex.One.
title
Title of the message box.
text
Text that will be displayed by the message box.
buttons
Captions for the message box buttons. The maximum number of buttons is two on Windows Phone, and three on Xbox 360 or Windows.
focusButton
Zero-based index specifying which button has the focus.
icon
Type of icon displayed in the message box.
callback
Method to be called once the asynchronous operation has finished.
state
User-created object uniquely identifying this request.

Return Value

An IAsyncResult used to track the progress of the method.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Either IsInitialized was not called previously, or a Guide user interface screen currently is active.

Expand image Remarks

This overload requires that the player for whom the message is targeted responds to the message.

Best Practice

You can check GamerPrivileges.AllowCommunication to determine if a player is allowed to send and receive communications before displaying a menu option that would call this method.

Expand image See Also

Tasks

Displaying a Message Box (Windows Phone, Windows, Xbox 360)
Working with Asynchronous Methods in XNA Game Studio

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.BeginShowMessageBox Method (String, String, Generic IEnumerable, Int32, MessageBoxIcon, AsyncCallback, Object)

Guide.BeginShowMessageBox Method (String, String, Generic IEnumerable, Int32, MessageBoxIcon, AsyncCallback, Object)
See Also
CollapseAll image

Begins the process of displaying a message box to which any user on the system can respond.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static IAsyncResult BeginShowMessageBox (
         string title,
         string text,
         IEnumerable<string> buttons,
         int focusButton,
         MessageBoxIcon icon,
         AsyncCallback callback,
         Object state
)

Parameters

title
Title of the message box.
text
Text that will be displayed by the message box.
buttons
Captions for message box buttons. The maximum number of buttons is two on Windows Phone, and three on Xbox 360 or Windows.
focusButton
Zero-based index specifying which button has the focus.
icon
Type of icon displayed in the message box.
callback
Method to be called once the asynchronous operation is finished.
state
User-created object uniquely identifying this request.

Return Value

An IAsyncResult used to track the progress of the method.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Either IsInitialized was not called previously, or a Guide user interface screen currently is active.

Expand image Remarks

On Xbox 360, this overload allows any player on the system to respond to the message.

Expand image See Also

Tasks

Displaying a Message Box (Windows Phone, Windows, Xbox 360)
Working with Asynchronous Methods in XNA Game Studio

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.DelayNotifications Method

Guide.DelayNotifications Method

Delays system notifications for a specified time.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void DelayNotifications (
         TimeSpan delay
)

Parameters

delay

Time, in seconds, of the delay.

Calling this function while notifications are already delayed has no effect. The maximum delay is 120 seconds. If the specified duration exceeds the maximum, the maximum value is used.

Expand image Remarks

Windows Phone Specific Information
This method cannot be used on Windows Phone. If called, it throws a NotSupportedException.

Use DelayNotifications to suppress pop-up notifications during critical times such as cut scenes. Once the delay interval has passed, any deferred notifications are individually displayed in the order they were sent.

Titles cannot call DelayNotifications multiple times in a row. There must be an opportunity for the system application to display notifications to gamers.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.EndShowKeyboardInput Method

Guide.EndShowKeyboardInput Method

Ends the display of the keyboard input dialog box.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static string EndShowKeyboardInput (
         IAsyncResult result
)

Parameters

result
The IAsyncResult returned from BeginShowKeyboardInput.

Return Value

Input received from the gamer.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.EndShowMessageBox Method

Guide.EndShowMessageBox Method

Ends the display of a message box.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static Nullable<int> EndShowMessageBox (
         IAsyncResult result
)

Parameters

result
The IAsyncResult returned from BeginShowMessageBox.

Return Value

The identity of the message box button pressed by the user.

Expand image Remarks

This call blocks until the display operation is finished. Typically, you call this from the callback function specified in the callback argument of BeginShowMessageBox.

Each call to EndShowMessageBox must match an earlier call to BeginShowMessageBox.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowComposeMessage Method

Guide.ShowComposeMessage Method

Shows the Compose Message user interface. A gamer uses this user interface to write messages to other gamers.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowComposeMessage (
         PlayerIndex player,
         string text,
         IEnumerable<Gamer> recipients
)

Parameters

player
Gamer composing the message.
text
Text of the message.
recipients
Collection of gamers receiving the message.

If this is null, the Select Gamertag user interface is displayed.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | For Windows applications, this exception is thrown if player is not PlayerIndex.One.
ArgumentException | The message text is null, empty, or exceeds 200 characters. This exception also is thrown if any recipients have a value of null or if there are more than 100 recipients.
NotSupportedException | This method is not supported on the current platform.

Expand image Remarks

Windows Phone Specific Information
This method cannot be used on Windows Phone. If called, it throws a NotSupportedException.
Best Practice

You can check GamerPrivileges.AllowCommunication to determine if a player is allowed to send and receive communications before displaying a menu option that would call this method.

Expand image See Also

Reference

GamerPrivileges.AllowCommunication Property
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowFriendRequest Method

Guide.ShowFriendRequest Method

Shows the Friend Request user interface.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowFriendRequest (
         PlayerIndex player,
         Gamer gamer
)

Parameters

player

Index of the player making the request.

The profile specified by player must be signed in when calling this function.

gamer
Recipient of the request.

Expand image Remarks

Windows Phone Specific Information
This method cannot be used on Windows Phone. If called, it throws a NotSupportedException.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowFriends Method

Guide.ShowFriends Method

Shows the Friends user interface.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowFriends (
         PlayerIndex player
)

Parameters

player

Index of the player making the request.

The profile specified by player must be signed in when calling this function.

Expand image Remarks

Windows Phone Specific Information
This method cannot be used on Windows Phone. If called, it throws a NotSupportedException.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowGameInvite Method

Guide.ShowGameInvite Method

Overloads to display the game invitation user interface.

Expand image Overload List

Name | Description
Guide.ShowGameInvite (PlayerIndex, Generic IEnumerable) | Displays the game invitation user interface, taking a session ID.
Guide.ShowGameInvite (String) | Displays the game invitation user interface, taking a session ID.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace


Guide.ShowGameInvite Method (PlayerIndex, Generic IEnumerable)

Guide.ShowGameInvite Method (PlayerIndex, Generic IEnumerable)
See Also
CollapseAll image

Displays the game invitation user interface, taking a session ID.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowGameInvite (
         PlayerIndex player,
         IEnumerable<Gamer> recipients
)

Parameters

player
Index of the player initiating the invitation.
recipients
List of gamers who receive the invitation. If null, the Guide prompts the player to specify a recipient.

Expand image Remarks

See Inviting Players to Join Your Game for more information about adding game invitation support to your title.

You can check GamerPrivileges.AllowCommunication to determine if a player is allowed to send and receive communications before displaying a menu option that would call this method.

Windows Phone Specific Information

On Windows Phone, this method causes the game to close so that the system user interface can be shown. For information about how to prepare for such an interruption, see Handling Interruptions on Windows Phone.

No response to this method is returned. The player can choose invitation recipients from his or her own contact list on the phone. For each recipient chosen, an email is sent to the contact's email address.

If the recipient has an Xbox LIVE Gamertag associated with this email address and a Windows Phone, an invitation also is sent directly to the recipient's phone. If the recipient does not have an Xbox LIVE Gamertag associated with the email address or does not have a Windows Phone, the recipient only receives the email.

The email will contain a link to play the game. This link leads to a redirect service so that when the link is clicked an appropriate action is taken based on the platform the recipient is using.

  • On a PC, the link opens a web-based version of the game, if one exists.
  • On the phone, the link either opens the game if it is already installed on the recipient's phone, or it goes to the Marketplace if the game is not installed.

Expand image See Also

Reference

NetworkSession.InviteAccepted Event
NetworkSession.JoinInvited Method
NetworkSession.BeginJoinInvited Method
NetworkSession.EndJoinInvited Method
GamerPrivileges.AllowCommunication Property
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowGameInvite Method (String)

Guide.ShowGameInvite Method (String)
See Also
CollapseAll image

Displays the game invitation user interface, taking a session ID.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowGameInvite (
         string sessionId
)

Parameters

sessionId
The session ID to use for the game invitation.

Expand image Remarks

See Inviting Players to Join Your Game for more information about adding game invitation support to your title.

You can check GamerPrivileges.AllowCommunication to determine if a player is allowed to send and receive communications before displaying a menu option that would call this method.

Windows Phone Specific Information

On Windows Phone, this method causes the game to close so that the system user interface can be shown. For information about how to prepare for such an interruption, see Handling Interruptions on Windows Phone.

No response to this method is returned. The player can choose invitation recipients from his or her own contact list on the phone. For each recipient chosen, an email is sent to the contact's email address.

If the recipient has an Xbox LIVE Gamertag associated with this email address and a Windows Phone, an invitation also is sent directly to the recipient's phone. If the recipient does not have an Xbox LIVE Gamertag associated with the email address or does not have a Windows Phone, the recipient only receives the email.

The email will contain a link to play the game. This link leads to a redirect service so that when the link is clicked an appropriate action is taken based on the platform the recipient is using.

  • On a PC, the link opens a web-based version of the game, if one exists.
  • On the phone, the link either opens the game if it is already installed on the recipient's phone, or it goes to the Marketplace if the game is not installed.

Expand image See Also

Reference

NetworkSession.InviteAccepted Event
NetworkSession.JoinInvited Method
NetworkSession.BeginJoinInvited Method
NetworkSession.EndJoinInvited Method
GamerPrivileges.AllowCommunication Property
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowGamerCard Method

Guide.ShowGamerCard Method

Shows the Gamer Card user interface.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowGamerCard (
         PlayerIndex player,
         Gamer gamer
)

Parameters

player

Index of the player making the request.

The profile specified by player must be signed in when calling this function.

gamer
Owner of the gamer card being requested for display.

Expand image Remarks

If AllowProfileViewing is false, a GamerPrivilegeException is thrown.

Best Practice

You can check GamerPrivileges.AllowProfileViewing to determine if a player is allowed to send and receive communications before displaying a menu option that would call this method.

Expand image See Also

Reference

GamerPrivileges.AllowProfileViewing Property
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowMarketplace Method

Guide.ShowMarketplace Method

Displays the marketplace user interface.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowMarketplace (
         PlayerIndex player
)

Parameters

player
Index of the controller for the player making the request.

Expand image Remarks

You can check GamerPrivileges.AllowPurchaseContent to determine if a player is allowed to purchase content before displaying a menu option that would call this method.

When a trial game is exiting, you can present a Marketplace offer by using the Guide.ShowMarketplace method. You can check if a game is in trial mode by using Guide.IsTrialMode, and write code that is performed on game exit in the Game.Exit method. If the game is not in trial mode, ShowMarketplace will do nothing.

Windows Phone Specific Information
On Windows Phone, this method causes the game to close so that the system user interface can be shown. For information about how to prepare for such an interruption, see Handling Interruptions on Windows Phone.

Expand image See Also

Tasks

Simulating Trial Mode for Marketplace Content (Xbox 360, Windows Phone)

Reference

GamerPrivileges.AllowPurchaseContent Property
Guide.SimulateTrialMode Property
Guide.IsTrialMode Property
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowMessages Method

Guide.ShowMessages Method

Shows the Messages user interface.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowMessages (
         PlayerIndex player
)

Parameters

player

Index of the player making the request.

The profile specified by player must be signed in when calling this function.

Expand image Remarks

Windows Phone Specific Information
This method cannot be used on Windows Phone. If called, it throws a NotSupportedException.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowParty Method

Guide.ShowParty Method

Shows the Xbox LIVE Party screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowParty (
         PlayerIndex player
)

Parameters

player
The player index for whom to bring up the Xbox LIVE Party screen.

Expand image Remarks

Windows Phone Specific Information
This method cannot be used on Windows Phone. If called, it throws a NotSupportedException.

Shows the Xbox LIVE Party screen, which allows players to invite others to the party, to invite party members to the current game session, or to chat with party members.

Expand image See Also

Tasks

Inviting a Group to Join Your Game (Xbox 360)
Inviting Players to Join Your Game

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowPartySessions Method

Guide.ShowPartySessions Method

Shows the Play with Party Member screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowPartySessions (
         PlayerIndex player
)

Parameters

player
The player index for whom the list of game sessions with party members is shown.

Expand image Remarks

Windows Phone Specific Information
This method cannot be used on Windows Phone. If called, it throws a NotSupportedException.

This method brings up the Play with Party Member screen, which allows players to join game sessions with fellow party members in the current title.

If the player is not currently in a party, or if the platform lacks Xbox LIVE Party support, this method shows the Friends screen instead.

Expand image See Also

Tasks

Inviting a Group to Join Your Game (Xbox 360)

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowPlayerReview Method

Guide.ShowPlayerReview Method

Shows the Player Review user interface.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowPlayerReview (
         PlayerIndex player,
         Gamer gamer
)

Parameters

player

Index of the player making the request.

The profile specified by player must be signed in when calling this function.

gamer
Player being reviewed.

Expand image Remarks

Windows Phone Specific Information
This method cannot be used on Windows Phone. If called, it throws a NotSupportedException.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowPlayers Method

Guide.ShowPlayers Method

Shows the Players user interface.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowPlayers (
         PlayerIndex player
)

Parameters

player

Index of the player making the request.

The profile specified by player must be signed in when calling this function.

Expand image Remarks

Windows Phone Specific Information
This method cannot be used on Windows Phone. If called, it throws a NotSupportedException.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.ShowSignIn Method

Guide.ShowSignIn Method

Shows the user interface a gamer uses for signing into Xbox LIVE.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static void ShowSignIn (
         int paneCount,
         bool onlineOnly
)

Parameters

paneCount

Number of panes displayed at sign in. Each pane accepts a single gamer.

On Windows and Windows Phone, only a single pane can be displayed. On Xbox 360, valid values are 1, 2, and 4.

onlineOnly
Determines the profile types being displayed. true if only online profiles are displayed; false otherwise. If onlineOnly is true, local gamers can sign in as guests of a profile currently signed in.

Expand image Exceptions

Exception type | Condition
ArgumentException | The paneCount argument is invalid. Valid options for this parameter are 1, 2, and 4.

Expand image Remarks

Windows Phone Specific Information
If gamer services are not yet initialized, this method throws an InvalidOperationException. If gamer services are initialized, this method attempts to fetch gamer privileges if needed. In either case, no UI is shown when this method is called on Windows Phone.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide Properties

Guide Properties

Expand image Public Properties

Name | Description
IsScreenSaverEnabled | Gets or sets the current state of the screen saver.
IsTrialMode | Determines whether the game is running currently in limited trial mode.
IsVisible | Determines if a Guide user interface screen is active.
NotificationPosition | Retrieves or sets the location where notifications will appear on the screen.
SimulateTrialMode | Allows titles to simulate trial mode restrictions when testing using the Development configuration.

Expand image See Also

Reference

Guide Class
Microsoft.Xna.Framework.GamerServices Namespace


Guide.IsScreenSaverEnabled Property

Guide.IsScreenSaverEnabled Property

Gets or sets the current state of the screen saver. This property has no effect for Windows games.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static bool IsScreenSaverEnabled { get; set; }

Property Value

true if the screen saver is enabled; false otherwise.

Expand image Remarks

The IsScreenSaverEnabled property is a per-game property. Disabling the screen saver for a game does not permanently disable the screen saver. Use this method when displaying cut-scenes or during periods when the gamer could become inactive for a long time.

Windows Phone Specific Information

This property changes the UserIdleDetection setting on Windows Phone. It can be used to prevent the screen from locking when the game does not expect touch input for a time. This is particularly useful for games that use alternative input methods to touch such as sound or accelerometer input.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.IsTrialMode Property

Guide.IsTrialMode Property

Determines whether the game is running currently in limited trial mode.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static bool IsTrialMode { get; set; }

Property Value

true if the game is running currently in limited trial mode; false otherwise.

Expand image Remarks

Best Practice
When a trial game is exiting, you can present a marketplace offer using the Guide.ShowMarketplace method. You can write code that is performed on game exit in the Game.Exit method.

Limited Trial Mode

While in trial mode, games will be unable to use the Xbox LIVE servers to connect to other machines over the Internet for player match or ranked network sessions. Note that this does not affect system link sessions, which are always available.

The Guide.IsTrialMode property always returns true when a game begins. Guide.IsTrialMode may change to false shortly after game launch if a license is detected when a player signs in, or it could change at any time after game launch if a license is acquired.

XNA Creators Club games can be launched in simulated trial mode by setting the Guide.SimulateTrialMode property to true when the game starts. During development, when XNA Creators Club games are running on an Xbox 360 console, there is also an option in the dash to launch a game in simulated trial mode.

Indie games downloaded from the Xbox LIVE Marketplace will run in limited trial mode until one of the signed-in gamers acquires a license for the game. Detection of a game license could occur as part of game startup, in response to an in-game purchase, or as part of user signing in.

For Xbox LIVE Indie Games running in trial mode, gameplay will be limited to a short trial period. At the end of the gameplay period, the player will see an expiration screen. The player can then either exit the game via the B or Back button or use the X button to unlock the game. If the player chooses to unlock the game, a Marketplace screen will be displayed. The player can then buy the full version of the game.

While the expiration screen shows, Game.IsActive will return false, and all input to the game will be blocked. Rendering can continue. However, the expiration screen obscures most of the rendering process, and any controller vibration will be stopped.

Best Practice
It is generally a good idea to pause the game when Game.IsActive is false.

For XNA Creators Club games running in simulated trial mode there will be no time limitation applied to gameplay.

Expand image See Also

Tasks

Simulating Trial Mode for Marketplace Content (Xbox 360, Windows Phone)

Reference

Guide.ShowMarketplace Method
Guide.SimulateTrialMode Property
SignedInGamer.GameDefaults Property
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.IsVisible Property

Guide.IsVisible Property

Determines if a Guide user interface screen is active.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static bool IsVisible { get; set; }

Property Value

true if a user interface screen is displayed; false otherwise.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The gamer services functionality must be initialized before this property is accessed.

Expand image Remarks

It is not possible to bring up another Guide user interface screen if IsVisible is true.

Windows Phone Specific Information

On Windows Phone, IsVisible indicates that a dialog is open, or that the game is not currently in the foreground.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.NotificationPosition Property

Guide.NotificationPosition Property

Retrieves or sets the location where notifications will appear on the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static NotificationPosition NotificationPosition { get; set; }

Property Value

Defines the positioning of the notification message box.

Expand image Remarks

Windows Phone Specific Information

This property cannot be set on Windows Phone. Any attempt to set it results in a NotSupportedException. This property can be read, but will always report the same position.

Expand image See Also

Reference

Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Guide.SimulateTrialMode Property

Guide.SimulateTrialMode Property

Allows titles to simulate trial mode restrictions when testing using the Development configuration. Setting this property to true in the game constructor will artificially force IsTrialMode to return true.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static bool SimulateTrialMode { get; set; }

Property Value

true to simulate trial mode restrictions in a Development configuration; false otherwise.

Expand image Remarks

You can set SimulateTrialMode to false at some later point (perhaps calling the ShowMarketplace API at the same time) to simulate purchasing the full game.

Limited Trial Mode

While in trial mode, games will be unable to use the Xbox LIVE servers to connect to other machines over the Internet for player match or ranked network sessions. Note that this does not affect system link sessions, which are always available.

The Guide.IsTrialMode property always returns true when a game begins. Guide.IsTrialMode may change to false shortly after game launch if a license is detected when a player signs in, or it could change at any time after game launch if a license is acquired.

XNA Creators Club games can be launched in simulated trial mode by setting the Guide.SimulateTrialMode property to true when the game starts. During development, when XNA Creators Club games are running on an Xbox 360 console, there is also an option in the dash to launch a game in simulated trial mode.

Indie games downloaded from the Xbox LIVE Marketplace will run in limited trial mode until one of the signed-in gamers acquires a license for the game. Detection of a game license could occur as part of game startup, in response to an in-game purchase, or as part of user signing in.

For Xbox LIVE Indie Games running in trial mode, gameplay will be limited to a short trial period. At the end of the gameplay period, the player will see an expiration screen. The player can then either exit the game via the B or Back button or use the X button to unlock the game. If the player chooses to unlock the game, a Marketplace screen will be displayed. The player can then buy the full version of the game.

While the expiration screen shows, Game.IsActive will return false, and all input to the game will be blocked. Rendering can continue. However, the expiration screen obscures most of the rendering process, and any controller vibration will be stopped.

Best Practice
It is generally a good idea to pause the game when Game.IsActive is false.

For XNA Creators Club games running in simulated trial mode there will be no time limitation applied to gameplay.

Expand image See Also

Tasks

Simulating Trial Mode for Marketplace Content (Xbox 360, Windows Phone)

Reference

Guide.ShowMarketplace Method
Guide.IsTrialMode Property
NetworkGamer.IsGuest Property
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GuideAlreadyVisibleException Class

GuideAlreadyVisibleException Class
See Also Members
CollapseAll image

Thrown if an attmept is made to display a component of the Guide user interface when a Guide component is already displayed.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
[SerializableAttribute]
public class GuideAlreadyVisibleException : Exception

Expand image See Also

Reference

GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GuideAlreadyVisibleException Members

GuideAlreadyVisibleException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the GuideAlreadyVisibleException type.

Expand image Public Constructors

 | Name | Description
Public Method | GuideAlreadyVisibleException | Overloaded. Creates an instance of GuideAlreadyVisibleException.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GuideAlreadyVisibleException Class
Microsoft.Xna.Framework.GamerServices Namespace


GuideAlreadyVisibleException Constructor

GuideAlreadyVisibleException Constructor

Creates an instance of GuideAlreadyVisibleException.

Expand image Overload List

Name | Description
GuideAlreadyVisibleException () | Initializes an empty instance of GuideAlreadyVisibleException.
GuideAlreadyVisibleException (SerializationInfo, StreamingContext) | Initializes an instance of GuideAlreadyVisibleException with the specified streaming context.
GuideAlreadyVisibleException (String) | Initializes an instance of GuideAlreadyVisibleException with the specified error message.
GuideAlreadyVisibleException (String, Exception) | Initializes an instance of GuideAlreadyVisibleException with the specified error message and related inner exception.

Expand image See Also

Reference

GuideAlreadyVisibleException Class
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace


GuideAlreadyVisibleException Constructor ()

GuideAlreadyVisibleException Constructor ()
See Also
CollapseAll image

Initializes an empty instance of GuideAlreadyVisibleException.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GuideAlreadyVisibleException ()

Expand image See Also

Reference

GuideAlreadyVisibleException Class
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GuideAlreadyVisibleException Constructor (SerializationInfo, StreamingContext)

GuideAlreadyVisibleException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Note
This constructor is available only when developing for Windows.
Initializes an instance of GuideAlreadyVisibleException with the specified streaming context.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
protected GuideAlreadyVisibleException (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
Describes the displayed Guide component when the exception occurred.
context
Describes the stream where the exception occurred.

Expand image See Also

Reference

GuideAlreadyVisibleException Class
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


GuideAlreadyVisibleException Constructor (String)

GuideAlreadyVisibleException Constructor (String)
See Also
CollapseAll image

Initializes an instance of GuideAlreadyVisibleException with the specified error message.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GuideAlreadyVisibleException (
         string message
)

Parameters

message
A message describing the error.

Expand image See Also

Reference

GuideAlreadyVisibleException Class
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GuideAlreadyVisibleException Constructor (String, Exception)

GuideAlreadyVisibleException Constructor (String, Exception)
See Also
CollapseAll image

Initializes an instance of GuideAlreadyVisibleException with the specified error message and related inner exception.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GuideAlreadyVisibleException (
         string message,
         Exception innerException
)

Parameters

message
A message describing the error.
innerException
The inner exception related to this exception.

Expand image See Also

Reference

GuideAlreadyVisibleException Class
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GuideAlreadyVisibleException Methods

GuideAlreadyVisibleException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GuideAlreadyVisibleException Class
Microsoft.Xna.Framework.GamerServices Namespace


GuideAlreadyVisibleException Properties

GuideAlreadyVisibleException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

GuideAlreadyVisibleException Class
Microsoft.Xna.Framework.GamerServices Namespace


IAvatarAnimation Interface

IAvatarAnimation Interface

Provides methods and properties for animating an avatar using custom animations. Allows for easier integration between custom animations and built-in animations.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public interface IAvatarAnimation

Expand image Remarks

For more information, see Rendering and Animating Avatars (Xbox 360).

Expand image See Also

Reference

IAvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


IAvatarAnimation Members

IAvatarAnimation Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the IAvatarAnimation type.

Expand image Public Properties

 | Name | Description
Public Property | BoneTransforms | Gets the current position of the bones at the time specified by CurrentPosition.
Public Property | CurrentPosition | Gets or sets the current time position in the animation.
Public Property | Expression | Gets the expression of the related animation at the current time position.
Public Property | Length | Gets the length of the current animation.

Expand image Public Methods

 | Name | Description
Public Method | Update | Updates the current time position of the avatar animation.

Expand image See Also

Reference

IAvatarAnimation Interface
Microsoft.Xna.Framework.GamerServices Namespace


IAvatarAnimation Methods

IAvatarAnimation Methods

Expand image Public Methods

 | Name | Description
Public Method | Update | Updates the current time position of the avatar animation.

Expand image See Also

Reference

IAvatarAnimation Interface
Microsoft.Xna.Framework.GamerServices Namespace


IAvatarAnimation.Update Method

IAvatarAnimation.Update Method

Updates the current time position of the avatar animation.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public void Update (
         TimeSpan elapsedAnimationTime,
         bool loop
)

Parameters

elapsedAnimationTime
Elapsed time since the last animation frame. This value can be a positive or a negative time span. If the value is negative, animation playback is reversed.
loop
true if animation playback is to be looped; otherwise, false.

Expand image See Also

Reference

IAvatarAnimation Interface
IAvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


IAvatarAnimation Properties

IAvatarAnimation Properties

Expand image Public Properties

 | Name | Description
Public Property | BoneTransforms | Gets the current position of the bones at the time specified by CurrentPosition.
Public Property | CurrentPosition | Gets or sets the current time position in the animation.
Public Property | Expression | Gets the expression of the related animation at the current time position.
Public Property | Length | Gets the length of the current animation.

Expand image See Also

Reference

IAvatarAnimation Interface
Microsoft.Xna.Framework.GamerServices Namespace


IAvatarAnimation.BoneTransforms Property

IAvatarAnimation.BoneTransforms Property

Gets the current position of the bones at the time specified by CurrentPosition.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public ReadOnlyCollection<Matrix> BoneTransforms { get; }

Property Value

Collection of bone transforms.

Expand image See Also

Reference

IAvatarAnimation Interface
IAvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


IAvatarAnimation.CurrentPosition Property

IAvatarAnimation.CurrentPosition Property

Gets or sets the current time position in the animation.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public TimeSpan CurrentPosition { get; set; }

Property Value

Current time position of the animation.

Expand image See Also

Reference

IAvatarAnimation Interface
IAvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


IAvatarAnimation.Expression Property

IAvatarAnimation.Expression Property

Gets the expression of the related animation at the current time position.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public AvatarExpression Expression { get; }

Property Value

Expression of the avatar.

Expand image See Also

Reference

IAvatarAnimation Interface
IAvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


IAvatarAnimation.Length Property

IAvatarAnimation.Length Property

Gets the length of the current animation.
Windows Specific Information
Avatar-related APIs are exposed on Windows to ease cross-platform development between Windows and the Xbox 360. All avatar-related methods return default values, and rendering methods do not draw anything to the screen.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.Avatar (in microsoft.xna.framework.avatar.dll)

Expand image Syntax

C#
public TimeSpan Length { get; }

Property Value

Length of the animation.

Expand image See Also

Reference

IAvatarAnimation Interface
IAvatarAnimation Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


InviteAcceptedEventArgs Class

InviteAcceptedEventArgs Class
See Also Members
CollapseAll image

Represents the arguments passed to an InviteAccepted event.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public class InviteAcceptedEventArgs : EventArgs

Expand image See Also

Tasks

Inviting Players to Join Your Game

Reference

InviteAcceptedEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


InviteAcceptedEventArgs Members

InviteAcceptedEventArgs Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the InviteAcceptedEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | InviteAcceptedEventArgs | Initializes a new instance of InviteAcceptedEventArgs by using a gamer that is signed in and a Boolean value that indicates if the invitation is for the current local session.

Expand image Public Properties

 | Name | Description
Public Property | Gamer | The signed-in gamer who is accepting the game invitation.
Public Property | IsCurrentSession | Indicates if the invitation is for the current local session.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

InviteAcceptedEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace


InviteAcceptedEventArgs Constructor

InviteAcceptedEventArgs Constructor

Initializes a new instance of InviteAcceptedEventArgs by using a gamer that is signed in and a Boolean value that indicates if the invitation is for the current local session.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public InviteAcceptedEventArgs (
         SignedInGamer gamer,
         bool isCurrentSession
)

Parameters

gamer
The gamer who is accepting the game invitation.
isCurrentSession
Indicates if the invitation is for the current local session.

Expand image See Also

Reference

InviteAcceptedEventArgs Class
InviteAcceptedEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


InviteAcceptedEventArgs Methods

InviteAcceptedEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

InviteAcceptedEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace


InviteAcceptedEventArgs Properties

InviteAcceptedEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | Gamer | The signed-in gamer who is accepting the game invitation.
Public Property | IsCurrentSession | Indicates if the invitation is for the current local session.

Expand image See Also

Reference

InviteAcceptedEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace


InviteAcceptedEventArgs.Gamer Property

InviteAcceptedEventArgs.Gamer Property

The signed-in gamer who is accepting the game invitation.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public SignedInGamer Gamer { get; }

Property Value

The signed-in gamer who is accepting the game invitation.

Expand image See Also

Tasks

Inviting Players to Join Your Game

Reference

InviteAcceptedEventArgs Class
InviteAcceptedEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


InviteAcceptedEventArgs.IsCurrentSession Property

InviteAcceptedEventArgs.IsCurrentSession Property

Indicates if the invitation is for the current local session.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsCurrentSession { get; }

Property Value

Returns true if the invitation is for the current local session, and false if it is not.

Expand image Remarks

If IsCurrentSession is true, indicating that another local gamer has joined the session, call NetworkSession.AddLocalGamer to add more gamers to the session. If IsCurrentSession is false, indicating the invitation is from a session that has not been joined, call NetworkSession.JoinInvited to allow the gamer to join the remote session.

Expand image See Also

Tasks

Inviting Players to Join Your Game

Reference

InviteAcceptedEventArgs Class
InviteAcceptedEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardEntry Class

LeaderboardEntry Class
See Also Members
CollapseAll image

Class representing a single row of a leaderboard, holding all the information a specific gamer has uploaded to the board.

This is used when both reading and writing leaderboard data.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class LeaderboardEntry

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardEntry Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardEntry Members

LeaderboardEntry Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the LeaderboardEntry type.

Expand image Public Properties

 | Name | Description
Public Property | Columns | Provides access to the columns for this leaderboard entry.
Public Property | Gamer | Provides access to gamer information for this leaderboard entry.
Public Property | Rating | Provides access to the rating associated with this leaderboard entry.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardEntry Class
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardEntry Methods

LeaderboardEntry Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardEntry Class
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardEntry Properties

LeaderboardEntry Properties

Expand image Public Properties

 | Name | Description
Public Property | Columns | Provides access to the columns for this leaderboard entry.
Public Property | Gamer | Provides access to gamer information for this leaderboard entry.
Public Property | Rating | Provides access to the rating associated with this leaderboard entry.

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardEntry Class
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardEntry.Columns Property

LeaderboardEntry.Columns Property

Provides access to the columns for this leaderboard entry.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public PropertyDictionary Columns { get; }

Property Value

A PropertyDictionary containing columns information for this leaderboard entry.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Reference

LeaderboardEntry Class
LeaderboardEntry Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardEntry.Gamer Property

LeaderboardEntry.Gamer Property

Provides access to gamer information for this leaderboard entry.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public Gamer Gamer { get; }

Property Value

The gamer associated with this leaderboard entry.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Reference

LeaderboardEntry Class
LeaderboardEntry Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardEntry.Rating Property

LeaderboardEntry.Rating Property

Provides access to the rating associated with this leaderboard entry.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public long Rating { get; set; }

Property Value

The rating for this leaderboard entry.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Reference

LeaderboardEntry Class
LeaderboardEntry Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardIdentity Structure

LeaderboardIdentity Structure

Contains leaderboard identity information for a particular leaderboard.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public struct LeaderboardIdentity

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardIdentity Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardIdentity Members

LeaderboardIdentity Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the LeaderboardIdentity type.

Expand image Public Properties

 | Name | Description
Public Property | GameMode | Provides access to the game mode for this leaderboard identity.
Public Property | Key | The key string associated with this leaderboard identity.

Expand image Public Methods

 | Name | Description
 | Create | Overloaded. Creates a leaderboard identity.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardIdentity Structure
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardIdentity Methods

LeaderboardIdentity Methods

Expand image Public Methods

 | Name | Description
 | Create | Overloaded. Creates a leaderboard identity.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardIdentity Structure
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardIdentity.Create Method

LeaderboardIdentity.Create Method

Creates a leaderboard identity.

Expand image Overload List

Name | Description
LeaderboardIdentity.Create (LeaderboardKey) | Creates a leaderboard identity from a leaderboard key.
LeaderboardIdentity.Create (LeaderboardKey, Int32) | Creates a new LeaderboardIdentity from a leaderboard key and game mode value.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Reference

LeaderboardIdentity Structure
LeaderboardIdentity Members
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardIdentity.Create Method (LeaderboardKey)

LeaderboardIdentity.Create Method (LeaderboardKey)
See Also
CollapseAll image

Creates a leaderboard identity from a leaderboard key.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static LeaderboardIdentity Create (
         LeaderboardKey key
)

Parameters

key
The leaderboard key to use for this leaderboard identity.

Return Value

The new leaderboard identity; null if creation fails.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Reference

LeaderboardIdentity Structure
LeaderboardIdentity Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardIdentity.Create Method (LeaderboardKey, Int32)

LeaderboardIdentity.Create Method (LeaderboardKey, Int32)
See Also
CollapseAll image

Creates a new LeaderboardIdentity from a leaderboard key and game mode value.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static LeaderboardIdentity Create (
         LeaderboardKey key,
         int gameMode
)

Parameters

key
The leaderboard key to use for this leaderboard identity.
gameMode
The game mode value for this leaderboard identity.

Return Value

The new Leaderboard Identity. It is null if creation failed.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Reference

LeaderboardIdentity Structure
LeaderboardIdentity Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardIdentity Properties

LeaderboardIdentity Properties

Expand image Public Properties

 | Name | Description
Public Property | GameMode | Provides access to the game mode for this leaderboard identity.
Public Property | Key | The key string associated with this leaderboard identity.

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardIdentity Structure
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardIdentity.GameMode Property

LeaderboardIdentity.GameMode Property

Provides access to the game mode for this leaderboard identity.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int GameMode { get; set; }

Property Value

The game mode for this leaderboard identity.

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardIdentity Structure
LeaderboardIdentity Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardIdentity.Key Property

LeaderboardIdentity.Key Property

The key string associated with this leaderboard identity.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public string Key { get; set; }

Property Value

A string that represents the leaderboard identity key.

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardIdentity Structure
LeaderboardIdentity Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardKey Enumeration

LeaderboardKey Enumeration

Values used with LeaderboardIdentity.Create to select which leaderboard to access.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public enum LeaderboardKey

Expand image Remarks

Leaderboards are per title, and consist of the best scores or times for the player and his or her group of Xbox LIVE friends. Leaderboard data for other players is inaccessible.

Expand image Members

Member name | Description
BestScoreLifeTime | Best lifetime score for this player and his or her Xbox LIVE friends.
BestScoreRecent | Best recent scores for this player and his or her Xbox LIVE friends.
BestTimeLifeTime | Best lifetime times for this player and his or her Xbox LIVE friends.
BestTimeRecent | Best recent times for this player and his or her Xbox LIVE friends.

Expand image See Also

Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardOutcome Enumeration

LeaderboardOutcome Enumeration

Values used to provide an outcome for a player's leaderboard entry.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public enum LeaderboardOutcome

Expand image Remarks

LeaderboardOutcome is used to set the "Outcome" property of a leaderboard entry. For example:

    SignedInGamer gamer = SignedInGamer.SignedInGamers[0];

    // Retrieve LeaderboardWriter for the SignedInGamer.
    LeaderboardWriter writer = gamer.LeaderboardWriter;

    // Get leaderboard entry by specified leaderboard id.
    LeaderboardEntry entry = writer.GetLeaderboard(
        LeaderboardIdentity.Create(LeaderboardKey.BestScoreThisWeek));

    // Send the outcome of this match
    entry.Columns.SetValue("Outcome", LeaderboardOutcome.Win);

    // Send additional Leaderboard data...

Expand image Members

Member name | Description
Loss | Player lost the match.
None | No result reported.
Tie | Match resulted in a tie: no player won.
Win | Player won the match.

Expand image See Also

Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader Class

LeaderboardReader Class
See Also Members
CollapseAll image

Reads data from leaderboards.

Leaderboards can be read in three different ways:

  • By passing a page start index, which reads a range of consecutive entries starting at that rank. This typically is used to read the top scores by passing zero as the page start.
  • By passing a pivot gamer, which reads a range of consecutive entries centered on the rank of that gamer. This typically is used to display the entries immediately above and below the current local profile.
  • By passing a collection of gamers, which reads entries specifically for those profiles. This typically is used to display a friends leaderboard.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class LeaderboardReader : IDisposable

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader Members

LeaderboardReader Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the LeaderboardReader type.

Expand image Public Properties

 | Name | Description
Public Property | CanPageDown | Provides information about whether there are more leaderboard entries after the current page of entries.
Public Property | CanPageUp | Provides information about whether there are more leaderboard entries before the current page of entries.
Public Property | Entries | Gets the collection of leaderboard entries for the leaderboard.
Public Property | IsDisposed | Provides information about whether this leaderboard reader is disposed.
Public Property | LeaderboardIdentity | Provides the identity of the leaderboard.
Public Property | PageStart | Gets the index of the leaderboard entry at the start of the current page.
Public Property | TotalLeaderboardSize | Provides information about the total number of entries in the leaderboard.

Expand image Public Methods

 | Name | Description
Public Method | BeginPageDown | Begins an asynchronous read of the page of leaderboard data after the current page.
Public Method | BeginPageUp | Begins an asynchronous read of the page of leaderboard data before the current page.
 | BeginRead | Overloaded. Methods for reading a leaderboard asynchronously.
Public Method | Dispose | Releases all resources used by this LeaderboardReader.
Public Method | EndPageDown | Checks the result of an asynchonous PageDown operation.
Public Method | EndPageUp | Checks the result of an asynchonous PageUp operation.
 | EndRead | Checks the result of an asynchronous Read operation.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | PageDown | Reads the next page of leaderboard data synchronously.
Public Method | PageUp | Reads the previous page of leaderboard data synchronously.
 | Read | Overloaded. Methods for synchronous reading of leaderboard data.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardReader Class
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardReader Methods

LeaderboardReader Methods

Expand image Public Methods

 | Name | Description
Public Method | BeginPageDown | Begins an asynchronous read of the page of leaderboard data after the current page.
Public Method | BeginPageUp | Begins an asynchronous read of the page of leaderboard data before the current page.
 | BeginRead | Overloaded. Methods for reading a leaderboard asynchronously.
Public Method | Dispose | Releases all resources used by this LeaderboardReader.
Public Method | EndPageDown | Checks the result of an asynchonous PageDown operation.
Public Method | EndPageUp | Checks the result of an asynchonous PageUp operation.
 | EndRead | Checks the result of an asynchronous Read operation.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | PageDown | Reads the next page of leaderboard data synchronously.
Public Method | PageUp | Reads the previous page of leaderboard data synchronously.
 | Read | Overloaded. Methods for synchronous reading of leaderboard data.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardReader Class
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardReader.BeginPageDown Method

LeaderboardReader.BeginPageDown Method

Begins an asynchronous read of the page of leaderboard data after the current page.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public IAsyncResult BeginPageDown (
         AsyncCallback callback,
         Object asyncState
)

Parameters

callback
An AsyncCallback representing the method to call when the leaderboard information is read.
asyncState
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Working with Asynchronous Methods in XNA Game Studio

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.BeginPageUp Method

LeaderboardReader.BeginPageUp Method

Begins an asynchronous read of the page of leaderboard data before the current page.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public IAsyncResult BeginPageUp (
         AsyncCallback callback,
         Object asyncState
)

Parameters

callback
An AsyncCallback representing the method to call when the leaderboard information is read.
asyncState
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Working with Asynchronous Methods in XNA Game Studio

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.BeginRead Method

LeaderboardReader.BeginRead Method

Methods for reading a leaderboard asynchronously.

Expand image Overload List

Name | Description
LeaderboardReader.BeginRead (LeaderboardIdentity, Gamer, Int32, AsyncCallback, Object) | Begins reading a leaderboard asynchronously, and specifies a leaderboard identity, pivot gamer, and page size.
LeaderboardReader.BeginRead (LeaderboardIdentity, Generic IEnumerable, Gamer, Int32, AsyncCallback, Object) | Begins an asynchronous read of leaderboard data, taking a leaderboard identity, a collection of gamers, a pivot gamer, and a page size.
LeaderboardReader.BeginRead (LeaderboardIdentity, Int32, Int32, AsyncCallback, Object) | Begins reading a leaderboard asynchronously, and specifies a leaderboard identity, the start page, and the page size.

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardReader.BeginRead Method (LeaderboardIdentity, Gamer, Int32, AsyncCallback, Object)

LeaderboardReader.BeginRead Method (LeaderboardIdentity, Gamer, Int32, AsyncCallback, Object)
See Also
CollapseAll image

Begins reading a leaderboard asynchronously, and specifies a leaderboard identity, pivot gamer, and page size.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static IAsyncResult BeginRead (
         LeaderboardIdentity leaderboardId,
         Gamer pivotGamer,
         int pageSize,
         AsyncCallback callback,
         Object asyncState
)

Parameters

leaderboardId
The leaderboard identity of the leaderboard to read.
pivotGamer
The gamer of interest in the leaderboard. The current page is set so that this gamer appears on the page.
pageSize
The number of leaderboard entries per page.
callback
An AsyncCallback representing the method to call when the leaderboard information is read.
asyncState
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

The returned page of results contains the pivotGamer if this gamer appears on the leaderboard. Otherwise, the top page of leaderboard entries is returned.

Expand image See Also

Tasks

Working with Asynchronous Methods in XNA Game Studio

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.BeginRead Method (LeaderboardIdentity, Generic IEnumerable, Gamer, Int32, AsyncCallback, Object)

LeaderboardReader.BeginRead Method (LeaderboardIdentity, Generic IEnumerable, Gamer, Int32, AsyncCallback, Object)
See Also
CollapseAll image

Begins an asynchronous read of leaderboard data, taking a leaderboard identity, a collection of gamers, a pivot gamer, and a page size.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static IAsyncResult BeginRead (
         LeaderboardIdentity leaderboardId,
         IEnumerable<Gamer> gamers,
         Gamer pivotGamer,
         int pageSize,
         AsyncCallback callback,
         Object asyncState
)

Parameters

leaderboardId
The leaderboard identity of the leaderboard to read.
gamers
A collection of gamers that should be included in the leaderboard results. This parameter is ignored on Windows Phone.
pivotGamer
The gamer of interest in the leaderboard. The current page is set so that this gamer appears on the page.
pageSize
The number of leaderboard entries per page.
callback
An AsyncCallback representing the method to call when the leaderboard information is read.
asyncState
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

The returned page of results contains the pivotGamer if this gamer appears on the leaderboard. Otherwise, the top page of leaderboard entries is returned.

Expand image See Also

Tasks

Working with Asynchronous Methods in XNA Game Studio

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.BeginRead Method (LeaderboardIdentity, Int32, Int32, AsyncCallback, Object)

LeaderboardReader.BeginRead Method (LeaderboardIdentity, Int32, Int32, AsyncCallback, Object)
See Also
CollapseAll image

Begins reading a leaderboard asynchronously, and specifies a leaderboard identity, the start page, and the page size.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static IAsyncResult BeginRead (
         LeaderboardIdentity leaderboardId,
         int pageStart,
         int pageSize,
         AsyncCallback callback,
         Object asyncState
)

Parameters

leaderboardId
The leaderboard identity of the leaderboard to read.
pageStart
The page of leaderboard entries at which to start.
pageSize
The number of leaderboard entries per page.
callback
An AsyncCallback representing the method to call when the leaderboard information is read.
asyncState
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Working with Asynchronous Methods in XNA Game Studio

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.Dispose Method

LeaderboardReader.Dispose Method

Releases all resources used by this LeaderboardReader.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Calling Dispose leaves the LeaderboardReader in an unusable state. Call this method to release the resources used by this object so that the garbage collector can reclaim the memory used by this instance.

Expand image See Also

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.EndPageDown Method

LeaderboardReader.EndPageDown Method

Checks the result of an asynchonous PageDown operation.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void EndPageDown (
         IAsyncResult result
)

Parameters

result
The IASyncResult that represents the state of the asynchronous page-down operation. If the operation is finished, IsCompleted will be true.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.EndPageUp Method

LeaderboardReader.EndPageUp Method

Checks the result of an asynchonous PageUp operation.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void EndPageUp (
         IAsyncResult result
)

Parameters

result
The IASyncResult that represents the state of the asynchronous page-up operation. If the operation is finished, IsCompleted will be true.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.EndRead Method

LeaderboardReader.EndRead Method

Checks the result of an asynchronous Read operation.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static LeaderboardReader EndRead (
         IAsyncResult result
)

Parameters

result
The IASyncResult that represents the state of the asynchronous read operation. If the operation is finished, IsCompleted will be true.

Return Value

The LeaderboardReader that contains the read results.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.PageDown Method

LeaderboardReader.PageDown Method

Reads the next page of leaderboard data synchronously.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void PageDown ()

Expand image Remarks

Use the CanPageDown property to check if there is more data to be read before calling this method.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.PageUp Method

LeaderboardReader.PageUp Method

Reads the previous page of leaderboard data synchronously.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void PageUp ()

Expand image Remarks

Use the CanPageUp property to check if there is more data to be read before calling this method.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.Read Method

LeaderboardReader.Read Method

Methods for synchronous reading of leaderboard data.

Expand image Overload List

Name | Description
LeaderboardReader.Read (LeaderboardIdentity, Gamer, Int32) | Reads a leaderboard synchronously, specifying a leaderboard identity, pivot gamer, and page size.
LeaderboardReader.Read (LeaderboardIdentity, Generic IEnumerable, Gamer, Int32) | Reads a leaderboard synchronously, specifying a leaderboard identity, collection of gamers, pivot gamer, and page size.
LeaderboardReader.Read (LeaderboardIdentity, Int32, Int32) | Begins reading a leaderboard synchronously, specifying a leaderboard identity, the start page, and the page size.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardReader.Read Method (LeaderboardIdentity, Gamer, Int32)

LeaderboardReader.Read Method (LeaderboardIdentity, Gamer, Int32)
See Also
CollapseAll image

Reads a leaderboard synchronously, specifying a leaderboard identity, pivot gamer, and page size.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static LeaderboardReader Read (
         LeaderboardIdentity leaderboardId,
         Gamer pivotGamer,
         int pageSize
)

Parameters

leaderboardId
The leaderboard identity of the leaderboard to read.
pivotGamer
The gamer to center the results on. It can be null.
pageSize
The number of leaderboard entries on a page. Pass zero to include all available entries on a single page.

Return Value

A LeaderboardReader containing the retrieved leaderboard data.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

The returned page of results contains the pivotGamer if this gamer appears on the leaderboard. Otherwise, the top page of leaderboard entries is returned.

Expand image See Also

Tasks

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.Read Method (LeaderboardIdentity, Generic IEnumerable, Gamer, Int32)

LeaderboardReader.Read Method (LeaderboardIdentity, Generic IEnumerable, Gamer, Int32)
See Also
CollapseAll image

Reads a leaderboard synchronously, specifying a leaderboard identity, collection of gamers, pivot gamer, and page size.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static LeaderboardReader Read (
         LeaderboardIdentity leaderboardId,
         IEnumerable<Gamer> gamers,
         Gamer pivotGamer,
         int pageSize
)

Parameters

leaderboardId
The leaderboard identity of the leaderboard to read.
gamers
A collection of gamers to be included in the leaderboard results. This parameter is ignored on Windows Phone.
pivotGamer
The gamer of interest in the leaderboard. The current page will be set so that this gamer will appear on the page.
pageSize
The number of leaderboard entries per page.

Return Value

A LeaderboardReader containing the retrieved leaderboard data.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

The returned page of results will contain the pivotGamer, if this gamer appears on the leaderboard. Otherwise, the top page of leaderboard entries will be returned.

Expand image See Also

Tasks

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.Read Method (LeaderboardIdentity, Int32, Int32)

LeaderboardReader.Read Method (LeaderboardIdentity, Int32, Int32)
See Also
CollapseAll image

Begins reading a leaderboard synchronously, specifying a leaderboard identity, the start page, and the page size.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static LeaderboardReader Read (
         LeaderboardIdentity leaderboardId,
         int pageStart,
         int pageSize
)

Parameters

leaderboardId
The leaderboard identity of the leaderboard to read.
pageStart
The page of leaderboard entries at which to start. Pass zero to start at the highest scores.
pageSize
The number of leaderboard entries per page. Pass zero to include all available entries on a single page.

Return Value

The leaderboard reader used to read the results.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader Properties

LeaderboardReader Properties

Expand image Public Properties

 | Name | Description
Public Property | CanPageDown | Provides information about whether there are more leaderboard entries after the current page of entries.
Public Property | CanPageUp | Provides information about whether there are more leaderboard entries before the current page of entries.
Public Property | Entries | Gets the collection of leaderboard entries for the leaderboard.
Public Property | IsDisposed | Provides information about whether this leaderboard reader is disposed.
Public Property | LeaderboardIdentity | Provides the identity of the leaderboard.
Public Property | PageStart | Gets the index of the leaderboard entry at the start of the current page.
Public Property | TotalLeaderboardSize | Provides information about the total number of entries in the leaderboard.

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardReader Class
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardReader.CanPageDown Property

LeaderboardReader.CanPageDown Property

Provides information about whether there are more leaderboard entries after the current page of entries.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool CanPageDown { get; }

Property Value

true if there is more leaderboard information after this page of entries, false otherwise.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.CanPageUp Property

LeaderboardReader.CanPageUp Property

Provides information about whether there are more leaderboard entries before the current page of entries.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool CanPageUp { get; }

Property Value

Returns true if there is more leaderboard information before this page of entries; false otherwise.

Expand image See Also

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.Entries Property

LeaderboardReader.Entries Property

Gets the collection of leaderboard entries for the leaderboard.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public ReadOnlyCollection<LeaderboardEntry> Entries { get; }

Property Value

Gets a collection of leaderboard entries for the leaderboard that is currently being read.

Expand image See Also

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.IsDisposed Property

LeaderboardReader.IsDisposed Property

Provides information about whether this leaderboard reader is disposed.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the leaderboard reader is disposed and no longer usable; false otherwise.

Expand image See Also

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.LeaderboardIdentity Property

LeaderboardReader.LeaderboardIdentity Property

Provides the identity of the leaderboard.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public LeaderboardIdentity LeaderboardIdentity { get; }

Property Value

The identity of the leaderboard currently being read.

Expand image Remarks

Caution

This property retrieves a calculated result only for titles approved to access Xbox LIVE services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this property will return immediately with a predetermined default value.

Expand image See Also

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.PageStart Property

LeaderboardReader.PageStart Property

Gets the index of the leaderboard entry at the start of the current page.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int PageStart { get; }

Property Value

The index of the leaderboard entry at the start of the current page. This can be used with the Entries property to get individual leaderboard entries from the collection.

Expand image See Also

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardReader.TotalLeaderboardSize Property

LeaderboardReader.TotalLeaderboardSize Property

Provides information about the total number of entries in the leaderboard.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int TotalLeaderboardSize { get; }

Property Value

The total number of entries in the leaderboard that is currently being read.

Expand image See Also

Reference

LeaderboardReader Class
LeaderboardReader Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardWriter Class

LeaderboardWriter Class
See Also Members
CollapseAll image

Records leaderboard data for players in a NetworkSession.

Data can be written at any time during gameplay, but is only flushed to the server when the host calls EndGame. Data may be written for both local and remote gamers by using the following rules:

  • Ranked sessions can write to both arbitrated and nonarbitrated leaderboards.
  • Other session types can only write to nonarbitrated leaderboards.
  • Arbitrated statistics should be written by all machines for all gamers.
  • Nonarbitrated statistics should only be written by their local machine.
  • In ranked sessions, all machines should report TrueSkill for all gamers.
  • In other session types, only the host should report TrueSkill data.

Leaderboards can only be written while in a NetworkSession, and while in the gameplay state rather than in the lobby. To write scores from a single player game, create a session using NetworkSessionType.LocalWithLeaderboards.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class LeaderboardWriter

Expand image Remarks

Caution

This class and all related methods and properties only retrieve a calculated result for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, the properties in this class will not return a calculated result, and related methods will report a NotSupportedException.

Expand image See Also

Reference

LeaderboardWriter Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LeaderboardWriter Members

LeaderboardWriter Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the LeaderboardWriter type.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetLeaderboard | Gets a leaderboard entry that can be used to write to a specified leaderboard.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

LeaderboardWriter Class
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardWriter Methods

LeaderboardWriter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetLeaderboard | Gets a leaderboard entry that can be used to write to a specified leaderboard.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

LeaderboardWriter Class
Microsoft.Xna.Framework.GamerServices Namespace


LeaderboardWriter.GetLeaderboard Method

LeaderboardWriter.GetLeaderboard Method

Gets a leaderboard entry that can be used to write to a specified leaderboard.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public LeaderboardEntry GetLeaderboard (
         LeaderboardIdentity leaderboardId
)

Parameters

leaderboardId
The identity of the leaderboard to write to.

Return Value

A LeaderboardEntry that can be used for writing to the leaderboard.

Expand image See Also

Reference

LeaderboardWriter Class
LeaderboardWriter Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MessageBoxIcon Enumeration

MessageBoxIcon Enumeration

Defines the different icons for a message box.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public enum MessageBoxIcon

Expand image Members

Member name | Description
Alert | Displays the Alert icon.
Error | Displays the Error icon.
None | No icon is displayed.
Warning | Displays the Warning icon.

Expand image See Also

Reference

Guide.BeginShowMessageBox Method
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NetworkException Class

NetworkException Class
See Also Members
CollapseAll image

Thrown if there is a network communication failure.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public class NetworkException : Exception

Expand image See Also

Reference

NetworkException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NetworkException Members

NetworkException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the NetworkException type.

Expand image Public Constructors

 | Name | Description
Public Method | NetworkException | Overloaded. Creates an instance of NetworkException.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkException Class
Microsoft.Xna.Framework.GamerServices Namespace


NetworkException Constructor

NetworkException Constructor

Creates an instance of NetworkException.

Expand image Overload List

Name | Description
NetworkException () | Creates an empty instance of NetworkException.
NetworkException (SerializationInfo, StreamingContext) | Initializes a new instance of NetworkException with the specified streaming context.
NetworkException (String) | Initializes a new instance of NetworkException with the specified error message.
NetworkException (String, Exception) | Initializes a new instance of NetworkException with the specified error message and the inner exception.

Expand image See Also

Reference

NetworkException Class
NetworkException Members
Microsoft.Xna.Framework.GamerServices Namespace


NetworkException Constructor ()

NetworkException Constructor ()
See Also
CollapseAll image

Creates an empty instance of NetworkException.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public NetworkException ()

Expand image See Also

Reference

NetworkException Class
NetworkException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NetworkException Constructor (SerializationInfo, StreamingContext)

NetworkException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Note
This constructor is available only when developing for Windows.
Initializes a new instance of NetworkException with the specified streaming context.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
protected NetworkException (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
Describes the network data being sent or received when the exception occurred.
context
Describes the stream where the exception occurred.

Expand image See Also

Reference

NetworkException Class
NetworkException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


NetworkException Constructor (String)

NetworkException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of NetworkException with the specified error message.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public NetworkException (
         string message
)

Parameters

message
A message that describes the error.

Expand image See Also

Reference

NetworkException Class
NetworkException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NetworkException Constructor (String, Exception)

NetworkException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of NetworkException with the specified error message and the inner exception.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public NetworkException (
         string message,
         Exception innerException
)

Parameters

message
A message that describes the error.
innerException
The inner exception related to this exception.

Expand image See Also

Reference

NetworkException Class
NetworkException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NetworkException Methods

NetworkException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkException Class
Microsoft.Xna.Framework.GamerServices Namespace


NetworkException Properties

NetworkException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

NetworkException Class
Microsoft.Xna.Framework.GamerServices Namespace


NetworkNotAvailableException Class

NetworkNotAvailableException Class
See Also Members
CollapseAll image

Thrown if a network connection is unavailable.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public class NetworkNotAvailableException : NetworkException

Expand image See Also

Reference

NetworkNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NetworkNotAvailableException Members

NetworkNotAvailableException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the NetworkNotAvailableException type.

Expand image Public Constructors

 | Name | Description
Public Method | NetworkNotAvailableException | Overloaded. Overloads for initializing an NetworkNotAvailableException.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkNotAvailableException Class
Microsoft.Xna.Framework.GamerServices Namespace


NetworkNotAvailableException Constructor

NetworkNotAvailableException Constructor

Overloads for initializing an NetworkNotAvailableException.

Expand image Overload List

Name | Description
NetworkNotAvailableException () | Initializes a new NetworkNotAvailableException.
NetworkNotAvailableException (SerializationInfo, StreamingContext) | Initializes a new NetworkNotAvailableException with serialization information and the streaming context.
NetworkNotAvailableException (String) | Initializes a new NetworkNotAvailableException with a specified error message.
NetworkNotAvailableException (String, Exception) | Initializes a new NetworkNotAvailableException with a specified error message and a reference to the inner exception that caused the error.

Expand image See Also

Reference

NetworkNotAvailableException Class
NetworkNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace


NetworkNotAvailableException Constructor ()

NetworkNotAvailableException Constructor ()
See Also
CollapseAll image

Initializes a new NetworkNotAvailableException.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public NetworkNotAvailableException ()

Expand image See Also

Reference

NetworkNotAvailableException Class
NetworkNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NetworkNotAvailableException Constructor (SerializationInfo, StreamingContext)

NetworkNotAvailableException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Note
This constructor is available only when developing for Windows.
Initializes a new NetworkNotAvailableException with serialization information and the streaming context.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
protected NetworkNotAvailableException (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
Describes the network data being sent or received when the exception occurred.
context
Describes the stream where the exception occurred.

Expand image See Also

Reference

NetworkNotAvailableException Class
NetworkNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


NetworkNotAvailableException Constructor (String)

NetworkNotAvailableException Constructor (String)
See Also
CollapseAll image

Initializes a new NetworkNotAvailableException with a specified error message.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public NetworkNotAvailableException (
         string message
)

Parameters

message
Text that describes the error.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor must ensure the string is localized for the current system culture.

Expand image See Also

Reference

NetworkNotAvailableException Class
NetworkNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NetworkNotAvailableException Constructor (String, Exception)

NetworkNotAvailableException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new NetworkNotAvailableException with a specified error message and a reference to the inner exception that caused the error.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public NetworkNotAvailableException (
         string message,
         Exception innerException
)

Parameters

message
Text that describes the error.
innerException
The exception that caused the GameUpdateRequiredException. If this parameter is not null, this exception is raised in a catch block that handles the inner exception.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor must ensure the string is localized for the current system culture.

An exception thrown as a direct result of a previous exception should include a reference to that previous exception in the innerException parameter. The InnerException property returns the same value that is passed into this constructor, or null if the caller did not supply the inner exception parameter to the constructor.

Expand image See Also

Reference

NetworkNotAvailableException Class
NetworkNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NetworkNotAvailableException Methods

NetworkNotAvailableException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkNotAvailableException Class
Microsoft.Xna.Framework.GamerServices Namespace


NetworkNotAvailableException Properties

NetworkNotAvailableException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

NetworkNotAvailableException Class
Microsoft.Xna.Framework.GamerServices Namespace


NetworkNotAvailableException Events

NetworkNotAvailableException Events

Expand image See Also

Reference

NetworkNotAvailableException Class
Microsoft.Xna.Framework.GamerServices Namespace


NotificationPosition Enumeration

NotificationPosition Enumeration

Determines where notifications appear on the screen. Used to specify the notification position for the NotificationPosition property.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public enum NotificationPosition

Expand image Members

Member name | Description
BottomCenter | Positions the message box at the bottom of the screen and centered.
BottomLeft | Positions the message box at the bottom-left of the screen.
BottomRight | Positions the message box at the bottom-right of the screen.
Center | Positions the message box at the center of the screen.
CenterLeft | Positions the message box at the center of the screen and left-aligned.
CenterRight | Positions the message box at the center of the screen and right-aligned.
TopCenter | Positions the message box at the top of the screen and centered.
TopLeft | Positions the message box at the top-left of the screen.
TopRight | Positions the message box at the top-right of the screen.

Expand image See Also

Reference

Guide.NotificationPosition Property
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary Class

PropertyDictionary Class
See Also Members
CollapseAll image

Holds a set of properties used to define presence states or leaderboard column values.

Properties can be set and retrieved as loosely-typed boxed objects or with the strongly-typed SetValue and GetValue overloads. If properties are accessed using types different to those defined in the XLAST file, values will automatically be converted using the standard System.Convert behavior, in which case the property data may be boxed. No boxing is performed if properties and accessed using the same type that was defined in the XLAST file.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class PropertyDictionary : IDictionary<string, Object>, ICollection<KeyValuePair<string, Object>>, IEnumerable<KeyValuePair<string, Object>>, IEnumerable

Expand image See Also

Reference

PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary Members

PropertyDictionary Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the PropertyDictionary type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of elements contained in this PropertyDictionary.
Public Property | Item | Gets or sets the element with the specified key.

Expand image Public Methods

 | Name | Description
Public Method | ContainsKey | Determines whether the PropertyDictionary contains an element with the specified key.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through a collection of key/value pairs that represent elements in the PropertyDictionary.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetValueDateTime | Gets the value of the property with the specified key, as a System.DateTime.
Public Method | GetValueDouble | Gets the value of the property with the specified key, as a System.Double.
Public Method | GetValueInt32 | Gets the value of the property with the specified key, as a System.Int32.
Public Method | GetValueInt64 | Gets the value of the property with the specified key, as a System.Int64.
Public Method | GetValueOutcome | Gets the value of the property with the specified key, as a LeaderboardOutcome.
Public Method | GetValueSingle | Gets the value of the property with the specified key, as a System.Single.
Public Method | GetValueStream | Gets the value of the property with the specified key, as a System.IO.Stream.
Public Method | GetValueString | Gets the value of the property with the specified key, as a System.String.
Public Method | GetValueTimeSpan | Gets the value of the property with the specified key, as a System.TimeSpan.
Public Method | SetValue | Overloaded. Methods to set the value of the property with the specified key.
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | Determines if a value for the specified key exists in the PropertyDictionary.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.IsReadOnly | Gets a value indicating whether this PropertyDictionary is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Add | Adds an element to the PropertyDictionary. This method is not supported.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Clear | Removes all elements from the PropertyDictionary.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Contains | Determines whether the PropertyDictionary contains an element with the specified key/value pair.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.CopyTo | Copies the elements of the PropertyDictionary to an Array, starting at a particular Array index.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection of elements in the PropertyDictionary.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Remove | Removes an element from the PropertyDictionary. This method is not supported.

Expand image See Also

Reference

PropertyDictionary Class
Microsoft.Xna.Framework.GamerServices Namespace


PropertyDictionary Methods

PropertyDictionary Methods

Expand image Public Methods

 | Name | Description
Public Method | ContainsKey | Determines whether the PropertyDictionary contains an element with the specified key.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through a collection of key/value pairs that represent elements in the PropertyDictionary.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetValueDateTime | Gets the value of the property with the specified key, as a System.DateTime.
Public Method | GetValueDouble | Gets the value of the property with the specified key, as a System.Double.
Public Method | GetValueInt32 | Gets the value of the property with the specified key, as a System.Int32.
Public Method | GetValueInt64 | Gets the value of the property with the specified key, as a System.Int64.
Public Method | GetValueOutcome | Gets the value of the property with the specified key, as a LeaderboardOutcome.
Public Method | GetValueSingle | Gets the value of the property with the specified key, as a System.Single.
Public Method | GetValueStream | Gets the value of the property with the specified key, as a System.IO.Stream.
Public Method | GetValueString | Gets the value of the property with the specified key, as a System.String.
Public Method | GetValueTimeSpan | Gets the value of the property with the specified key, as a System.TimeSpan.
Public Method | SetValue | Overloaded. Methods to set the value of the property with the specified key.
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | Determines if a value for the specified key exists in the PropertyDictionary.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.IsReadOnly | Gets a value indicating whether this PropertyDictionary is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Add | Adds an element to the PropertyDictionary. This method is not supported.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Clear | Removes all elements from the PropertyDictionary.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Contains | Determines whether the PropertyDictionary contains an element with the specified key/value pair.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.CopyTo | Copies the elements of the PropertyDictionary to an Array, starting at a particular Array index.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection of elements in the PropertyDictionary.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Remove | Removes an element from the PropertyDictionary. This method is not supported.

Expand image See Also

Reference

PropertyDictionary Class
Microsoft.Xna.Framework.GamerServices Namespace


PropertyDictionary.ContainsKey Method

PropertyDictionary.ContainsKey Method

Determines whether the PropertyDictionary contains an element with the specified key.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool ContainsKey (
         string key
)

Parameters

key
The key to locate in the PropertyDictionary.

Return Value

Returns true if the PropertyDictionary contains an element with the specified key; false otherwise.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.GetEnumerator Method

PropertyDictionary.GetEnumerator Method

Returns an enumerator that iterates through a collection of key/value pairs that represent elements in the PropertyDictionary.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public IEnumerator<KeyValuePair<string, Object>> GetEnumerator ()

Return Value

An that iterates through a collection of key/value pairs that represent elements in the PropertyDictionary.

Expand image Remarks

The C# foreach statement hides the complexity of using enumerators. Therefore, using foreach is recommended instead of directly manipulating the enumerator.

Enumerators can be used to read the data in the collection, but can not be used to modify the underlying collection.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.GetValueDateTime Method

PropertyDictionary.GetValueDateTime Method

Gets the value of the property with the specified key, as a System.DateTime.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public DateTime GetValueDateTime (
         string key
)

Parameters

key
The key to search for in the PropertyDictionary.

Return Value

The value of the property associated with the specified key, as a DateTime.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a DateTime, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.GetValueDouble Method

PropertyDictionary.GetValueDouble Method

Gets the value of the property with the specified key, as a System.Double.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public double GetValueDouble (
         string key
)

Parameters

key
The key to search for in the PropertyDictionary.

Return Value

The value of the property associated with the specified key, as a Double.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a Double, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.GetValueInt32 Method

PropertyDictionary.GetValueInt32 Method

Gets the value of the property with the specified key, as a System.Int32.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int GetValueInt32 (
         string key
)

Parameters

key
The key to search for in the PropertyDictionary.

Return Value

The value of the property associated with the specified key, as an Int32.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by an Int32, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.GetValueInt64 Method

PropertyDictionary.GetValueInt64 Method

Gets the value of the property with the specified key, as a System.Int64.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public long GetValueInt64 (
         string key
)

Parameters

key
The key to search for in the PropertyDictionary.

Return Value

The value of the property associated with the specified key, as an Int64.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by an Int64, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.GetValueOutcome Method

PropertyDictionary.GetValueOutcome Method

Gets the value of the property with the specified key, as a LeaderboardOutcome.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public LeaderboardOutcome GetValueOutcome (
         string key
)

Parameters

key
The key to search for in the PropertyDictionary.

Return Value

The value of the property associated with the specified key, as a LeaderboardOutcome.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a LeaderboardOutcome, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.GetValueSingle Method

PropertyDictionary.GetValueSingle Method

Gets the value of the property with the specified key, as a System.Single.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public float GetValueSingle (
         string key
)

Parameters

key
The key to search for in the PropertyDictionary.

Return Value

The value of the property associated with the specified key, as a Single.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a Single, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.GetValueStream Method

PropertyDictionary.GetValueStream Method

Gets the value of the property with the specified key, as a System.IO.Stream.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public Stream GetValueStream (
         string key
)

Parameters

key
The key to search for in the PropertyDictionary.

Return Value

The value of the property associated with the specified key, as a Stream.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a Stream, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.GetValueString Method

PropertyDictionary.GetValueString Method

Gets the value of the property with the specified key, as a System.String.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public string GetValueString (
         string key
)

Parameters

key
The key to search for in the PropertyDictionary.

Return Value

The value of the property associated with the specified key, as a String.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a String, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.GetValueTimeSpan Method

PropertyDictionary.GetValueTimeSpan Method

Gets the value of the property with the specified key, as a System.TimeSpan.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public TimeSpan GetValueTimeSpan (
         string key
)

Parameters

key
he key to search for in the PropertyDictionary.

Return Value

The value of the property associated with the specified key, as a TimeSpan.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a TimeSpan, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.SetValue Method

PropertyDictionary.SetValue Method

Methods to set the value of the property with the specified key.

Expand image Overload List

Name | Description
PropertyDictionary.SetValue (String, DateTime) | Sets the value of the property with the specified key, as a System.DateTime.
PropertyDictionary.SetValue (String, Double) | Sets the value of the property with the specified key, as a System.Double.
PropertyDictionary.SetValue (String, Int32) | Sets the value of the property with the specified key, as a System.Int32.
PropertyDictionary.SetValue (String, Int64) | Sets the value of the property with the specified key, as a System.Int64.
PropertyDictionary.SetValue (String, LeaderboardOutcome) | Sets the value of the property with the specified key, as a LeaderboardOutcome.
PropertyDictionary.SetValue (String, Single) | Sets the value of the property with the specified key, as a System.Single.
PropertyDictionary.SetValue (String, String) | Sets the value of the property with the specified key, as a System.String.
PropertyDictionary.SetValue (String, TimeSpan) | Sets the value of the property with the specified key, as a System.TimeSpan.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace


PropertyDictionary.SetValue Method (String, DateTime)

PropertyDictionary.SetValue Method (String, DateTime)
See Also
CollapseAll image

Sets the value of the property with the specified key, as a System.DateTime.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void SetValue (
         string key,
         DateTime value
)

Parameters

key
The key to search for in the PropertyDictionary.
value
The value of the property to set for the specified key, as a DateTime.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a DateTime, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.SetValue Method (String, Double)

PropertyDictionary.SetValue Method (String, Double)
See Also
CollapseAll image

Sets the value of the property with the specified key, as a System.Double.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void SetValue (
         string key,
         double value
)

Parameters

key
The key to search for in the PropertyDictionary.
value
The value of the property to set for the specified key, as a Double.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a Double, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.SetValue Method (String, Int32)

PropertyDictionary.SetValue Method (String, Int32)
See Also
CollapseAll image

Sets the value of the property with the specified key, as a System.Int32.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void SetValue (
         string key,
         int value
)

Parameters

key
The key to search for in the PropertyDictionary.
value
The value of the property to set for the specified key, as an Int32.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by an Int32, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.SetValue Method (String, Int64)

PropertyDictionary.SetValue Method (String, Int64)
See Also
CollapseAll image

Sets the value of the property with the specified key, as a System.Int64.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void SetValue (
         string key,
         long value
)

Parameters

key
The key to search for in the PropertyDictionary.
value
The value of the property to set for the specified key, as an Int64.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by an Int64, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.SetValue Method (String, LeaderboardOutcome)

PropertyDictionary.SetValue Method (String, LeaderboardOutcome)
See Also
CollapseAll image

Sets the value of the property with the specified key, as a LeaderboardOutcome.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void SetValue (
         string key,
         LeaderboardOutcome value
)

Parameters

key
The key to search for in the PropertyDictionary.
value
The value of the property to set for the specified key, as a LeaderboardOutcome.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a LeaderboardOutcome, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.SetValue Method (String, Single)

PropertyDictionary.SetValue Method (String, Single)
See Also
CollapseAll image

Sets the value of the property with the specified key, as a System.Single.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void SetValue (
         string key,
         float value
)

Parameters

key
The key to search for in the PropertyDictionary.
value
The value of the property to set for the specified key, as a Single.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a Single, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.SetValue Method (String, String)

PropertyDictionary.SetValue Method (String, String)
See Also
CollapseAll image

Sets the value of the property with the specified key, as a System.String.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void SetValue (
         string key,
         string value
)

Parameters

key
The key to search for in the PropertyDictionary.
value
The value of the property to set for the specified key, as a String.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a String, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.SetValue Method (String, TimeSpan)

PropertyDictionary.SetValue Method (String, TimeSpan)
See Also
CollapseAll image

Sets the value of the property with the specified key, as a System.TimeSpan.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void SetValue (
         string key,
         TimeSpan value
)

Parameters

key
The key to search for in the PropertyDictionary.
value
The value of the property to set for the specified key, as a TimeSpan.

Expand image Remarks

If the value that corresponds to the specified key cannot be represented by a TimeSpan, an InvalidCastException will be thrown. A KeyNotFoundException will be thrown if the key does not exist.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.ICollection{T}.Add Method

System.Collections.Generic.ICollection{T}.Add Method

Adds an element to the PropertyDictionary. This method is not supported.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.Add (
         KeyValuePair<string, Object> item
)

Parameters

item
A KeyValuePair representing a property to add to the PropertyDictionary.

Expand image Remarks

PropertyDictionary objects are immutable once created: new members cannot be added or removed from the collection. If this method is called, a NotSupportedException will be thrown.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.ICollection{T}.Clear Method

System.Collections.Generic.ICollection{T}.Clear Method

Removes all elements from the PropertyDictionary.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.Clear ()

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.ICollection{T}.Contains Method

System.Collections.Generic.ICollection{T}.Contains Method

Determines whether the PropertyDictionary contains an element with the specified key/value pair.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.Contains (
         KeyValuePair<string, Object> item
)

Parameters

item
A KeyValuePair that represents the key/value pair to locate in the PropertyDictionary.

Return Value

Returns true if the PropertyDictionary contains an element with the specified key/value pair; false otherwise.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.ICollection{T}.CopyTo Method

System.Collections.Generic.ICollection{T}.CopyTo Method

Copies the elements of the PropertyDictionary to an Array, starting at a particular Array index.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.CopyTo (
         KeyValuePair<string, Object>[] array,
         int arrayIndex
)

Parameters

array
An array of key/value pairs that will receive the elements of the PropertyDictionary. The array must have zero-based indexing.
arrayIndex
The zero-based index in the array at which copying begins.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.ICollection{T}.Remove Method

System.Collections.Generic.ICollection{T}.Remove Method

Removes an element from the PropertyDictionary. This method is not supported.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.Remove (
         KeyValuePair<string, Object> item
)

Parameters

item
The object to add to the PropertyDictionary.

Return Value

This method does not return. See the Remarks section for details.

Expand image Remarks

PropertyDictionary objects are immutable once created: new members cannot be added or removed from the collection. If this method is called, a NotSupportedException will be thrown.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the collection of elements in the PropertyDictionary.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

An IEnumerator that can be used to iterate through the elements in this PropertyDictionary.

Expand image Remarks

The C# foreach statement hides the complexity of using enumerators. Therefore, using foreach is recommended instead of directly manipulating the enumerator.

Enumerators can be used to read the data in the collection, but can not be used to modify the underlying collection.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.TryGetValue Method

PropertyDictionary.TryGetValue Method

Determines if a value for the specified key exists in the PropertyDictionary.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool TryGetValue (
         string key,
         out Object value
)

Parameters

key
The key to search for in the PropertyDictionary.
value
[OutAttribute] When the method returns, this parameter will contain the value associated with the specified key. If no value could be found in the PropertyDictionary, it will contain the default value for the type passed in.

Return Value

Returns true if the PropertyDictionary contains a value associated with the specified key; false otherwise.

Expand image Remarks

If the key is not found, then the value parameter gets the appropriate default value for the value type passed in. For example: 0 (zero) for integer types, false for Boolean types, and null for reference types.

Use the TryGetValue method if your code frequently attempts to access keys that are not in the dictionary. Using this method is more efficient than catching the KeyNotFoundException thrown by the Item property.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary Properties

PropertyDictionary Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of elements contained in this PropertyDictionary.
Public Property | Item | Gets or sets the element with the specified key.

Expand image See Also

Reference

PropertyDictionary Class
Microsoft.Xna.Framework.GamerServices Namespace


PropertyDictionary.Count Property

PropertyDictionary.Count Property

Gets the number of elements contained in this PropertyDictionary.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

The number of elements in this PropertyDictionary.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.Item Property

PropertyDictionary.Item Property

Gets or sets the element with the specified key.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public Object this [
         string key
] { get; set; }

Property Value

The element that corresponds to the specified key.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PropertyDictionary.System.Collections.Generic.ICollection{T}.IsReadOnly Property

PropertyDictionary.System.Collections.Generic.ICollection{T}.IsReadOnly Property
See Also
CollapseAll image

Gets a value indicating whether this PropertyDictionary is read-only.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.IsReadOnly { get; }

Property Value

Returns true if the PropertyDictionary is read-only; false otherwise.

Expand image See Also

Reference

PropertyDictionary Class
PropertyDictionary Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RacingCameraAngle Enumeration

RacingCameraAngle Enumeration

Indicates which camera angle this gamer prefers to use in racing games.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public enum RacingCameraAngle

Expand image Members

Member name | Description
Back | Traditional third-person camera view from behind the car.
Front | Camera view from in front of the car. The car itself is not visible.
Inside | Camera view from inside the car, looking through the windscreen.

Expand image See Also

Reference

GameDefaults.RacingCameraAngle Property
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInEventArgs Class

SignedInEventArgs Class
See Also Members
CollapseAll image

Represents the arguments passed to a SignedIn event. These arguments are passed to event handlers when a new gamer signs in. This class contains the SignedInGamer instance that recently signed in.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public class SignedInEventArgs : EventArgs

Expand image See Also

Reference

SignedInEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInEventArgs Members

SignedInEventArgs Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the SignedInEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | SignedInEventArgs | Creates a new instance of SignedInEventArgs.

Expand image Public Properties

 | Name | Description
Public Property | Gamer | Gets the gamer that just signed in.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SignedInEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedInEventArgs Constructor

SignedInEventArgs Constructor

Creates a new instance of SignedInEventArgs.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public SignedInEventArgs (
         SignedInGamer gamer
)

Parameters

gamer
The gamer that just signed in.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | gamer is null.

Expand image See Also

Reference

SignedInEventArgs Class
SignedInEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInEventArgs Methods

SignedInEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SignedInEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedInEventArgs Properties

SignedInEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | Gamer | Gets the gamer that just signed in.

Expand image See Also

Reference

SignedInEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedInEventArgs.Gamer Property

SignedInEventArgs.Gamer Property

Gets the gamer that just signed in.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public SignedInGamer Gamer { get; }

Property Value

The gamer that just signed in.

Expand image See Also

Reference

SignedInEventArgs Class
SignedInEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer Class

SignedInGamer Class
See Also Members
CollapseAll image

Represents a gamer (a profile that has an associated gamertag) on the local system.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class SignedInGamer : Gamer

Expand image Remarks

Gamers can be either on a local system or in a multiplayer session. For more information about gamers in a multiplayer session, see NetworkGamer.

Expand image See Also

Reference

SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer Members

SignedInGamer Members
See Also Events Methods Properties
CollapseAll image

The following tables list the members exposed by the SignedInGamer type.

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | (Inherited from Gamer.)
Public Property | GameDefaults | Describes a gamer's preferred settings.
Public Property | Gamertag | (Inherited from Gamer.)
Public Property | IsDisposed | (Inherited from Gamer.)
Public Property | IsGuest | Determines if the gamer is the guest of an Xbox LIVE–enabled profile.
Public Property | IsSignedInToLive | Determines if the gamer has an Xbox LIVE–enabled profile.
Public Property | LeaderboardWriter | (Inherited from Gamer.)
Public Property | PartySize | Gets the current party size.
Public Property | PlayerIndex | Gets the index of the gamer.
Public Property | Presence | Gets an object that may be used to set the rich presence state for this gamer.
Public Property | Privileges | Describes what operations a gamer is allowed to perform.
Public Property | Tag | (Inherited from Gamer.)

Expand image Public Methods

 | Name | Description
Public Method | AwardAchievement | [Deprecated] Awards the specified achievement to a locally signed-in gamer.
Public Method | BeginAwardAchievement | Starts an asynchronous operation to award an achievement to a locally signed-in gamer.
Public Method | BeginGetAchievements | Starts an asynchronous achievement query operation.
Public Method | BeginGetProfile | (Inherited from Gamer.)
Public Method | EndAwardAchievement | Ends an asynchronous achievement award operation.
Public Method | EndGetAchievements | Ends an asynchronous achievement query operation.
Public Method | EndGetProfile | (Inherited from Gamer.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetAchievements | Returns the collection of all achievements that may be earned by this gamer.
Public Method | GetFriends | Reads the friends list of this signed-in gamer, including the gamertag and current presence information for each friend.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProfile | (Inherited from Gamer.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsFriend | Queries whether the specified gamer is a friend of this local gamer.
Public Method | IsHeadset | Determines if the microphone associated with this signed-in gamer is a headset.
Public Method | ToString | (Inherited from Gamer.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

Name | Description
SignedIn | Occurs when a new gamer signs into the local system.
SignedOut | Occurs when a gamer signs out on the local system.

Expand image See Also

Reference

SignedInGamer Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedInGamer Methods

SignedInGamer Methods

Expand image Public Methods

 | Name | Description
Public Method | AwardAchievement | [Deprecated] Awards the specified achievement to a locally signed-in gamer.
Public Method | BeginAwardAchievement | Starts an asynchronous operation to award an achievement to a locally signed-in gamer.
Public Method | BeginGetAchievements | Starts an asynchronous achievement query operation.
Public Method | BeginGetProfile | (Inherited from Gamer.)
Public Method | EndAwardAchievement | Ends an asynchronous achievement award operation.
Public Method | EndGetAchievements | Ends an asynchronous achievement query operation.
Public Method | EndGetProfile | (Inherited from Gamer.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetAchievements | Returns the collection of all achievements that may be earned by this gamer.
Public Method | GetFriends | Reads the friends list of this signed-in gamer, including the gamertag and current presence information for each friend.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProfile | (Inherited from Gamer.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsFriend | Queries whether the specified gamer is a friend of this local gamer.
Public Method | IsHeadset | Determines if the microphone associated with this signed-in gamer is a headset.
Public Method | ToString | (Inherited from Gamer.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SignedInGamer Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedInGamer.AwardAchievement Method

SignedInGamer.AwardAchievement Method

[Deprecated] Awards the specified achievement to a locally signed-in gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void AwardAchievement (
         string achievementKey
)

Parameters

achievementKey
Identifier specifying the achievement to award.

Expand image Remarks

Important
This function is deprecated: use the asynchronous method BeginAwardAchievement to award an achievement, which also provides result information.

Expand image See Also

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.BeginAwardAchievement Method

SignedInGamer.BeginAwardAchievement Method

Starts an asynchronous operation to award an achievement to a locally signed-in gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public IAsyncResult BeginAwardAchievement (
         string achievementKey,
         AsyncCallback callback,
         Object state
)

Parameters

achievementKey
Identifier specifying the achievement to award.
callback
The method to be called once the asynchronous operation iss finished.
state
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method. Call EndAwardAchievement to access these results.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Working with Asynchronous Methods in XNA Game Studio

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.BeginGetAchievements Method

SignedInGamer.BeginGetAchievements Method

Starts an asynchronous achievement query operation.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public IAsyncResult BeginGetAchievements (
         AsyncCallback callback,
         Object asyncState
)

Parameters

callback
The method to be called once the asynchronous operation is finished.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method. Call EndGetAchievements to access these results.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

Tasks

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.EndAwardAchievement Method

SignedInGamer.EndAwardAchievement Method

Ends an asynchronous achievement award operation.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public void EndAwardAchievement (
         IAsyncResult result
)

Parameters

result
An IAsyncResult used to track the progress of the operation.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

Expand image See Also

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.EndGetAchievements Method

SignedInGamer.EndGetAchievements Method

Ends an asynchronous achievement query operation.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public AchievementCollection EndGetAchievements (
         IAsyncResult result
)

Parameters

result
An IAsyncResult used to track the progress of the operation.

Return Value

The requested achievement collection.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

The collection returned will include both earned and unearned achievements. Check Achievement.IsEarned to determine whether an achievement has been earned by the gamer.

Expand image See Also

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.GetAchievements Method

SignedInGamer.GetAchievements Method

Returns the collection of all achievements that may be earned by this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public AchievementCollection GetAchievements ()

Return Value

The requested achievement collection.

Expand image Remarks

Caution

This method retrieves a calculated result only for titles approved to access Xbox LIVE Services through the Xbox LIVE Registered Developer Program. For Xbox LIVE Indie games, this method returns immediately with a predetermined default value.

The collection returned will include both earned and unearned achievements. Check Achievement.IsEarned to determine whether an achievement has been earned by the gamer.

This is a blocking call. To query asynchronously, use BeginGetAchievements and EndGetAchievements instead.

Expand image See Also

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.GetFriends Method

SignedInGamer.GetFriends Method

Reads the friends list of this signed-in gamer, including the gamertag and current presence information for each friend.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public FriendCollection GetFriends ()

Return Value

The friends of this local gamer.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | This object already has been disposed.
GamerPrivilegeException | A signed-in gamer profile is required to perform this operation. An Xbox LIVE profile also may be required. There are no profiles currently signed in, or the profile is not signed in to Xbox LIVE.

Expand image Remarks

On Windows Phone, this method always returns an empty collection.

Expand image See Also

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.IsFriend Method

SignedInGamer.IsFriend Method

Queries whether the specified gamer is a friend of this local gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsFriend (
         Gamer gamer
)

Parameters

gamer
The gamer to query.

Return Value

true if the specified gamer is a friend of the local gamer; false otherwise.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | gamer is null.
GamerPrivilegeException | A signed in gamer profile is required to perform this operation. A LIVE profile may also be required. There are no profiles currently signed in, or the profile is not signed in to LIVE.
ObjectDisposedException | The gamer object has already been disposed.

Expand image See Also

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.IsHeadset Method

SignedInGamer.IsHeadset Method

Determines if the microphone associated with this signed-in gamer is a headset.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsHeadset (
         Microphone microphone
)

Parameters

microphone
The microphone associated with this signed-in gamer.

Return Value

true if the microphone is a headset; false otherwise.

Expand image See Also

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer Properties

SignedInGamer Properties

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | (Inherited from Gamer.)
Public Property | GameDefaults | Describes a gamer's preferred settings.
Public Property | Gamertag | (Inherited from Gamer.)
Public Property | IsDisposed | (Inherited from Gamer.)
Public Property | IsGuest | Determines if the gamer is the guest of an Xbox LIVE–enabled profile.
Public Property | IsSignedInToLive | Determines if the gamer has an Xbox LIVE–enabled profile.
Public Property | LeaderboardWriter | (Inherited from Gamer.)
Public Property | PartySize | Gets the current party size.
Public Property | PlayerIndex | Gets the index of the gamer.
Public Property | Presence | Gets an object that may be used to set the rich presence state for this gamer.
Public Property | Privileges | Describes what operations a gamer is allowed to perform.
Public Property | Tag | (Inherited from Gamer.)

Expand image See Also

Reference

SignedInGamer Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedInGamer.GameDefaults Property

SignedInGamer.GameDefaults Property

Describes a gamer's preferred settings.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GameDefaults GameDefaults { get; }

Property Value

The gamer's preferred settings.

Expand image Remarks

Wherever possible, games should default to these values.

Expand image See Also

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.IsGuest Property

SignedInGamer.IsGuest Property

Determines if the gamer is the guest of an Xbox LIVE–enabled profile.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsGuest { get; }

Property Value

true if the gamer is a guest; false otherwise.

Expand image Remarks

Windows Phone Specific Information

This property is always false on Windows Phone.

Expand image See Also

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.IsSignedInToLive Property

SignedInGamer.IsSignedInToLive Property

Determines if the gamer has an Xbox LIVE–enabled profile.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public bool IsSignedInToLive { get; }

Property Value

true if the gamer's privileges were successfully downloaded in the last four hours and have not expired; false otherwise.

Expand image Remarks

This property checks only that the SignedInGamer's privileges have not expired. It does not indicate that an active connection to Xbox LIVE exists.

Expand image See Also

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.PartySize Property

SignedInGamer.PartySize Property

Gets the current party size.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public int PartySize { get; set; }

Property Value

The current number of members in this signed-in gamer's LIVE Party.

Expand image Remarks

This is a read-only property. You cannot use it to set the party size. On platforms such as Windows Phone that do not support Xbox LIVE parties, the value of this property is always zero.

Expand image See Also

Tasks

Inviting a Group to Join Your Game (Xbox 360)

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.PlayerIndex Property

SignedInGamer.PlayerIndex Property

Gets the index of the gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public PlayerIndex PlayerIndex { get; }

Property Value

Index of the gamer.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | Thrown if the associated profile is no longer valid. For example, the profile may have signed out.

Expand image Remarks

Windows Phone Specific Information

This property is always PlayerIndex.One on Windows Phone.

Expand image See Also

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.Presence Property

SignedInGamer.Presence Property

Gets an object that may be used to set the rich presence state for this gamer.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerPresence Presence { get; }

Property Value

An object that may be used to set the rich presence state for this gamer.

Expand image Remarks

Windows Phone Specific Information
Setting presence information is not supported on Windows Phone. On Windows Phone, setting presence information for a signed-in gamer is allowed (it will not generate an error), but it will not change the presence information on Xbox LIVE.
Note

A game title is not displayed in a player's presence information on Xbox LIVE Service until that game passes peer review. Once a game passes peer review, the presence information for a player shows three things: a confirmation the player is playing an Xbox LIVE Indie Game, the game's title, and the presence information set by SignedInGamer.Presence.

For example:

        Xbox LIVE Indie Game
        My Game Title
        Fighting the Boss

While a game is in development, but before it passes peer review, presence information indicates the developer is using XNA Creators Club as shown:

        XNA Creators Club
        creators.xna.com
        Fighting the Boss

Expand image See Also

Tasks

Setting Presence Information

Reference

Gamer.SignedInGamers Property
GamerPresence Class
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.Privileges Property

SignedInGamer.Privileges Property

Describes what operations a gamer is allowed to perform.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public GamerPrivileges Privileges { get; }

Property Value

The operations a gamer is allowed to perform.

Expand image Remarks

Privileges can be defined by parental control settings, and also are set automatically in response to information like age, region, and whether the gamer has a Xbox LIVE Gold or a Silver membership. Games do not need to explicitly check privileges, because a GamerPrivilegeException is thrown if an unsupported operation is selected. However, these privilege bits may be useful to detect that an operation is unavailable before calling it in order to dim (make unavailable) the relevant menu option.
Windows Phone Specific Information

On Windows Phone, privilege information is not retrieved from Xbox LIVE, but from what is stored locally on the device.

Expand image See Also

Reference

SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer Events

SignedInGamer Events

Expand image Public Events

Name | Description
SignedIn | Occurs when a new gamer signs into the local system.
SignedOut | Occurs when a gamer signs out on the local system.

Expand image See Also

Reference

SignedInGamer Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedInGamer.SignedIn Event

SignedInGamer.SignedIn Event

Occurs when a new gamer signs into the local system.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static event EventHandler<SignedInEventArgs> SignedIn

Expand image Remarks

This event is raised during calls to Update. When this event is raised, the SignedInGamers collection will contain the newly signed-in gamer.

Windows Phone Specific Information

On Windows Phone this event is only raised once, right after the game starts.

Expand image See Also

Reference

SignedOut
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamer.SignedOut Event

SignedInGamer.SignedOut Event

Occurs when a gamer signs out on the local system.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public static event EventHandler<SignedOutEventArgs> SignedOut

Expand image Remarks

This event is raised during calls to Update. When this event is raised, the LocalGamers collection no longer will contain the signed-out gamer.

Windows Phone Specific Information

This event never occurs on Windows Phone.

Behavior of Local Sessions

This event signals that a signed-in gamer has exited the session; it does not indicate that the session has ended. An established local session ends only when all local profiles have signed out of the session.

Expand image See Also

Reference

SignedIn
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamerCollection Class

SignedInGamerCollection Class
See Also Members
CollapseAll image

Represents a collection of gamers on the local system.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public sealed class SignedInGamerCollection : GamerCollection<SignedInGamer>

Expand image See Also

Reference

SignedInGamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedInGamerCollection Members

SignedInGamerCollection Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the SignedInGamerCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | Overloaded. Gets a specific SignedInGamer object.

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from GamerCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SignedInGamerCollection Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedInGamerCollection Methods

SignedInGamerCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from GamerCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SignedInGamerCollection Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedInGamerCollection Properties

SignedInGamerCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | Overloaded. Gets a specific SignedInGamer object.

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

SignedInGamerCollection Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedInGamerCollection.Item Property

SignedInGamerCollection.Item Property

Gets a specific SignedInGamer object.

Expand image Overload List

Name | Description
SignedInGamerCollection.Item (PlayerIndex) | Gets a specific local gamer based on that player's PlayerIndex on the local system.

Expand image See Also

Reference

SignedInGamerCollection Class
SignedInGamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace


SignedInGamerCollection.Item Property (PlayerIndex)

SignedInGamerCollection.Item Property (PlayerIndex)
See Also
CollapseAll image

Gets a specific local gamer based on that player's PlayerIndex on the local system.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public SignedInGamer this [
         PlayerIndex index
] { get; }

Property Value

The local gamer at the specified PlayerIndex.

Expand image See Also

Reference

SignedInGamerCollection Class
SignedInGamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedOutEventArgs Class

SignedOutEventArgs Class
See Also Members
CollapseAll image

Represents the arguments passed to a SignedOut event. These arguments are passed to event handlers when a gamer signs out. This class contains the SignedInGamer instance that recently signed out.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public class SignedOutEventArgs : EventArgs

Expand image See Also

Reference

SignedOutEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedOutEventArgs Members

SignedOutEventArgs Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the SignedOutEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | SignedOutEventArgs | Creates a new instance of SignedOutEventArgs.

Expand image Public Properties

 | Name | Description
Public Property | Gamer | Gets the gamer that just signed out.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SignedOutEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedOutEventArgs Constructor

SignedOutEventArgs Constructor

Creates a new instance of SignedOutEventArgs.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public SignedOutEventArgs (
         SignedInGamer gamer
)

Parameters

gamer
The gamer that just signed out.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | gamer is null.

Expand image See Also

Reference

SignedOutEventArgs Class
SignedOutEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SignedOutEventArgs Methods

SignedOutEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SignedOutEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedOutEventArgs Properties

SignedOutEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | Gamer | Gets the gamer that just signed out.

Expand image See Also

Reference

SignedOutEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace


SignedOutEventArgs.Gamer Property

SignedOutEventArgs.Gamer Property

Gets the gamer that just signed out.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Expand image Syntax

C#
public SignedInGamer Gamer { get; }

Property Value

The gamer that just signed out.

Expand image See Also

Reference

SignedOutEventArgs Class
SignedOutEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics Namespace

Microsoft.Xna.Framework.Graphics Namespace

Contains low-level application programming interface (API) methods that take advantage of hardware acceleration capabilities to display 3D objects.

Expand image Classes

 | Name | Description
Public Class | AlphaTestEffect | Contains a configurable effect that supports alpha testing.
Public Class | BasicEffect | Contains a basic rendering effect.
Public Class | BlendState | Contains blend state for the device.
Public Class | DepthStencilState | Contains depth-stencil state for the device.
Public Class | DeviceLostException | The exception that is thrown when the device has been lost, but cannot be reset at this time. Therefore, rendering is not possible.
Public Class | DeviceNotResetException | The exception that is thrown when the device has been lost, but can be reset at this time.
Public Class | DirectionalLight | Creates a DirectionalLight object.
Public Class | DisplayMode | Describes the display mode.
Public Class | DisplayModeCollection | Manipulates a collection of DisplayMode structures.
Public Class | DualTextureEffect | Contains a configurable effect that supports two-layer multitexturing.
Public Class | DynamicIndexBuffer | Describes the rendering order of the vertices in a vertex buffer.
Public Class | DynamicVertexBuffer | Represents a list of 3D vertices to be streamed to the graphics device.
Public Class | Effect | Used to set and query effects, and to choose techniques.
Public Class | EffectAnnotation | Represents an annotation to an EffectParameter.
Public Class | EffectAnnotationCollection | Manipulates a collection of EffectAnnotation objects.
Public Class | EffectMaterial | Contains an effect subclass which is used to load data for an EffectMaterialContent type.
Public Class | EffectParameter | Represents an Effect parameter.
Public Class | EffectParameterCollection | Manipulates a collection of EffectParameter objects.
Public Class | EffectPass | Contains rendering state for drawing with an effect; an effect can contain one or more passes.
Public Class | EffectPassCollection | Manipulates a collection of EffectPass objects.
Public Class | EffectTechnique | Represents an effect technique.
Public Class | EffectTechniqueCollection | Manipulates a collection of EffectTechnique objects.
Public Class | EnvironmentMapEffect | Contains a configurable effect that supports environment mapping.
Public Class | GraphicsAdapter | Provides methods to retrieve and manipulate graphics adapters.
Public Class | GraphicsDevice | Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders.
Public Class | GraphicsResource | Queries and prepares resources.
Public Class | IndexBuffer | Describes the rendering order of the vertices in a vertex buffer.
Public Class | Model | Represents a 3D model composed of multiple ModelMesh objects which may be moved independently.
Public Class | ModelBone | Represents bone data for a model.
Public Class | ModelBoneCollection | Represents a set of bones associated with a model.
Public Class | ModelEffectCollection | Represents a collection of effects associated with a model.
Public Class | ModelMesh | Represents a mesh that is part of a Model.
Public Class | ModelMeshCollection | Represents a collection of ModelMesh objects.
Public Class | ModelMeshPart | Represents a batch of geometry information to submit to the graphics device during rendering. Each ModelMeshPart is a subdivision of a ModelMesh object. The ModelMesh class is split into multiple ModelMeshPart objects, typically based on material information.
Public Class | ModelMeshPartCollection | Represents a collection of ModelMeshPart objects.
Public Class | NoSuitableGraphicsDeviceException | Thrown when no available graphics device fits the given device preferences.
Public Class | OcclusionQuery | Used to perform an occlusion query against the latest drawn objects.
Public Class | PresentationParameters | Contains presentation parameters.
Public Class | RasterizerState | Contains rasterizer state, which determines how to convert vector data (shapes) into raster data (pixels).
Public Class | RenderTarget2D | Contains a 2D texture that can be used as a render target.
Public Class | RenderTargetCube | Represents a cubic texture resource that will be written to at the end of a render pass.
Public Class | ResourceCreatedEventArgs | Contains event data.
Public Class | ResourceDestroyedEventArgs | Arguments for a ResourceDestroyed event.
Public Class | SamplerState | Contains sampler state, which determines how to sample texture data.
Public Class | SamplerStateCollection | Collection of SamplerState objects.
Public Class | SkinnedEffect | Contains a configurable effect for rendering skinned character models.
Public Class | SpriteBatch | Enables a group of sprites to be drawn using the same settings.
Public Class | SpriteFont | Represents a font texture.
Public Class | Texture | Represents a texture resource.
Public Class | Texture2D | Represents a 2D grid of texels.
Public Class | Texture3D | Represents a 3D volume of texels.
Public Class | TextureCollection | Represents a collection of Texture objects.
Public Class | TextureCube | Represents a set of six 2D textures, one for each face of a cube.
Public Class | VertexBuffer | Represents a list of 3D vertices to be streamed to the graphics device.
Public Class | VertexDeclaration | A vertex declaration, which defines per-vertex data.

Expand image Interfaces

 | Name | Description
Public Interface | IEffectFog | Gets or sets fog parameters for the current effect.
Public Interface | IEffectLights | Gets or sets lighting parameters for the current effect.
Public Interface | IEffectMatrices | Gets or sets transformation matrix parameters for the current effect.
Public Interface | IGraphicsDeviceService | Defines a mechanism for retrieving GraphicsDevice objects.
Public Interface | IVertexType | Vertex type interface which is implemented by a custom vertex type structure.

Expand image Structures

 | Name | Description
Public Structure | ModelBoneCollection.Enumerator | Provides the ability to iterate through the bones in an ModelBoneCollection.
Public Structure | ModelEffectCollection.Enumerator | Provides the ability to iterate through the bones in an ModelEffectCollection.
Public Structure | ModelMeshCollection.Enumerator | Provides the ability to iterate through the bones in an ModelMeshCollection.
Public Structure | ModelMeshPartCollection.Enumerator | Provides the ability to iterate through the bones in an ModelMeshPartCollection.
Public Structure | RenderTargetBinding | Binds an array of render targets.
Public Structure | VertexBufferBinding | Binding structure that specifies a vertex buffer and other per-vertex parameters (such as offset and instancing) for a graphics device.
Public Structure | VertexElement | Defines input vertex data to the pipeline.
Public Structure | VertexPositionColor | Describes a custom vertex format structure that contains position and color information.
Public Structure | VertexPositionColorTexture | Describes a custom vertex format structure that contains position, color, and one set of texture coordinates.
Public Structure | VertexPositionNormalTexture | Describes a custom vertex format structure that contains position, normal data, and one set of texture coordinates.
Public Structure | VertexPositionTexture | Describes a custom vertex format structure that contains position and one set of texture coordinates.
Public Structure | Viewport | Defines the window dimensions of a render-target surface onto which a 3D volume projects.

Expand image Enumerations

 | Name | Description
Public Enumeration | Blend | Defines color blending factors.
Public Enumeration | BlendFunction | Defines how to combine a source color with the destination color already on the render target for color blending.
Public Enumeration | BufferUsage | Specifies special usage of the buffer contents.
Public Enumeration | ClearOptions | Specifies the buffer to use when calling Clear.
Public Enumeration | ColorWriteChannels | Defines the color channels that can be chosen for a per-channel write to a render target color buffer.
Public Enumeration | CompareFunction | Defines comparison functions that can be chosen for alpha, stencil, or depth-buffer tests.
Public Enumeration | CubeMapFace | Defines the faces of a cube map in the TextureCube class type.
Public Enumeration | CullMode | Defines winding orders that may be used to identify back faces for culling.
Public Enumeration | DepthFormat | Defines the format of data in a depth-stencil buffer.
Public Enumeration | EffectParameterClass | Defines classes that can be used for effect parameters or shader constants.
Public Enumeration | EffectParameterType | Defines types that can be used for effect parameters or shader constants.
Public Enumeration | FillMode | Describes options for filling the vertices and lines that define a primitive.
Public Enumeration | GraphicsDeviceStatus | Describes the status of the device.
Public Enumeration | GraphicsProfile | Identifies the set of supported devices for the game based on device capabilities.
Public Enumeration | IndexElementSize | Defines the size of an element of an index buffer.
Public Enumeration | PresentInterval | Defines flags that describe the relationship between the adapter refresh rate and the rate at which Present operations are completed.
Public Enumeration | PrimitiveType | Defines how vertex data is ordered.
Public Enumeration | RenderTargetUsage | Determines how render target data is used once a new render target is set.
Public Enumeration | SetDataOptions | Describes whether existing vertex or index buffer data will be overwritten or discarded during a SetData operation.
Public Enumeration | SpriteEffects | Defines sprite mirroring options.
Public Enumeration | SpriteSortMode | Defines sprite sort-rendering options.
Public Enumeration | StencilOperation | Defines stencil buffer operations.
Public Enumeration | SurfaceFormat | Defines various types of surface formats.
Public Enumeration | TextureAddressMode | Defines modes for addressing texels using texture coordinates that are outside of the typical range of 0.0 to 1.0.
Public Enumeration | TextureFilter | Defines filtering types during texture sampling.
Public Enumeration | VertexElementFormat | Defines vertex element formats.
Public Enumeration | VertexElementUsage | Defines usage for vertex elements.

Expand image See Also


AlphaTestEffect Class

AlphaTestEffect Class
See Also Members
CollapseAll image

Contains a configurable effect that supports alpha testing.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class AlphaTestEffect : Effect, IEffectMatrices, IEffectFog

Expand image See Also

Reference

AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect Members

AlphaTestEffect Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the AlphaTestEffect type.

Expand image Public Constructors

 | Name | Description
Public Method | AlphaTestEffect | Overloaded. Creates a new instance of an effect for alpha testing.

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).
Public Property | AlphaFunction | Gets or sets the compare function for alpha test. The default value is Greater.
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | DiffuseColor | Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.
Public Property | FogColor | Gets or sets the fog color, the range of color values is from 0 to 1.
Public Property | FogEnabled | Gets or sets the fog enable flag.
Public Property | FogEnd | Gets or sets the maximum z value for fog, which ranges from 0 to 1.
Public Property | FogStart | Gets or sets the minimum z value for fog, which ranges from 0 to 1.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | Projection | Gets or sets the projection matrix.
Public Property | ReferenceAlpha | Gets or sets the reference alpha value, the default value is 0.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)
Public Property | Texture | Gets or sets the current texture.
Public Property | VertexColorEnabled | Gets or sets whether vertex color is enabled.
Public Property | View | Gets or sets the view matrix.
Public Property | World | Gets or sets the world matrix.

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a clone of the current AlphaTestEffect instance.
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Computes derived parameter values immediately before applying the effect using a lazy architecture.

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

AlphaTestEffect Class
Microsoft.Xna.Framework.Graphics Namespace


AlphaTestEffect Constructor

AlphaTestEffect Constructor

Creates a new instance of an effect for alpha testing.

Expand image Overload List

Name | Description
AlphaTestEffect (AlphaTestEffect) | Creates a new AlphaTestEffect by cloning parameter settings from an existing instance.
AlphaTestEffect (GraphicsDevice) | Creates a new AlphaTestEffect with default parameter settings.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace


AlphaTestEffect Constructor (AlphaTestEffect)

AlphaTestEffect Constructor (AlphaTestEffect)
See Also
CollapseAll image

Creates a new AlphaTestEffect by cloning parameter settings from an existing instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected AlphaTestEffect (
         AlphaTestEffect cloneSource
)

Parameters

cloneSource
A copy of an AlphaTestEffect.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect Constructor (GraphicsDevice)

AlphaTestEffect Constructor (GraphicsDevice)
See Also
CollapseAll image

Creates a new AlphaTestEffect with default parameter settings.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public AlphaTestEffect (
         GraphicsDevice device
)

Parameters

device
A graphics device.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect Methods

AlphaTestEffect Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a clone of the current AlphaTestEffect instance.
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Computes derived parameter values immediately before applying the effect using a lazy architecture.

Expand image See Also

Reference

AlphaTestEffect Class
Microsoft.Xna.Framework.Graphics Namespace


AlphaTestEffect.Clone Method

AlphaTestEffect.Clone Method

Creates a clone of the current AlphaTestEffect instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override Effect Clone ()

Return Value

An effect.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.OnApply Method

AlphaTestEffect.OnApply Method

Computes derived parameter values immediately before applying the effect using a lazy architecture.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected internal override void OnApply ()

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect Properties

AlphaTestEffect Properties

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).
Public Property | AlphaFunction | Gets or sets the compare function for alpha test. The default value is Greater.
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | DiffuseColor | Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.
Public Property | FogColor | Gets or sets the fog color, the range of color values is from 0 to 1.
Public Property | FogEnabled | Gets or sets the fog enable flag.
Public Property | FogEnd | Gets or sets the maximum z value for fog, which ranges from 0 to 1.
Public Property | FogStart | Gets or sets the minimum z value for fog, which ranges from 0 to 1.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | Projection | Gets or sets the projection matrix.
Public Property | ReferenceAlpha | Gets or sets the reference alpha value, the default value is 0.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)
Public Property | Texture | Gets or sets the current texture.
Public Property | VertexColorEnabled | Gets or sets whether vertex color is enabled.
Public Property | View | Gets or sets the view matrix.
Public Property | World | Gets or sets the world matrix.

Expand image See Also

Reference

AlphaTestEffect Class
Microsoft.Xna.Framework.Graphics Namespace


AlphaTestEffect.Alpha Property

AlphaTestEffect.Alpha Property

Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float Alpha { get; set; }

Property Value

Material's alpha value.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.AlphaFunction Property

AlphaTestEffect.AlphaFunction Property

Gets or sets the compare function for alpha test. The default value is Greater.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public CompareFunction AlphaFunction { get; set; }

Property Value

The comparison function.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.DiffuseColor Property

AlphaTestEffect.DiffuseColor Property

Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 DiffuseColor { get; set; }

Property Value

The material's diffuse color.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.FogColor Property

AlphaTestEffect.FogColor Property

Gets or sets the fog color, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 FogColor { get; set; }

Property Value

The fog color.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.FogEnabled Property

AlphaTestEffect.FogEnabled Property

Gets or sets the fog enable flag.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool FogEnabled { get; set; }

Property Value

True to enable fog; otherwise false.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.FogEnd Property

AlphaTestEffect.FogEnd Property

Gets or sets the maximum z value for fog, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogEnd { get; set; }

Property Value

The distance to stop adding fog.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.FogStart Property

AlphaTestEffect.FogStart Property

Gets or sets the minimum z value for fog, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogStart { get; set; }

Property Value

The distance to begin adding fog.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.Projection Property

AlphaTestEffect.Projection Property

Gets or sets the projection matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix Projection { get; set; }

Property Value

A matrix that contains the projection transform.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.ReferenceAlpha Property

AlphaTestEffect.ReferenceAlpha Property

Gets or sets the reference alpha value, the default value is 0.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int ReferenceAlpha { get; set; }

Property Value

The reference alpha value.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.Texture Property

AlphaTestEffect.Texture Property

Gets or sets the current texture.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture2D Texture { get; set; }

Property Value

The current texture.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.VertexColorEnabled Property

AlphaTestEffect.VertexColorEnabled Property

Gets or sets whether vertex color is enabled.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool VertexColorEnabled { get; set; }

Property Value

True to enable per-vertex color; false otherwise.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.View Property

AlphaTestEffect.View Property

Gets or sets the view matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix View { get; set; }

Property Value

A matrix that contains the view transform.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect.World Property

AlphaTestEffect.World Property

Gets or sets the world matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix World { get; set; }

Property Value

A matrix that contains the world transform.

Expand image See Also

Reference

AlphaTestEffect Class
AlphaTestEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlphaTestEffect Events

AlphaTestEffect Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

AlphaTestEffect Class
Microsoft.Xna.Framework.Graphics Namespace


BasicEffect Class

BasicEffect Class
See Also Members
CollapseAll image

Contains a basic rendering effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class BasicEffect : Effect, IEffectMatrices, IEffectLights, IEffectFog

Expand image See Also

Reference

BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect Members

BasicEffect Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the BasicEffect type.

Expand image Public Constructors

 | Name | Description
Public Method | BasicEffect | Overloaded. Creates an instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).
Public Property | AmbientLightColor | Gets or sets the ambient color for a light, the range of color values is from 0 to 1.
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | DiffuseColor | Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.
Public Property | DirectionalLight0 | Gets the first directional light for this effect.
Public Property | DirectionalLight1 | Gets the second directional light for this effect.
Public Property | DirectionalLight2 | Gets the third directional light for this effect.
Public Property | EmissiveColor | Gets or sets the emissive color for a material, the range of color values is from 0 to 1.
Public Property | FogColor | Gets or sets the fog color, the range of color values is from 0 to 1.
Public Property | FogEnabled | Enables fog.
Public Property | FogEnd | Gets or sets the maximum z value for fog, which ranges from 0 to 1.
Public Property | FogStart | Gets or sets the minimum z value for fog, which ranges from 0 to 1.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LightingEnabled | Enables lighting for this effect.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | PreferPerPixelLighting | Gets or sets a value indicating that per-pixel lighting should be used if it is available for the current adapter. Per-pixel lighting is available if a graphics adapter supports Pixel Shader Model 2.0.
Public Property | Projection | Gets or sets the projection matrix.
Public Property | SpecularColor | Gets or sets the specular color for a material, the range of color values is from 0 to 1.
Public Property | SpecularPower | Gets or sets the specular power of this effect material.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)
Public Property | Texture | Gets or sets a texture to be applied by this effect.
Public Property | TextureEnabled | Enables textures for this effect.
Public Property | VertexColorEnabled | Enables use vertex colors for this effect.
Public Property | View | Gets or sets the view matrix.
Public Property | World | Gets or sets the world matrix.

Expand image Public Methods

 | Name | Description
Public Method | Clone | Create a copy of this object.
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | EnableDefaultLighting | Enables default lighting for this effect.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Computes derived parameter values immediately before applying the effect.

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

BasicEffect Class
Microsoft.Xna.Framework.Graphics Namespace


BasicEffect Constructor

BasicEffect Constructor

Creates an instance of this object.

Expand image Overload List

Name | Description
BasicEffect (BasicEffect) | Creates an instance of this object.
BasicEffect (GraphicsDevice) | Creates an instance of this object.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace


BasicEffect Constructor (BasicEffect)

BasicEffect Constructor (BasicEffect)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected BasicEffect (
         BasicEffect cloneSource
)

Parameters

cloneSource
An instance of a object to copy initialization data from.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect Constructor (GraphicsDevice)

BasicEffect Constructor (GraphicsDevice)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public BasicEffect (
         GraphicsDevice device
)

Parameters

device
A device.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect Methods

BasicEffect Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Create a copy of this object.
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | EnableDefaultLighting | Enables default lighting for this effect.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Computes derived parameter values immediately before applying the effect.

Expand image See Also

Reference

BasicEffect Class
Microsoft.Xna.Framework.Graphics Namespace


BasicEffect.Clone Method

BasicEffect.Clone Method

Create a copy of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override Effect Clone ()

Return Value

A copy of this object.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.EnableDefaultLighting Method

BasicEffect.EnableDefaultLighting Method

Enables default lighting for this effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void EnableDefaultLighting ()

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.OnApply Method

BasicEffect.OnApply Method

Computes derived parameter values immediately before applying the effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected internal override void OnApply ()

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect Properties

BasicEffect Properties

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).
Public Property | AmbientLightColor | Gets or sets the ambient color for a light, the range of color values is from 0 to 1.
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | DiffuseColor | Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.
Public Property | DirectionalLight0 | Gets the first directional light for this effect.
Public Property | DirectionalLight1 | Gets the second directional light for this effect.
Public Property | DirectionalLight2 | Gets the third directional light for this effect.
Public Property | EmissiveColor | Gets or sets the emissive color for a material, the range of color values is from 0 to 1.
Public Property | FogColor | Gets or sets the fog color, the range of color values is from 0 to 1.
Public Property | FogEnabled | Enables fog.
Public Property | FogEnd | Gets or sets the maximum z value for fog, which ranges from 0 to 1.
Public Property | FogStart | Gets or sets the minimum z value for fog, which ranges from 0 to 1.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LightingEnabled | Enables lighting for this effect.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | PreferPerPixelLighting | Gets or sets a value indicating that per-pixel lighting should be used if it is available for the current adapter. Per-pixel lighting is available if a graphics adapter supports Pixel Shader Model 2.0.
Public Property | Projection | Gets or sets the projection matrix.
Public Property | SpecularColor | Gets or sets the specular color for a material, the range of color values is from 0 to 1.
Public Property | SpecularPower | Gets or sets the specular power of this effect material.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)
Public Property | Texture | Gets or sets a texture to be applied by this effect.
Public Property | TextureEnabled | Enables textures for this effect.
Public Property | VertexColorEnabled | Enables use vertex colors for this effect.
Public Property | View | Gets or sets the view matrix.
Public Property | World | Gets or sets the world matrix.

Expand image See Also

Reference

BasicEffect Class
Microsoft.Xna.Framework.Graphics Namespace


BasicEffect.Alpha Property

BasicEffect.Alpha Property

Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float Alpha { get; set; }

Property Value

The alpha of this effect material.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.AmbientLightColor Property

BasicEffect.AmbientLightColor Property

Gets or sets the ambient color for a light, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 AmbientLightColor { get; set; }

Property Value

The ambient light color of this effect. Valid values are between 0 and 1.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.DiffuseColor Property

BasicEffect.DiffuseColor Property

Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 DiffuseColor { get; set; }

Property Value

The diffuse color of this effect material. Valid values are between 0 and 1.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.DirectionalLight0 Property

BasicEffect.DirectionalLight0 Property

Gets the first directional light for this effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight0 { get; }

Property Value

A directional light for this effect.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.DirectionalLight1 Property

BasicEffect.DirectionalLight1 Property

Gets the second directional light for this effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight1 { get; }

Property Value

A directional light for this effect.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.DirectionalLight2 Property

BasicEffect.DirectionalLight2 Property

Gets the third directional light for this effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight2 { get; }

Property Value

A directional light for this effect.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.EmissiveColor Property

BasicEffect.EmissiveColor Property

Gets or sets the emissive color for a material, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 EmissiveColor { get; set; }

Property Value

The emissive color of the effect material.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.FogColor Property

BasicEffect.FogColor Property

Gets or sets the fog color, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 FogColor { get; set; }

Property Value

A three-component color.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.FogEnabled Property

BasicEffect.FogEnabled Property

Enables fog.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool FogEnabled { get; set; }

Property Value

True to enable fog; false otherwise.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.FogEnd Property

BasicEffect.FogEnd Property

Gets or sets the maximum z value for fog, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogEnd { get; set; }

Property Value

Maximum z value for fog.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.FogStart Property

BasicEffect.FogStart Property

Gets or sets the minimum z value for fog, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogStart { get; set; }

Property Value

Minimum z value for fog.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.LightingEnabled Property

BasicEffect.LightingEnabled Property

Enables lighting for this effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool LightingEnabled { get; set; }

Property Value

true to enable lighting; false otherwise.

Expand image Remarks

The lighting for BasicEffect is per-vertex and uses three directional lights: DirectionalLight0, DirectionalLight1, and DirectionalLight2.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.PreferPerPixelLighting Property

BasicEffect.PreferPerPixelLighting Property

Gets or sets a value indicating that per-pixel lighting should be used if it is available for the current adapter. Per-pixel lighting is available if a graphics adapter supports Pixel Shader Model 2.0.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool PreferPerPixelLighting { get; set; }

Property Value

true to use per-pixel lighting if it is available; false to disable per-pixel lighting. The default value is true. When PreferPerPixelLighting is true, if the graphics adapter does not support a minimum of Pixel Shader Model 2.0, BasicEffect will automatically fall-back to per-vertex lighting. When PreferPerPixelLighting is false, per-vertex lighting is used regardless of whether per-pixel lighting is supported by the graphics adapter.

Expand image Remarks

There are two common types of real-time lighting used in games. Per-vertex lighting is where lighting contributions are determined at each vertex and then the results are interpolated across the triangle. Depending on how tessellated the mesh is, this can result in severe artifacts. Per-pixel lighting interpolates the per-vertex normal across the triangle, but calculates the contribution at each pixel, which results in much smoother lighting, particularly when a specular highlight falls between vertices.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.Projection Property

BasicEffect.Projection Property

Gets or sets the projection matrix. Use this matrix to change how a 3D image is converted to a 2D image that is rendered to the computer screen.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix Projection { get; set; }

Property Value

The projection matrix.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.SpecularColor Property

BasicEffect.SpecularColor Property

Gets or sets the specular color for a material, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 SpecularColor { get; set; }

Property Value

The specular color of this effect material. Valid values are between 0 and 1.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.SpecularPower Property

BasicEffect.SpecularPower Property

Gets or sets the specular power of this effect material.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float SpecularPower { get; set; }

Property Value

The specular power of this effect material.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.Texture Property

BasicEffect.Texture Property

Gets or sets a texture to be applied by this effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture2D Texture { get; set; }

Property Value

Texture to be applied by this effect.

Expand image Remarks

If the TextureFilter sampler state is not set, the default filter for BasicEffect is TextureFilter.Linear.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.TextureEnabled Property

BasicEffect.TextureEnabled Property

Enables textures for this effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool TextureEnabled { get; set; }

Property Value

true to enable textures; false otherwise.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.VertexColorEnabled Property

BasicEffect.VertexColorEnabled Property

Enables use vertex colors for this effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool VertexColorEnabled { get; set; }

Property Value

true to enable vertex colors; false otherwise.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.View Property

BasicEffect.View Property

Gets or sets the view matrix. Use this matrix to change the position and direction of the camera.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix View { get; set; }

Property Value

The view matrix.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect.World Property

BasicEffect.World Property

Gets or sets the world matrix. Use this matrix to change the position of the model, using world coordinates.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix World { get; set; }

Property Value

The world matrix.

Expand image See Also

Reference

BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BasicEffect Events

BasicEffect Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

BasicEffect Class
Microsoft.Xna.Framework.Graphics Namespace


Blend Enumeration

Blend Enumeration

Defines color blending factors.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum Blend

Expand image Members

Member name | Description
Zero | Each component of the color is multiplied by (0, 0, 0, 0).
One | Each component of the color is multiplied by (1, 1, 1, 1).
SourceColor | Each component of the color is multiplied by the source color. This can be represented as (Rs, Gs, Bs, As), where R, G, B, and A respectively stand for the red, green, blue, and alpha source values.
InverseSourceColor | Each component of the color is multiplied by the inverse of the source color. This can be represented as (1 − Rs, 1 − Gs, 1 − Bs, 1 − As) where R, G, B, and A respectively stand for the red, green, blue, and alpha destination values.
SourceAlpha | Each component of the color is multiplied by the alpha value of the source. This can be represented as (As, As, As, As), where As is the alpha source value.
InverseSourceAlpha | Each component of the color is multiplied by the inverse of the alpha value of the source. This can be represented as (1 − As, 1 − As, 1 − As, 1 − As), where As is the alpha destination value.
DestinationAlpha | Each component of the color is multiplied by the alpha value of the destination. This can be represented as (Ad, Ad, Ad, Ad), where Ad is the destination alpha value.
InverseDestinationAlpha | Each component of the color is multiplied by the inverse of the alpha value of the destination. This can be represented as (1 − Ad, 1 − Ad, 1 − Ad, 1 − Ad), where Ad is the alpha destination value.
DestinationColor | Each component color is multiplied by the destination color. This can be represented as (Rd, Gd, Bd, Ad), where R, G, B, and A respectively stand for red, green, blue, and alpha destination values.
InverseDestinationColor | Each component of the color is multiplied by the inverse of the destination color. This can be represented as (1 − Rd, 1 − Gd, 1 − Bd, 1 − Ad), where Rd, Gd, Bd, and Ad respectively stand for the red, green, blue, and alpha destination values.
SourceAlphaSaturation | Each component of the color is multiplied by either the alpha of the source color, or the inverse of the alpha of the source color, whichever is greater. This can be represented as (f, f, f, 1), where f = min(A, 1 − Ad).
BlendFactor | Each component of the color is multiplied by a constant set in BlendFactor.
InverseBlendFactor | Each component of the color is multiplied by the inverse of a constant set in BlendFactor.

Expand image See Also

Reference

BlendState.AlphaDestinationBlend Property
BlendState.AlphaSourceBlend Property
BlendState.ColorDestinationBlend Property
BlendState.ColorSourceBlend Property
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendFunction Enumeration

BlendFunction Enumeration

Defines how to combine a source color with the destination color already on the render target for color blending.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum BlendFunction

Expand image Members

Member name | Description
Add | The result is the destination added to the source. Result = (Source Color * Source Blend) + (Destination Color * Destination Blend)
Max | The result is the maximum of the source and destination. Result = max( (Source Color * Source Blend), (Destination Color * Destination Blend) )
Min | The result is the minimum of the source and destination. Result = min( (Source Color * Source Blend), (Destination Color * Destination Blend) )
ReverseSubtract | The result is the source subtracted from the destination. Result = (Destination Color * Destination Blend) − (Source Color * Source Blend)
Subtract | The result is the destination subtracted from the source. Result = (Source Color * Source Blend) − (Destination Color * Destination Blend)

Expand image See Also

Reference

ColorBlendFunction
ColorSourceBlend
ColorDestinationBlend
AlphaBlendFunction
AlphaSourceBlend
AlphaDestinationBlend
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState Class

BlendState Class
See Also Members
CollapseAll image

Contains blend state for the device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class BlendState : GraphicsResource

Expand image See Also

Reference

BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState Members

BlendState Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the BlendState type.

Expand image Public Constructors

 | Name | Description
Public Method | BlendState | Creates an instance of the BlendState class with default values, using additive color and alpha blending.

Expand image Public Fields

Name | Description
Additive | A built-in state object with settings for additive blend, that is adding the destination data to the source data without using alpha.
AlphaBlend | A built-in state object with settings for alpha blend, that is blending the source and destination data using alpha.
NonPremultiplied | A built-in state object with settings for blending with non-premultipled alpha, that is blending source and destination data using alpha while assuming the color data contains no alpha information.
Opaque | A built-in state object with settings for opaque blend, that is overwriting the source with the destination data.

Expand image Public Properties

 | Name | Description
Public Property | AlphaBlendFunction | Gets or sets the arithmetic operation when blending alpha values. The default is BlendFunction.Add.
Public Property | AlphaDestinationBlend | Gets or sets the blend factor for the destination alpha, which is the percentage of the destination alpha included in the blended result. The default is Blend.One.
Public Property | AlphaSourceBlend | Gets or sets the alpha blend factor. The default is Blend.One.
Public Property | BlendFactor | Gets or sets the four-component (RGBA) blend factor for alpha blending.
Public Property | ColorBlendFunction | Gets or sets the arithmetic operation when blending color values. The default is BlendFunction.Add.
Public Property | ColorDestinationBlend | Gets or sets the blend factor for the destination color. The default is Blend.One.
Public Property | ColorSourceBlend | Gets or sets the blend factor for the source color. The default is Blend.One.
Public Property | ColorWriteChannels | Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.
Public Property | ColorWriteChannels1 | Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.
Public Property | ColorWriteChannels2 | Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.
Public Property | ColorWriteChannels3 | Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | MultiSampleMask | Gets or sets a bitmask which defines which samples can be written during multisampling. The default is 0xffffffff.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

BlendState Class
Microsoft.Xna.Framework.Graphics Namespace


BlendState Fields

BlendState Fields

Expand image Public Fields

Name | Description
Additive | A built-in state object with settings for additive blend, that is adding the destination data to the source data without using alpha.
AlphaBlend | A built-in state object with settings for alpha blend, that is blending the source and destination data using alpha.
NonPremultiplied | A built-in state object with settings for blending with non-premultipled alpha, that is blending source and destination data using alpha while assuming the color data contains no alpha information.
Opaque | A built-in state object with settings for opaque blend, that is overwriting the source with the destination data.

Expand image See Also

Reference

BlendState Class
Microsoft.Xna.Framework.Graphics Namespace


BlendState.Additive Field

BlendState.Additive Field

A built-in state object with settings for additive blend, that is adding the destination data to the source data without using alpha.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly BlendState Additive

Expand image Remarks

This built-in state object has the following settings:

ColorSourceBlend = Blend.One,
AlphaSourceBlend = Blend.One,

ColorDestinationBlend = Blend.InverseSourceAlpha,
AlphaDestinationBlend = Blend.InverseSourceAlpha,

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.AlphaBlend Field

BlendState.AlphaBlend Field

A built-in state object with settings for alpha blend, that is blending the source and destination data using alpha.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly BlendState AlphaBlend

Expand image Remarks

This built-in state object has the following settings:

ColorSourceBlend = Blend.One,
AlphaSourceBlend = Blend.One,

ColorDestinationBlend = Blend.InverseSourceAlpha,
AlphaDestinationBlend = Blend.InverseSourceAlpha,

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.NonPremultiplied Field

BlendState.NonPremultiplied Field

A built-in state object with settings for blending with non-premultipled alpha, that is blending source and destination data using alpha while assuming the color data contains no alpha information.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly BlendState NonPremultiplied

Expand image Remarks

This built-in state object has the following settings:

ColorSourceBlend = Blend.SourceAlpha,
AlphaSourceBlend = Blend.SourceAlpha,

ColorDestinationBlend = Blend.InverseSourceAlpha,
AlphaDestinationBlend = Blend.InverseSourceAlpha,

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.Opaque Field

BlendState.Opaque Field

A built-in state object with settings for opaque blend, that is overwriting the source with the destination data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly BlendState Opaque

Expand image Remarks

This built-in state object has the following settings:

ColorSourceBlend = Blend.One,
AlphaSourceBlend = Blend.One,

ColorDestinationBlend = Blend.Zero,
AlphaDestinationBlend = Blend.Zero,

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState Constructor

BlendState Constructor

Creates an instance of the BlendState class with default values, using additive color and alpha blending.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public BlendState ()

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image Remarks

For more information about blending, see What Is Color Blending?.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState Methods

BlendState Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BlendState Class
Microsoft.Xna.Framework.Graphics Namespace


BlendState.Dispose Method

BlendState.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
BlendState.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace


BlendState.Dispose Method (Boolean)

BlendState.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState Properties

BlendState Properties

Expand image Public Properties

 | Name | Description
Public Property | AlphaBlendFunction | Gets or sets the arithmetic operation when blending alpha values. The default is BlendFunction.Add.
Public Property | AlphaDestinationBlend | Gets or sets the blend factor for the destination alpha, which is the percentage of the destination alpha included in the blended result. The default is Blend.One.
Public Property | AlphaSourceBlend | Gets or sets the alpha blend factor. The default is Blend.One.
Public Property | BlendFactor | Gets or sets the four-component (RGBA) blend factor for alpha blending.
Public Property | ColorBlendFunction | Gets or sets the arithmetic operation when blending color values. The default is BlendFunction.Add.
Public Property | ColorDestinationBlend | Gets or sets the blend factor for the destination color. The default is Blend.One.
Public Property | ColorSourceBlend | Gets or sets the blend factor for the source color. The default is Blend.One.
Public Property | ColorWriteChannels | Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.
Public Property | ColorWriteChannels1 | Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.
Public Property | ColorWriteChannels2 | Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.
Public Property | ColorWriteChannels3 | Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | MultiSampleMask | Gets or sets a bitmask which defines which samples can be written during multisampling. The default is 0xffffffff.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Remarks

For more information about blending, see What Is Color Blending?.

Expand image See Also

Reference

BlendState Class
Microsoft.Xna.Framework.Graphics Namespace


BlendState.AlphaBlendFunction Property

BlendState.AlphaBlendFunction Property

Gets or sets the arithmetic operation when blending alpha values. The default is BlendFunction.Add.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public BlendFunction AlphaBlendFunction { get; set; }

Property Value

A value from the BlendFunction enumeration.

Expand image Remarks

For more information about blending, see What Is Color Blending?.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.AlphaDestinationBlend Property

BlendState.AlphaDestinationBlend Property

Gets or sets the blend factor for the destination alpha, which is the percentage of the destination alpha included in the blended result. The default is Blend.One.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Blend AlphaDestinationBlend { get; set; }

Property Value

A value from the Blend enumeration.

Expand image Remarks

For more information about blending, see What Is Color Blending?.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.AlphaSourceBlend Property

BlendState.AlphaSourceBlend Property

Gets or sets the alpha blend factor. The default is Blend.One.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Blend AlphaSourceBlend { get; set; }

Property Value

The blend factor.

Expand image Remarks

For more information about blending, see What Is Color Blending?.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.BlendFactor Property

BlendState.BlendFactor Property

Gets or sets the four-component (RGBA) blend factor for alpha blending.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Color BlendFactor { get; set; }

Property Value

A four-component (RGBA) blend factor.

Expand image Remarks

For more information about blending, see What Is Color Blending?.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.ColorBlendFunction Property

BlendState.ColorBlendFunction Property

Gets or sets the arithmetic operation when blending color values. The default is BlendFunction.Add.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public BlendFunction ColorBlendFunction { get; set; }

Property Value

A value from the BlendFunction enumeration.

Expand image Remarks

For more information about blending, see What Is Color Blending?.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.ColorDestinationBlend Property

BlendState.ColorDestinationBlend Property

Gets or sets the blend factor for the destination color. The default is Blend.One.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Blend ColorDestinationBlend { get; set; }

Property Value

The blend factor.

Expand image Remarks

For more information about blending, see What Is Color Blending?.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.ColorSourceBlend Property

BlendState.ColorSourceBlend Property

Gets or sets the blend factor for the source color. The default is Blend.One.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Blend ColorSourceBlend { get; set; }

Property Value

The blend factor.

Expand image Remarks

For more information about blending, see What Is Color Blending?.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.ColorWriteChannels Property

BlendState.ColorWriteChannels Property

Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ColorWriteChannels ColorWriteChannels { get; set; }

Property Value

Any value from the ColorWriteChannels enumeration.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.ColorWriteChannels1 Property

BlendState.ColorWriteChannels1 Property

Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ColorWriteChannels ColorWriteChannels1 { get; set; }

Property Value

Any value from the ColorWriteChannels enumeration.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.ColorWriteChannels2 Property

BlendState.ColorWriteChannels2 Property

Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ColorWriteChannels ColorWriteChannels2 { get; set; }

Property Value

Any value from the ColorWriteChannels enumeration.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.ColorWriteChannels3 Property

BlendState.ColorWriteChannels3 Property

Gets or sets which color channels (RGBA) are enabled for writing during color blending. The default value is ColorWriteChannels.None.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ColorWriteChannels ColorWriteChannels3 { get; set; }

Property Value

Any value from the ColorWriteChannels enumeration.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState.MultiSampleMask Property

BlendState.MultiSampleMask Property

Gets or sets a bitmask which defines which samples can be written during multisampling. The default is 0xffffffff.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int MultiSampleMask { get; set; }

Property Value

A bitmask which defines multisample write locations.

Expand image Remarks

Each bit enables writing to a multisample location. As an example, the first 8 bits enable the first eight samples for an 8-sample render target. The mask has no effect when not multisampling.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


BlendState Events

BlendState Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

BlendState Class
Microsoft.Xna.Framework.Graphics Namespace


BufferUsage Enumeration

BufferUsage Enumeration

Specifies special usage of the buffer contents.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[FlagsAttribute]
public enum BufferUsage

Expand image Members

Member name | Description
None | None
WriteOnly | Indicates that the application only writes to the vertex buffer. If specified, the driver chooses the best memory location for efficient writing and rendering. Attempts to read from a write-only vertex buffer fail.

Expand image See Also

Reference

Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ClearOptions Enumeration

ClearOptions Enumeration

Specifies the buffer to use when calling Clear.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[FlagsAttribute]
public enum ClearOptions

Expand image Members

Member name | Description
DepthBuffer | A depth buffer.
Stencil | A stencil buffer.
Target | A render target.

Expand image See Also

Reference

Clear
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ColorWriteChannels Enumeration

ColorWriteChannels Enumeration

Defines the color channels that can be chosen for a per-channel write to a render target color buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[FlagsAttribute]
public enum ColorWriteChannels

Expand image Members

Member name | Description
All | All buffer channels.
Alpha | Alpha channel of a buffer.
Blue | Blue channel of a buffer.
Green | Green channel of a buffer.
None | No channel selected.
Red | Red channel of a buffer.

Expand image See Also

Reference

BlendState.ColorWriteChannels Property
BlendState.ColorWriteChannels1 Property
BlendState.ColorWriteChannels2 Property
BlendState.ColorWriteChannels3 Property
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CompareFunction Enumeration

CompareFunction Enumeration

Defines comparison functions that can be chosen for alpha, stencil, or depth-buffer tests.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum CompareFunction

Expand image Members

Member name | Description
Always | Always pass the test.
Equal | Accept the new pixel if its value is equal to the value of the current pixel.
Greater | Accept the new pixel if its value is greater than the value of the current pixel.
GreaterEqual | Accept the new pixel if its value is greater than or equal to the value of the current pixel.
Less | Accept the new pixel if its value is less than the value of the current pixel.
LessEqual | Accept the new pixel if its value is less than or equal to the value of the current pixel.
Never | Always fail the test.
NotEqual | Accept the new pixel if its value does not equal the value of the current pixel.

Expand image See Also

Reference

CounterClockwiseStencilFunction
DepthBufferFunction
StencilFunction
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CubeMapFace Enumeration

CubeMapFace Enumeration

Defines the faces of a cube map in the TextureCube class type.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum CubeMapFace

Expand image Members

Member name | Description
NegativeX | Negative x-face of the cube map.
NegativeY | Negative y-face of the cube map.
NegativeZ | Negative z-face of the cube map.
PositiveX | Positive x-face of the cube map.
PositiveY | Positive y-face of the cube map.
PositiveZ | Positive z-face of the cube map.

Expand image See Also

Reference

TextureCube.GetData Method
TextureCube.SetData Method
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


CullMode Enumeration

CullMode Enumeration

Defines winding orders that may be used to identify back faces for culling.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum CullMode

Expand image Members

Member name | Description
CullClockwiseFace | Cull back faces with clockwise vertices.
CullCounterClockwiseFace | Cull back faces with counterclockwise vertices.
None | Do not cull back faces.

Expand image See Also

Reference

RasterizerState.CullMode Property
DepthStencilState.TwoSidedStencilMode Property
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthFormat Enumeration

DepthFormat Enumeration

Defines the format of data in a depth-stencil buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum DepthFormat

Expand image Members

Member name | Description
Depth16 | A buffer that contains 16-bits of depth data.
Depth24 | A buffer that contains 24-bits of depth data.
Depth24Stencil8 | A 32 bit buffer that contains 24 bits of depth data and 8 bits of stencil data.
None | Do not create a depth buffer.

Expand image Remarks

A depth buffer contains depth data and possibly stencil data. Control a depth buffer using a state object; for a more information, see What Is Depth Stencil State?.

Expand image See Also

Concepts

What Is a Depth Buffer?
What Is a Stencil Buffer?

Reference

Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState Class

DepthStencilState Class
See Also Members
CollapseAll image

Contains depth-stencil state for the device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class DepthStencilState : GraphicsResource

Expand image See Also

Reference

DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState Members

DepthStencilState Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the DepthStencilState type.

Expand image Public Constructors

 | Name | Description
Public Method | DepthStencilState | Creates an instance of DepthStencilState with default values.

Expand image Public Fields

Name | Description
Default | A built-in state object with default settings for using a depth stencil buffer.
DepthRead | A built-in state object with settings for enabling a read-only depth stencil buffer.
None | A built-in state object with settings for not using a depth stencil buffer.

Expand image Public Properties

 | Name | Description
Public Property | CounterClockwiseStencilDepthBufferFail | Gets or sets the stencil operation to perform if the stencil test passes and the depth-buffer test fails for a counterclockwise triangle. The default is StencilOperation.Keep.
Public Property | CounterClockwiseStencilFail | Gets or sets the stencil operation to perform if the stencil test fails for a counterclockwise triangle. The default is StencilOperation.Keep.
Public Property | CounterClockwiseStencilFunction | Gets or sets the comparison function to use for counterclockwise stencil tests. The default is CompareFunction.Always.
Public Property | CounterClockwiseStencilPass | Gets or sets the stencil operation to perform if the stencil and depth-tests pass for a counterclockwise triangle. The default is StencilOperation.Keep.
Public Property | DepthBufferEnable | Enables or disables depth buffering. The default is true.
Public Property | DepthBufferFunction | Gets or sets the comparison function for the depth-buffer test. The default is CompareFunction.LessEqual
Public Property | DepthBufferWriteEnable | Enables or disables writing to the depth buffer. The default is true.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | ReferenceStencil | Specifies a reference value to use for the stencil test. The default is 0.
Public Property | StencilDepthBufferFail | Gets or sets the stencil operation to perform if the stencil test passes and the depth-test fails. The default is StencilOperation.Keep.
Public Property | StencilEnable | Gets or sets stencil enabling. The default is false.
Public Property | StencilFail | Gets or sets the stencil operation to perform if the stencil test fails. The default is StencilOperation.Keep.
Public Property | StencilFunction | Gets or sets the comparison function for the stencil test. The default is CompareFunction.Always.
Public Property | StencilMask | Gets or sets the mask applied to the reference value and each stencil buffer entry to determine the significant bits for the stencil test. The default mask is Int32.MaxValue.
Public Property | StencilPass | Gets or sets the stencil operation to perform if the stencil test passes. The default is StencilOperation.Keep.
Public Property | StencilWriteMask | Gets or sets the write mask applied to values written into the stencil buffer. The default mask is Int32.MaxValue.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | TwoSidedStencilMode | Enables or disables two-sided stenciling. The default is false.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

DepthStencilState Class
Microsoft.Xna.Framework.Graphics Namespace


DepthStencilState Fields

DepthStencilState Fields

Expand image Public Fields

Name | Description
Default | A built-in state object with default settings for using a depth stencil buffer.
DepthRead | A built-in state object with settings for enabling a read-only depth stencil buffer.
None | A built-in state object with settings for not using a depth stencil buffer.

Expand image See Also

Reference

DepthStencilState Class
Microsoft.Xna.Framework.Graphics Namespace


DepthStencilState.Default Field

DepthStencilState.Default Field

A built-in state object with default settings for using a depth stencil buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly DepthStencilState Default

Expand image Remarks

This built-in state object has the following settings:

DepthBufferEnable = true,
DepthBufferWriteEnable = true,

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.DepthRead Field

DepthStencilState.DepthRead Field

A built-in state object with settings for enabling a read-only depth stencil buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly DepthStencilState DepthRead

Expand image Remarks

This built-in state object has the following settings:

DepthBufferEnable = true,
DepthBufferWriteEnable = false,

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.None Field

DepthStencilState.None Field

A built-in state object with settings for not using a depth stencil buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly DepthStencilState None

Expand image Remarks

This built-in state object has the following settings:

DepthBufferEnable = false,
DepthBufferWriteEnable = false,

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState Constructor

DepthStencilState Constructor

Creates an instance of DepthStencilState with default values.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DepthStencilState ()

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState Methods

DepthStencilState Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DepthStencilState Class
Microsoft.Xna.Framework.Graphics Namespace


DepthStencilState.Dispose Method

DepthStencilState.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
DepthStencilState.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace


DepthStencilState.Dispose Method (Boolean)

DepthStencilState.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState Properties

DepthStencilState Properties

Expand image Public Properties

 | Name | Description
Public Property | CounterClockwiseStencilDepthBufferFail | Gets or sets the stencil operation to perform if the stencil test passes and the depth-buffer test fails for a counterclockwise triangle. The default is StencilOperation.Keep.
Public Property | CounterClockwiseStencilFail | Gets or sets the stencil operation to perform if the stencil test fails for a counterclockwise triangle. The default is StencilOperation.Keep.
Public Property | CounterClockwiseStencilFunction | Gets or sets the comparison function to use for counterclockwise stencil tests. The default is CompareFunction.Always.
Public Property | CounterClockwiseStencilPass | Gets or sets the stencil operation to perform if the stencil and depth-tests pass for a counterclockwise triangle. The default is StencilOperation.Keep.
Public Property | DepthBufferEnable | Enables or disables depth buffering. The default is true.
Public Property | DepthBufferFunction | Gets or sets the comparison function for the depth-buffer test. The default is CompareFunction.LessEqual
Public Property | DepthBufferWriteEnable | Enables or disables writing to the depth buffer. The default is true.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | ReferenceStencil | Specifies a reference value to use for the stencil test. The default is 0.
Public Property | StencilDepthBufferFail | Gets or sets the stencil operation to perform if the stencil test passes and the depth-test fails. The default is StencilOperation.Keep.
Public Property | StencilEnable | Gets or sets stencil enabling. The default is false.
Public Property | StencilFail | Gets or sets the stencil operation to perform if the stencil test fails. The default is StencilOperation.Keep.
Public Property | StencilFunction | Gets or sets the comparison function for the stencil test. The default is CompareFunction.Always.
Public Property | StencilMask | Gets or sets the mask applied to the reference value and each stencil buffer entry to determine the significant bits for the stencil test. The default mask is Int32.MaxValue.
Public Property | StencilPass | Gets or sets the stencil operation to perform if the stencil test passes. The default is StencilOperation.Keep.
Public Property | StencilWriteMask | Gets or sets the write mask applied to values written into the stencil buffer. The default mask is Int32.MaxValue.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | TwoSidedStencilMode | Enables or disables two-sided stenciling. The default is false.

Expand image See Also

Reference

DepthStencilState Class
Microsoft.Xna.Framework.Graphics Namespace


DepthStencilState.CounterClockwiseStencilDepthBufferFail Property

DepthStencilState.CounterClockwiseStencilDepthBufferFail Property
See Also
CollapseAll image

Gets or sets the stencil operation to perform if the stencil test passes and the depth-buffer test fails for a counterclockwise triangle. The default is StencilOperation.Keep.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public StencilOperation CounterClockwiseStencilDepthBufferFail { get; set; }

Property Value

The stencil operation to perform.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.CounterClockwiseStencilFail Property

DepthStencilState.CounterClockwiseStencilFail Property

Gets or sets the stencil operation to perform if the stencil test fails for a counterclockwise triangle. The default is StencilOperation.Keep.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public StencilOperation CounterClockwiseStencilFail { get; set; }

Property Value

The stencil operation to perform.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.CounterClockwiseStencilFunction Property

DepthStencilState.CounterClockwiseStencilFunction Property

Gets or sets the comparison function to use for counterclockwise stencil tests. The default is CompareFunction.Always.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public CompareFunction CounterClockwiseStencilFunction { get; set; }

Property Value

A CompareFunction value indicating which test to perform.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.CounterClockwiseStencilPass Property

DepthStencilState.CounterClockwiseStencilPass Property

Gets or sets the stencil operation to perform if the stencil and depth-tests pass for a counterclockwise triangle. The default is StencilOperation.Keep.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public StencilOperation CounterClockwiseStencilPass { get; set; }

Property Value

The stencil operation to perform.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.DepthBufferEnable Property

DepthStencilState.DepthBufferEnable Property

Enables or disables depth buffering. The default is true.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool DepthBufferEnable { get; set; }

Property Value

true if depth buffering is enabled; false otherwise.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.DepthBufferFunction Property

DepthStencilState.DepthBufferFunction Property

Gets or sets the comparison function for the depth-buffer test. The default is CompareFunction.LessEqual

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public CompareFunction DepthBufferFunction { get; set; }

Property Value

Value of a CompareFunction that represents the comparison function to set or get.

Expand image Remarks

The depth value of the pixel is compared to the depth-buffer value. If the depth value of the pixel passes the comparison function, the pixel is written.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.DepthBufferWriteEnable Property

DepthStencilState.DepthBufferWriteEnable Property

Enables or disables writing to the depth buffer. The default is true.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool DepthBufferWriteEnable { get; set; }

Property Value

true if writing to the depth buffer is enabled; false otherwise.

Expand image Remarks

This property enables an application to prevent the system from updating the depth buffer with new depth values.

If false, depth comparisons are still made according to the render state DepthBufferFunction, assuming that depth buffering is taking place, but depth values are not written to the buffer.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.ReferenceStencil Property

DepthStencilState.ReferenceStencil Property

Specifies a reference value to use for the stencil test. The default is 0.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int ReferenceStencil { get; set; }

Property Value

Integer that specifies the stencil test value to set or get.

Expand image Remarks

The reference value is compared, by the comparison function specified by the StencilFunction property, to the stencil buffer entry of a pixel. This can be illustrated by a simple equation:

ReferenceStencil StencilFunction (stencil buffer entry)

This comparison applies only to the bits in the reference value and stencil buffer entry that are set in the stencil mask by this property. If the comparison is true, the stencil test passes and the pass operation (specified by the StencilPass property) is performed.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.StencilDepthBufferFail Property

DepthStencilState.StencilDepthBufferFail Property

Gets or sets the stencil operation to perform if the stencil test passes and the depth-test fails. The default is StencilOperation.Keep.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public StencilOperation StencilDepthBufferFail { get; set; }

Property Value

The stencil operation to perform.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.StencilEnable Property

DepthStencilState.StencilEnable Property

Gets or sets stencil enabling. The default is false.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool StencilEnable { get; set; }

Property Value

true if stenciling is enabled; false otherwise.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.StencilFail Property

DepthStencilState.StencilFail Property

Gets or sets the stencil operation to perform if the stencil test fails. The default is StencilOperation.Keep.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public StencilOperation StencilFail { get; set; }

Property Value

The stencil operation to perform.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.StencilFunction Property

DepthStencilState.StencilFunction Property

Gets or sets the comparison function for the stencil test. The default is CompareFunction.Always.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public CompareFunction StencilFunction { get; set; }

Property Value

Value of a CompareFunction that represents the comparison function to set or get.

Expand image Remarks

The comparison function is used to compare the reference value (stored in the ReferenceStencil property) to the stencil buffer entry of a pixel. This can be illustrated by a simple equation:

ReferenceStencil StencilFunction (stencil buffer entry)

This comparison applies only to the bits in the reference value and stencil buffer entry that are set in the stencil mask by this property. If the comparison is true, the stencil test passes and the pass operation (specified by the StencilPass property) is performed.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.StencilMask Property

DepthStencilState.StencilMask Property

Gets or sets the mask applied to the reference value and each stencil buffer entry to determine the significant bits for the stencil test. The default mask is Int32.MaxValue.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int StencilMask { get; set; }

Property Value

Value that represents the mask to set or get.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.StencilPass Property

DepthStencilState.StencilPass Property

Gets or sets the stencil operation to perform if the stencil test passes. The default is StencilOperation.Keep.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public StencilOperation StencilPass { get; set; }

Property Value

The stencil operation to perform.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.StencilWriteMask Property

DepthStencilState.StencilWriteMask Property

Gets or sets the write mask applied to values written into the stencil buffer. The default mask is Int32.MaxValue.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int StencilWriteMask { get; set; }

Property Value

Value that represents the write mask to set or get.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState.TwoSidedStencilMode Property

DepthStencilState.TwoSidedStencilMode Property

Enables or disables two-sided stenciling. The default is false.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool TwoSidedStencilMode { get; set; }

Property Value

true to enable two-sided stenciling; false otherwise.

Expand image Remarks

Set this property to CullMode.None to enable two-sided stencil mode. If the triangle winding order is clockwise, the StencilFunction will be used. If the winding order is counterclockwise, the CounterClockwiseStencilFunction will be used.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DepthStencilState Events

DepthStencilState Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

DepthStencilState Class
Microsoft.Xna.Framework.Graphics Namespace


DeviceLostException Class

DeviceLostException Class
See Also Members
CollapseAll image

The exception that is thrown when the device has been lost, but cannot be reset at this time. Therefore, rendering is not possible.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SerializableAttribute]
public sealed class DeviceLostException : Exception

Expand image See Also

Reference

DeviceLostException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DeviceLostException Members

DeviceLostException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the DeviceLostException type.

Expand image Public Constructors

 | Name | Description
Public Method | DeviceLostException | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DeviceLostException Class
Microsoft.Xna.Framework.Graphics Namespace


DeviceLostException Constructor

DeviceLostException Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
DeviceLostException () | Initializes a new instance of this class.
DeviceLostException (String) | Initializes a new instance of this class with a specified error message.
DeviceLostException (String, Exception) | Initializes a new instance of this class with a specified error message and a reference to the inner exception that is the cause of this exception.

Expand image See Also

Reference

DeviceLostException Class
DeviceLostException Members
Microsoft.Xna.Framework.Graphics Namespace


DeviceLostException Constructor ()

DeviceLostException Constructor ()
See Also
CollapseAll image

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DeviceLostException ()

Expand image Remarks

This constructor initializes the Message property of the new instance to a system-supplied message that describes the error, such as "The device has been lost but cannot be reset at this time." This message takes into account the current system culture.

The following table shows the initial property values for an instance of DeviceLostException.

Property | Value
InnerException | A null reference.
Message | The localized error message string.

Expand image See Also

Reference

DeviceLostException Class
DeviceLostException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DeviceLostException Constructor (String)

DeviceLostException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of this class with a specified error message.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DeviceLostException (
         string message
)

Parameters

message
A message that describes the error.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

The following table shows the initial property values for an instance of DeviceLostException.

Property | Value
InnerException | A null reference.
Message | The localized error message string.

Expand image See Also

Reference

DeviceLostException Class
DeviceLostException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DeviceLostException Constructor (String, Exception)

DeviceLostException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of this class with a specified error message and a reference to the inner exception that is the cause of this exception.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DeviceLostException (
         string message,
         Exception inner
)

Parameters

message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or a null reference if the InnerException property does not supply the inner exception value to the constructor.

The following table shows the initial property values for an instance of DeviceLostException.

Property | Value
InnerException | A null reference.
Message | The localized error message string.

Expand image See Also

Reference

DeviceLostException Class
DeviceLostException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DeviceLostException Methods

DeviceLostException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DeviceLostException Class
Microsoft.Xna.Framework.Graphics Namespace


DeviceLostException Properties

DeviceLostException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

DeviceLostException Class
Microsoft.Xna.Framework.Graphics Namespace


DeviceNotResetException Class

DeviceNotResetException Class
See Also Members
CollapseAll image

The exception that is thrown when the device has been lost, but can be reset at this time.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SerializableAttribute]
public sealed class DeviceNotResetException : Exception

Expand image See Also

Reference

DeviceNotResetException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DeviceNotResetException Members

DeviceNotResetException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the DeviceNotResetException type.

Expand image Public Constructors

 | Name | Description
Public Method | DeviceNotResetException | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DeviceNotResetException Class
Microsoft.Xna.Framework.Graphics Namespace


DeviceNotResetException Constructor

DeviceNotResetException Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
DeviceNotResetException () | Initializes a new instance of this class.
DeviceNotResetException (String) | Initializes a new instance of this class with a specified error message.
DeviceNotResetException (String, Exception) | Initializes a new instance of this class with a specified error message and a reference to the inner exception that is the cause of this exception.

Expand image See Also

Reference

DeviceNotResetException Class
DeviceNotResetException Members
Microsoft.Xna.Framework.Graphics Namespace


DeviceNotResetException Constructor ()

DeviceNotResetException Constructor ()
See Also
CollapseAll image

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DeviceNotResetException ()

Expand image Remarks

This constructor initializes the Message property of the new instance to a system-supplied message that describes the error, such as "The device has been lost but can be reset at this time." This message takes into account the current system culture.

The following table shows the initial property values for an instance of DeviceNotResetException.

Property | Value
InnerException | A null reference.
Message | The localized error message string.

Expand image See Also

Reference

DeviceNotResetException Class
DeviceNotResetException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DeviceNotResetException Constructor (String)

DeviceNotResetException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of this class with a specified error message.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DeviceNotResetException (
         string message
)

Parameters

message
A message that describes the error.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

The following table shows the initial property values for an instance of DeviceNotResetException.

Property | Value
InnerException | A null reference.
Message | The localized error message string.

Expand image See Also

Reference

DeviceNotResetException Class
DeviceNotResetException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DeviceNotResetException Constructor (String, Exception)

DeviceNotResetException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of this class with a specified error message and a reference to the inner exception that is the cause of this exception.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DeviceNotResetException (
         string message,
         Exception inner
)

Parameters

message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or a null reference if the InnerException property does not supply the inner exception value to the constructor.

The following table shows the initial property values for an instance of DeviceNotResetException.

Property | Value
InnerException | A null reference.
Message | The localized error message string.

Expand image See Also

Reference

DeviceNotResetException Class
DeviceNotResetException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DeviceNotResetException Methods

DeviceNotResetException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DeviceNotResetException Class
Microsoft.Xna.Framework.Graphics Namespace


DeviceNotResetException Properties

DeviceNotResetException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

DeviceNotResetException Class
Microsoft.Xna.Framework.Graphics Namespace


DirectionalLight Class

DirectionalLight Class
See Also Members
CollapseAll image

Creates a DirectionalLight object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class DirectionalLight

Expand image See Also

Reference

DirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DirectionalLight Members

DirectionalLight Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the DirectionalLight type.

Expand image Public Constructors

 | Name | Description
Public Method | DirectionalLight | Creates a new DirectionalLight instance, with or without a copy of a DirectionalLight instance.

Expand image Public Properties

 | Name | Description
Public Property | DiffuseColor | Gets or sets the diffuse color of the light.
Public Property | Direction | Gets or sets the light direction. This value must be a unit vector.
Public Property | Enabled | Gets or sets light enable flag.
Public Property | SpecularColor | Gets or sets the specular color of the light.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DirectionalLight Class
Microsoft.Xna.Framework.Graphics Namespace


DirectionalLight Constructor

DirectionalLight Constructor

Creates a new DirectionalLight instance, with or without a copy of a DirectionalLight instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight (
         EffectParameter directionParameter,
         EffectParameter diffuseColorParameter,
         EffectParameter specularColorParameter,
         DirectionalLight cloneSource
)

Parameters

directionParameter
The light direction.
diffuseColorParameter
The diffuse color.
specularColorParameter
The specular color.
cloneSource
The cloned instance to copy from.

Expand image Remarks

The initial parameter values are either copied from the cloned object or set to default values (if the cloned object is NULL). The three EffectParameters are updated whenever the direction, diffuse color, or specular color properties are changed; or you can set these to NULL if you are using the cloned object.

Expand image See Also

Reference

DirectionalLight Class
DirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DirectionalLight Methods

DirectionalLight Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DirectionalLight Class
Microsoft.Xna.Framework.Graphics Namespace


DirectionalLight Properties

DirectionalLight Properties

Expand image Public Properties

 | Name | Description
Public Property | DiffuseColor | Gets or sets the diffuse color of the light.
Public Property | Direction | Gets or sets the light direction. This value must be a unit vector.
Public Property | Enabled | Gets or sets light enable flag.
Public Property | SpecularColor | Gets or sets the specular color of the light.

Expand image See Also

Reference

DirectionalLight Class
Microsoft.Xna.Framework.Graphics Namespace


DirectionalLight.DiffuseColor Property

DirectionalLight.DiffuseColor Property

Gets or sets the diffuse color of the light.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 DiffuseColor { get; set; }

Property Value

The diffuse color.

Expand image See Also

Reference

DirectionalLight Class
DirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DirectionalLight.Direction Property

DirectionalLight.Direction Property

Gets or sets the light direction. This value must be a unit vector.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 Direction { get; set; }

Property Value

The light direction.

Expand image See Also

Reference

DirectionalLight Class
DirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DirectionalLight.Enabled Property

DirectionalLight.Enabled Property

Gets or sets light enable flag.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool Enabled { get; set; }

Property Value

The light enable flag.

Expand image See Also

Reference

DirectionalLight Class
DirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DirectionalLight.SpecularColor Property

DirectionalLight.SpecularColor Property

Gets or sets the specular color of the light.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 SpecularColor { get; set; }

Property Value

The specular color.

Expand image See Also

Reference

DirectionalLight Class
DirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayMode Class

DisplayMode Class
See Also Members
CollapseAll image

Describes the display mode.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SerializableAttribute]
public class DisplayMode

Expand image See Also

Reference

DisplayMode
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayMode Members

DisplayMode Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the DisplayMode type.

Expand image Public Properties

 | Name | Description
Public Property | AspectRatio | Gets the aspect ratio used by the graphics device.
Public Property | Format | Gets a value indicating the surface format of the display mode.
Public Property | Height | Gets a value indicating the screen height, in pixels.
Public Property | TitleSafeArea | Returns the title safe area of the display.
Public Property | Width | Gets a value indicating the screen width, in pixels.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DisplayMode Class
Microsoft.Xna.Framework.Graphics Namespace


DisplayMode Methods

DisplayMode Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DisplayMode Class
Microsoft.Xna.Framework.Graphics Namespace


DisplayMode.ToString Method

DisplayMode.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

DisplayMode Class
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayMode Properties

DisplayMode Properties

Expand image Public Properties

 | Name | Description
Public Property | AspectRatio | Gets the aspect ratio used by the graphics device.
Public Property | Format | Gets a value indicating the surface format of the display mode.
Public Property | Height | Gets a value indicating the screen height, in pixels.
Public Property | TitleSafeArea | Returns the title safe area of the display.
Public Property | Width | Gets a value indicating the screen width, in pixels.

Expand image See Also

Reference

DisplayMode Class
Microsoft.Xna.Framework.Graphics Namespace


DisplayMode.AspectRatio Property

DisplayMode.AspectRatio Property

Gets the aspect ratio used by the graphics device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float AspectRatio { get; }

Property Value

Aspect ratio of the viewport.

Expand image See Also

Reference

DisplayMode Class
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayMode.Format Property

DisplayMode.Format Property

Gets a value indicating the surface format of the display mode.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public SurfaceFormat Format { get; }

Property Value

The surface format of the display mode.

Expand image See Also

Reference

DisplayMode Class
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayMode.Height Property

DisplayMode.Height Property

Gets a value indicating the screen height, in pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Height { get; }

Property Value

Screen height, in pixels.

Expand image See Also

Reference

DisplayMode Class
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayMode.TitleSafeArea Property

DisplayMode.TitleSafeArea Property

Returns the title safe area of the display.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Rectangle TitleSafeArea { get; }

Property Value

The title safe area.

Expand image Remarks

On television sets, text should not be displayed at the outer edges of the screen because it may not be visible to the user. The title safe area is the part of the screen where text should be displayed.

Expand image See Also

Reference

DisplayMode Class
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayMode.Width Property

DisplayMode.Width Property

Gets a value indicating the screen width, in pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Width { get; }

Property Value

Screen width, in pixels.

Expand image See Also

Reference

DisplayMode Class
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayModeCollection Class

DisplayModeCollection Class
See Also Members
CollapseAll image

Manipulates a collection of DisplayMode structures.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class DisplayModeCollection : IEnumerable<DisplayMode>, IEnumerable

Expand image See Also

Reference

DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayModeCollection Members

DisplayModeCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the DisplayModeCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Item | Retrieves the DisplayMode structure with the specified format.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through the DisplayModeCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets a collection of display modes available for this format.

Expand image See Also

Reference

DisplayModeCollection Class
Microsoft.Xna.Framework.Graphics Namespace


DisplayModeCollection Methods

DisplayModeCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through the DisplayModeCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets a collection of display modes available for this format.

Expand image See Also

Reference

DisplayModeCollection Class
Microsoft.Xna.Framework.Graphics Namespace


DisplayModeCollection.GetEnumerator Method

DisplayModeCollection.GetEnumerator Method

Gets an enumerator that can iterate through the DisplayModeCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public IEnumerator<DisplayMode> GetEnumerator ()

Return Value

Enumerator that can iterate through the DisplayModeCollection.

Expand image See Also

Reference

DisplayModeCollection Class
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Gets a collection of display modes available for this format.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

Enumerator that can iterate through the DisplayModeCollection.

Expand image See Also

Reference

DisplayModeCollection Class
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DisplayModeCollection Properties

DisplayModeCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Item | Retrieves the DisplayMode structure with the specified format.

Expand image See Also

Reference

DisplayModeCollection Class
Microsoft.Xna.Framework.Graphics Namespace


DisplayModeCollection.Item Property

DisplayModeCollection.Item Property

Retrieves the DisplayMode structure with the specified format.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public IEnumerable<DisplayMode> this [
         SurfaceFormat format
] { get; }

Property Value

The DisplayMode.

Expand image See Also

Reference

DisplayModeCollection Class
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect Class

DualTextureEffect Class
See Also Members
CollapseAll image

Contains a configurable effect that supports two-layer multitexturing.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class DualTextureEffect : Effect, IEffectMatrices, IEffectFog

Expand image See Also

Reference

DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect Members

DualTextureEffect Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the DualTextureEffect type.

Expand image Public Constructors

 | Name | Description
Public Method | DualTextureEffect | Overloaded. Creates a configurable effect that supports two-layer multitexturing.

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | DiffuseColor | Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.
Public Property | FogColor | Gets or sets the fog color, the range of color values is from 0 to 1.
Public Property | FogEnabled | Gets or sets the fog enable flag.
Public Property | FogEnd | Gets or sets the maximum z value for fog, which ranges from 0 to 1.
Public Property | FogStart | Gets or sets the minimum z value for fog, which ranges from 0 to 1.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | Projection | Gets or sets the projection matrix.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)
Public Property | Texture | Gets or sets the current base texture.
Public Property | Texture2 | Gets or sets the current overlay texture.
Public Property | VertexColorEnabled | Gets or sets whether per-vertex color is enabled.
Public Property | View | Gets or sets the view matrix.
Public Property | World | Gets or sets the world matrix.

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a clone of the current DualTextureEffect instance.
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Computes derived parameter values immediately before applying the effect.

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

DualTextureEffect Class
Microsoft.Xna.Framework.Graphics Namespace


DualTextureEffect Constructor

DualTextureEffect Constructor

Creates a configurable effect that supports two-layer multitexturing.

Expand image Overload List

Name | Description
DualTextureEffect (DualTextureEffect) | Creates a new DualTextureEffect by cloning parameter settings from an existing instance.
DualTextureEffect (GraphicsDevice) | Creates a new DualTextureEffect with default parameter settings.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace


DualTextureEffect Constructor (DualTextureEffect)

DualTextureEffect Constructor (DualTextureEffect)
See Also
CollapseAll image

Creates a new DualTextureEffect by cloning parameter settings from an existing instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected DualTextureEffect (
         DualTextureEffect cloneSource
)

Parameters

cloneSource
The object to clone.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect Constructor (GraphicsDevice)

DualTextureEffect Constructor (GraphicsDevice)
See Also
CollapseAll image

Creates a new DualTextureEffect with default parameter settings.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DualTextureEffect (
         GraphicsDevice device
)

Parameters

device
The graphics device.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect Methods

DualTextureEffect Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a clone of the current DualTextureEffect instance.
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Computes derived parameter values immediately before applying the effect.

Expand image See Also

Reference

DualTextureEffect Class
Microsoft.Xna.Framework.Graphics Namespace


DualTextureEffect.Clone Method

DualTextureEffect.Clone Method

Creates a clone of the current DualTextureEffect instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override Effect Clone ()

Return Value

A cloned effect.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.OnApply Method

DualTextureEffect.OnApply Method

Computes derived parameter values immediately before applying the effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected internal override void OnApply ()

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect Properties

DualTextureEffect Properties

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | DiffuseColor | Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.
Public Property | FogColor | Gets or sets the fog color, the range of color values is from 0 to 1.
Public Property | FogEnabled | Gets or sets the fog enable flag.
Public Property | FogEnd | Gets or sets the maximum z value for fog, which ranges from 0 to 1.
Public Property | FogStart | Gets or sets the minimum z value for fog, which ranges from 0 to 1.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | Projection | Gets or sets the projection matrix.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)
Public Property | Texture | Gets or sets the current base texture.
Public Property | Texture2 | Gets or sets the current overlay texture.
Public Property | VertexColorEnabled | Gets or sets whether per-vertex color is enabled.
Public Property | View | Gets or sets the view matrix.
Public Property | World | Gets or sets the world matrix.

Expand image See Also

Reference

DualTextureEffect Class
Microsoft.Xna.Framework.Graphics Namespace


DualTextureEffect.Alpha Property

DualTextureEffect.Alpha Property

Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float Alpha { get; set; }

Property Value

The material alpha value.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.DiffuseColor Property

DualTextureEffect.DiffuseColor Property

Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 DiffuseColor { get; set; }

Property Value

The material diffuse color.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.FogColor Property

DualTextureEffect.FogColor Property

Gets or sets the fog color, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 FogColor { get; set; }

Property Value

The fog color.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.FogEnabled Property

DualTextureEffect.FogEnabled Property

Gets or sets the fog enable flag.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool FogEnabled { get; set; }

Property Value

The fog enable flag.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.FogEnd Property

DualTextureEffect.FogEnd Property

Gets or sets the maximum z value for fog, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogEnd { get; set; }

Property Value

The distance to stop adding fog.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.FogStart Property

DualTextureEffect.FogStart Property

Gets or sets the minimum z value for fog, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogStart { get; set; }

Property Value

The distance to begin adding fog.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.Projection Property

DualTextureEffect.Projection Property

Gets or sets the projection matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix Projection { get; set; }

Property Value

A matrix that contains the projection transform.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.Texture Property

DualTextureEffect.Texture Property

Gets or sets the current base texture.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture2D Texture { get; set; }

Property Value

The base texture.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.Texture2 Property

DualTextureEffect.Texture2 Property

Gets or sets the current overlay texture.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture2D Texture2 { get; set; }

Property Value

The overlay texture.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.VertexColorEnabled Property

DualTextureEffect.VertexColorEnabled Property

Gets or sets whether per-vertex color is enabled.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool VertexColorEnabled { get; set; }

Property Value

True to enable per-vertex color; false otherwise.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.View Property

DualTextureEffect.View Property

Gets or sets the view matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix View { get; set; }

Property Value

A matrix that contains a view transform.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect.World Property

DualTextureEffect.World Property

Gets or sets the world matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix World { get; set; }

Property Value

A matrix that contains a world transform.

Expand image See Also

Reference

DualTextureEffect Class
DualTextureEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DualTextureEffect Events

DualTextureEffect Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

DualTextureEffect Class
Microsoft.Xna.Framework.Graphics Namespace


DynamicIndexBuffer Class

DynamicIndexBuffer Class
See Also Members
CollapseAll image

Describes the rendering order of the vertices in a vertex buffer. Use DynamicIndexBuffer for storing indices for dynamic vertices and IndexBuffer for indices of non-dynamic arrays.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class DynamicIndexBuffer : IndexBuffer

Expand image Remarks

For more information on drawing with dynamic buffers, see DynamicVertexBuffer Class.

Expand image See Also

Reference

DynamicIndexBuffer Members
Indices
DrawUserIndexedPrimitives
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicIndexBuffer Members

DynamicIndexBuffer Members
See Also Constructors Events Methods Properties
CollapseAll image

The following tables list the members exposed by the DynamicIndexBuffer type.

Expand image Public Constructors

 | Name | Description
Public Method | DynamicIndexBuffer | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | BufferUsage | (Inherited from IndexBuffer.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IndexCount | (Inherited from IndexBuffer.)
Public Property | IndexElementSize | (Inherited from IndexBuffer.)
Public Property | IsContentLost | Determines if the index buffer data has been lost due to a lost device event.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | (Overloaded. Inherited from IndexBuffer.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Copies array data to the index buffer.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from IndexBuffer.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | ContentLost | Occurs when resources are lost due to a lost device event.
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

DynamicIndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


DynamicIndexBuffer Constructor

DynamicIndexBuffer Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
DynamicIndexBuffer (GraphicsDevice, IndexElementSize, Int32, BufferUsage) | Create a new instance of this class.
DynamicIndexBuffer (GraphicsDevice, Type, Int32, BufferUsage) | Create a new instance of this class.

Expand image See Also

Reference

DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


DynamicIndexBuffer Constructor (GraphicsDevice, IndexElementSize, Int32, BufferUsage)

DynamicIndexBuffer Constructor (GraphicsDevice, IndexElementSize, Int32, BufferUsage)
See Also
CollapseAll image

Create a new instance of this class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DynamicIndexBuffer (
         GraphicsDevice graphicsDevice,
         IndexElementSize indexElementSize,
         int indexCount,
         BufferUsage usage
)

Parameters

graphicsDevice
The associated graphics device.
indexElementSize
Size of each index element.
indexCount
Number of indices in the buffer.
usage
Behavior options.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | graphicsDevice is null.
ArgumentOutOfRangeException | The elementCount parameter is invalid. It must be greater than zero, and the index must be sixteen or thirty-two bits in length. Index buffers can only be created for indices that are sixteen or thirty-two bits in length.
InvalidOperationException | This resource could not be created.
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes.

Expand image See Also

Reference

DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicIndexBuffer Constructor (GraphicsDevice, Type, Int32, BufferUsage)

DynamicIndexBuffer Constructor (GraphicsDevice, Type, Int32, BufferUsage)
See Also
CollapseAll image

Create a new instance of this class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DynamicIndexBuffer (
         GraphicsDevice graphicsDevice,
         Type indexType,
         int indexCount,
         BufferUsage usage
)

Parameters

graphicsDevice
The associated graphics device.
indexType
The index type.
indexCount
The number of indicies in the buffer.
usage
Behavior options.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | graphicsDevice is null.
ArgumentOutOfRangeException | The elementCount parameter is invalid. It must be greater than zero, and the index must be sixteen or thirty-two bits in length. Index buffers can only be created for indices that are sixteen or thirty-two bits in length.
InvalidOperationException | This resource could not be created.
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes.

Expand image See Also

Reference

DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicIndexBuffer Methods

DynamicIndexBuffer Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | (Overloaded. Inherited from IndexBuffer.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Copies array data to the index buffer.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from IndexBuffer.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DynamicIndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


DynamicIndexBuffer.SetData Method

DynamicIndexBuffer.SetData Method

Copies array data to the index buffer.

Expand image Overload List

Name | Description
DynamicIndexBuffer.SetData (Int32, T[], Int32, Int32, SetDataOptions) | Sets dynamic index buffer data, specifying the offset, start index, number of elements and options.
DynamicIndexBuffer.SetData (T[], Int32, Int32, SetDataOptions) | Sets dynamic index buffer data, specifying the start index, number of elements and options.

Expand image See Also

Reference

DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


DynamicIndexBuffer.SetData Generic Method (Int32, T[], Int32, Int32, SetDataOptions)

DynamicIndexBuffer.SetData Generic Method (Int32, T[], Int32, Int32, SetDataOptions)
See Also
CollapseAll image

Sets dynamic index buffer data, specifying the offset, start index, number of elements and options.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         int offsetInBytes,
         T[] data,
         int startIndex,
         int elementCount,
         SetDataOptions options
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

offsetInBytes
Offset in bytes from the beginning of the buffer to the data.
data
Array of data.
startIndex
The first element to use.
elementCount
The number of elements to use.
options
Specifies whether existing data in the buffer will be kept after this operation. Dynamic geometry may be rendered on the Xbox 360 by using DrawUserIndexedPrimitives instead of setting the data for the index buffer.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicIndexBuffer.SetData Generic Method (T[], Int32, Int32, SetDataOptions)

DynamicIndexBuffer.SetData Generic Method (T[], Int32, Int32, SetDataOptions)
See Also
CollapseAll image

Sets dynamic index buffer data, specifying the start index, number of elements and options.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         T[] data,
         int startIndex,
         int elementCount,
         SetDataOptions options
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.
startIndex
The first element to use.
elementCount
The number of elements to use.
options
Specifies whether existing data in the buffer will be kept after this operation. Dynamic geometry may be rendered on the Xbox 360 by using DrawUserIndexedPrimitives instead of setting the data for the index buffer.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicIndexBuffer Properties

DynamicIndexBuffer Properties

Expand image Public Properties

 | Name | Description
Public Property | BufferUsage | (Inherited from IndexBuffer.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IndexCount | (Inherited from IndexBuffer.)
Public Property | IndexElementSize | (Inherited from IndexBuffer.)
Public Property | IsContentLost | Determines if the index buffer data has been lost due to a lost device event.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image See Also

Reference

DynamicIndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


DynamicIndexBuffer.IsContentLost Property

DynamicIndexBuffer.IsContentLost Property

Determines if the index buffer data has been lost due to a lost device event.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsContentLost { get; }

Property Value

true if the content was lost; false otherwise.

Expand image See Also

Reference

DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicIndexBuffer Events

DynamicIndexBuffer Events

Expand image Public Events

 | Name | Description
Public Event | ContentLost | Occurs when resources are lost due to a lost device event.
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

DynamicIndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


DynamicIndexBuffer.ContentLost Event

DynamicIndexBuffer.ContentLost Event

Occurs when resources are lost due to a lost device event.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public virtual event EventHandler<EventArgs> ContentLost

Expand image Remarks

When this event occurs, the IsContentLost property, of the index buffer, is set to true.

Expand image See Also

Reference

DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicVertexBuffer Class

DynamicVertexBuffer Class
See Also Members
CollapseAll image

Represents a list of 3D vertices to be streamed to the graphics device. Use DynamicVertexBuffer for dynamic vertex arrays and VertexBuffer for non-dynamic vertex arrays.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class DynamicVertexBuffer : VertexBuffer

Expand image Remarks

In situations where your game frequently modifies a vertex buffer, it is recommended that the buffer be instantiated or derived from DynamicVertexBuffer instead of the VertexBuffer class. DynamicVertexBuffer is optimized for frequent vertex data modification. However, to fully maximize the benefits of this class, your data must be restored after any occurrence of a ContentLost event. This event occurs whenever the related graphics device is lost. After resetting the graphics device and restoring any static resources, the ContentLost event handler is then called. Calling SetData inside this handler restores any dynamic resource data.

You can declare the event handler after constructing your dynamic vertex buffer. For example, the following code sample first constructs a dynamic vertex buffer (called vertexBuffer), declares a ContentLost event handler (called vertexBuffer_ContentLost). The final step initializes the data with a call to SetData. This is necessary for correct restoration of any existing particles after a lost device event.

      vertexBuffer = new DynamicVertexBuffer(GraphicsDevice, size, BufferUsage.Points);
      vertexBuffer.ContentLost += new EventHandler(vertexBuffer_ContentLost);
      vertexBuffer.SetData(particles);

Expand image See Also

Reference

DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicVertexBuffer Members

DynamicVertexBuffer Members
See Also Constructors Events Methods Properties
CollapseAll image

The following tables list the members exposed by the DynamicVertexBuffer type.

Expand image Public Constructors

 | Name | Description
Public Method | DynamicVertexBuffer | Overloaded. Creates an instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | BufferUsage | (Inherited from VertexBuffer.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsContentLost | Determines if the index buffer data has been lost due to a lost device event.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | VertexCount | (Inherited from VertexBuffer.)
Public Property | VertexDeclaration | (Inherited from VertexBuffer.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | (Overloaded. Inherited from VertexBuffer.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Copies array data to the vertex buffer.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from VertexBuffer.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | ContentLost | Occurs when resources are lost due to a lost device event.
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

DynamicVertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


DynamicVertexBuffer Constructor

DynamicVertexBuffer Constructor

Creates an instance of this object.

Expand image Overload List

Name | Description
DynamicVertexBuffer (GraphicsDevice, Type, Int32, BufferUsage) | Creates a new instance of this object.
DynamicVertexBuffer (GraphicsDevice, VertexDeclaration, Int32, BufferUsage) | Creates a new instance of this object.

Expand image See Also

Reference

DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


DynamicVertexBuffer Constructor (GraphicsDevice, Type, Int32, BufferUsage)

DynamicVertexBuffer Constructor (GraphicsDevice, Type, Int32, BufferUsage)
See Also
CollapseAll image

Creates a new instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DynamicVertexBuffer (
         GraphicsDevice graphicsDevice,
         Type vertexType,
         int vertexCount,
         BufferUsage usage
)

Parameters

graphicsDevice
The graphics device.
vertexType
The data type.
vertexCount
The number of vertices.
usage
Behavior options; it is good practice for this to match the createOptions parameter in the GraphicsDevice constructor.

Expand image See Also

Reference

DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicVertexBuffer Constructor (GraphicsDevice, VertexDeclaration, Int32, BufferUsage)

DynamicVertexBuffer Constructor (GraphicsDevice, VertexDeclaration, Int32, BufferUsage)
See Also
CollapseAll image

Creates a new instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DynamicVertexBuffer (
         GraphicsDevice graphicsDevice,
         VertexDeclaration vertexDeclaration,
         int vertexCount,
         BufferUsage usage
)

Parameters

graphicsDevice
The graphics device.
vertexDeclaration
The vertex declaration, which describes per-vertex data.
vertexCount
The number of vertices.
usage
Behavior options; it is good practice for this to match the createOptions parameter in the GraphicsDevice constructor.

Expand image See Also

Reference

DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicVertexBuffer Methods

DynamicVertexBuffer Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | (Overloaded. Inherited from VertexBuffer.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Copies array data to the vertex buffer.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from VertexBuffer.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

DynamicVertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


DynamicVertexBuffer.SetData Method

DynamicVertexBuffer.SetData Method

Copies array data to the vertex buffer.

Expand image Overload List

Name | Description
DynamicVertexBuffer.SetData (Int32, T[], Int32, Int32, Int32, SetDataOptions) | Sets dynamic vertex buffer data, specifying the offset, start index, number of elements and vertex stride.
DynamicVertexBuffer.SetData (T[], Int32, Int32, SetDataOptions) | Sets dynamic vertex buffer data, specifying the start index, number of elements and options.

Expand image See Also

Reference

DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


DynamicVertexBuffer.SetData Generic Method (Int32, T[], Int32, Int32, Int32, SetDataOptions)

DynamicVertexBuffer.SetData Generic Method (Int32, T[], Int32, Int32, Int32, SetDataOptions)
See Also
CollapseAll image

Sets dynamic vertex buffer data, specifying the offset, start index, number of elements and vertex stride.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         int offsetInBytes,
         T[] data,
         int startIndex,
         int elementCount,
         int vertexStride,
         SetDataOptions options
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

offsetInBytes
Offset in bytes from the beginning of the buffer to the data.
data
Array of data.
startIndex
The first element to use.
elementCount
The number of elements to use.
vertexStride
The size, in bytes, of the elements in the vertex buffer.
options
Specifies whether existing data in the buffer will be kept after this operation. Dynamic geometry may be rendered on the Xbox 360 by using DrawUserIndexedPrimitives instead of setting the data for the vertex buffer.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicVertexBuffer.SetData Generic Method (T[], Int32, Int32, SetDataOptions)

DynamicVertexBuffer.SetData Generic Method (T[], Int32, Int32, SetDataOptions)
See Also
CollapseAll image

Sets dynamic vertex buffer data, specifying the start index, number of elements and options.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         T[] data,
         int startIndex,
         int elementCount,
         SetDataOptions options
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.
startIndex
The first element to use.
elementCount
The number of elements to use.
options
Specifies whether existing data in the buffer will be kept after this operation. Dynamic geometry may be rendered on the Xbox 360 by using DrawUserIndexedPrimitives instead of setting the data for the vertex buffer.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicVertexBuffer Properties

DynamicVertexBuffer Properties

Expand image Public Properties

 | Name | Description
Public Property | BufferUsage | (Inherited from VertexBuffer.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsContentLost | Determines if the index buffer data has been lost due to a lost device event.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | VertexCount | (Inherited from VertexBuffer.)
Public Property | VertexDeclaration | (Inherited from VertexBuffer.)

Expand image See Also

Reference

DynamicVertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


DynamicVertexBuffer.IsContentLost Property

DynamicVertexBuffer.IsContentLost Property

Determines if the index buffer data has been lost due to a lost device event.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsContentLost { get; }

Property Value

true if the content was lost; false otherwise.

Expand image See Also

Reference

DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


DynamicVertexBuffer Events

DynamicVertexBuffer Events

Expand image Public Events

 | Name | Description
Public Event | ContentLost | Occurs when resources are lost due to a lost device event.
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

DynamicVertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


DynamicVertexBuffer.ContentLost Event

DynamicVertexBuffer.ContentLost Event

Occurs when resources are lost due to a lost device event.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public virtual event EventHandler<EventArgs> ContentLost

When this event occurs, the IsContentLost property, of the vertex buffer, is set to true.

Expand image See Also

Reference

DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Effect Class

Effect Class
See Also Members
CollapseAll image

Used to set and query effects, and to choose techniques.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class Effect : GraphicsResource

Expand image See Also

Concepts

Shader Content Catalog at XNA Creators Club Online

Reference

Effect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Effect Members

Effect Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the Effect type.

Expand image Public Constructors

 | Name | Description
Public Method | Effect | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | CurrentTechnique | Gets or sets the active technique.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | Gets a collection of parameters used for this effect.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | Gets a collection of techniques that are defined for this effect.

Expand image Public Methods

 | Name | Description
Public Method | Clone | Copies data from an existing object to this object.
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Applies the effect state just prior to rendering the effect.

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

Effect Class
Microsoft.Xna.Framework.Graphics Namespace


Effect Constructor

Effect Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
Effect (Effect) | Creates an instance of this object.
Effect (GraphicsDevice, Byte[]) | Creates an instance of this object.
Tip
In most cases, it is preferrable to initialize a new instance of an effect using the ContentManager.Load<Effect> method rather than using the Effect constructors.

Expand image See Also

Concepts

Shader Content Catalog at XNA Creators Club Online

Reference

Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace


Effect Constructor (Effect)

Effect Constructor (Effect)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected Effect (
         Effect cloneSource
)

Parameters

cloneSource
An object to copy.

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Effect Constructor (GraphicsDevice, Byte[])

Effect Constructor (GraphicsDevice, Byte[])
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Effect (
         GraphicsDevice graphicsDevice,
         byte[] effectCode
)

Parameters

graphicsDevice
The device.
effectCode
The effect code.

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Effect Methods

Effect Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Copies data from an existing object to this object.
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Applies the effect state just prior to rendering the effect.

Expand image See Also

Reference

Effect Class
Microsoft.Xna.Framework.Graphics Namespace


Effect.Clone Method

Effect.Clone Method

Copies data from an existing object to this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public virtual Effect Clone ()

Return Value

The cloned effect.

Expand image See Also

Reference

Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Effect.Dispose Method

Effect.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
Effect.Dispose (Boolean) | Releases the unmanaged resources used by the Effect and optionally releases the managed resources.

Expand image See Also

Reference

Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace


Effect.Dispose Method (Boolean)

Effect.Dispose Method (Boolean)
See Also
CollapseAll image

Releases the unmanaged resources used by the Effect and optionally releases the managed resources.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image Remarks

This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.

When the disposing parameter is true, this method releases all resources held by any managed objects that this Effect references. This method invokes the Dispose method of each referenced object.

Note

Notes to Inheritors

Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects disposed of in an earlier call to Dispose.

Expand image See Also

Reference

Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Effect.OnApply Method

Effect.OnApply Method

Applies the effect state just prior to rendering the effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected internal virtual void OnApply ()

Expand image See Also

Reference

Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Effect Properties

Effect Properties

Expand image Public Properties

 | Name | Description
Public Property | CurrentTechnique | Gets or sets the active technique.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | Gets a collection of parameters used for this effect.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | Gets a collection of techniques that are defined for this effect.

Expand image See Also

Reference

Effect Class
Microsoft.Xna.Framework.Graphics Namespace


Effect.CurrentTechnique Property

Effect.CurrentTechnique Property
See Also Example
CollapseAll image

Gets or sets the active technique.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectTechnique CurrentTechnique { get; set; }

Property Value

The current technique.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | CurrentTechnique is null. CurrentTechnique cannot be null.

Expand image Remarks

If there are multiple techiques in an effect and you want to use a new technique in the next pass, you must set CurrentTechnique to the new technique before making the rendering pass.

Note
The BasicEffect class, which is derived from Effect and inherits the Techniques collection, contains only one available technique to set as the active technique. The active technique applies the settings that have been set as the properties of the BasicEffect.

Expand image Example

effect.CurrentTechnique = effect.Techniques["TransformTechnique"];

Expand image See Also

Reference

Effect.Techniques Property
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Effect.Parameters Property

Effect.Parameters Property

Gets a collection of parameters used for this effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectParameterCollection Parameters { get; }

Property Value

The collection of parameters used for this effect.

Expand image See Also

Reference

Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Effect.Techniques Property

Effect.Techniques Property
See Also Example
CollapseAll image

Gets a collection of techniques that are defined for this effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectTechniqueCollection Techniques { get; }

Property Value

A collection of techniques that are defined for this effect.

Expand image Remarks

Note
The BasicEffect class, which is derived from Effect and inherits the Techniques collection, contains only one available technique which will apply the settings which have been set as the properties of the BasicEffect.

Expand image Example

Expand image See Also

Reference

Effect.CurrentTechnique Property
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation Class

EffectAnnotation Class
See Also Members
CollapseAll image

Represents an annotation to an EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class EffectAnnotation

Expand image See Also

Reference

EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation Members

EffectAnnotation Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the EffectAnnotation type.

Expand image Public Properties

 | Name | Description
Public Property | ColumnCount | Gets the number of columns in this effect annotation.
Public Property | Name | Gets the name of the effect annotation.
Public Property | ParameterClass | Gets the parameter class of this effect annotation.
Public Property | ParameterType | Gets the parameter type of this effect annotation.
Public Property | RowCount | Gets the row count of this effect annotation.
Public Property | Semantic | Gets the semantic of this effect annotation.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetValueBoolean | Gets the value of the EffectAnnotation as a Boolean.
Public Method | GetValueInt32 | Gets the value of the EffectAnnotation as a Int32.
Public Method | GetValueMatrix | Gets the value of the EffectAnnotation as a Int32.
Public Method | GetValueSingle | Gets the value of the EffectAnnotation as a Single.
Public Method | GetValueString | Gets the value of the EffectAnnotation as a String.
Public Method | GetValueVector2 | Gets the value of the EffectAnnotation as a Vector2.
Public Method | GetValueVector3 | Gets the value of the EffectAnnotation as a Vector3.
Public Method | GetValueVector4 | Gets the value of the EffectAnnotation as a Vector4.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectAnnotation Class
Microsoft.Xna.Framework.Graphics Namespace


EffectAnnotation Methods

EffectAnnotation Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetValueBoolean | Gets the value of the EffectAnnotation as a Boolean.
Public Method | GetValueInt32 | Gets the value of the EffectAnnotation as a Int32.
Public Method | GetValueMatrix | Gets the value of the EffectAnnotation as a Int32.
Public Method | GetValueSingle | Gets the value of the EffectAnnotation as a Single.
Public Method | GetValueString | Gets the value of the EffectAnnotation as a String.
Public Method | GetValueVector2 | Gets the value of the EffectAnnotation as a Vector2.
Public Method | GetValueVector3 | Gets the value of the EffectAnnotation as a Vector3.
Public Method | GetValueVector4 | Gets the value of the EffectAnnotation as a Vector4.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectAnnotation Class
Microsoft.Xna.Framework.Graphics Namespace


EffectAnnotation.GetValueBoolean Method

EffectAnnotation.GetValueBoolean Method

Gets the value of the EffectAnnotation as a Boolean.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool GetValueBoolean ()

Return Value

The value of the EffectAnnotation as a Boolean.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.GetValueInt32 Method

EffectAnnotation.GetValueInt32 Method

Gets the value of the EffectAnnotation as a Int32.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int GetValueInt32 ()

Return Value

The value of the EffectAnnotation as a Int32.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.GetValueMatrix Method

EffectAnnotation.GetValueMatrix Method

Gets the value of the EffectAnnotation as a Int32.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix GetValueMatrix ()

Return Value

The value of the EffectAnnotation as a Int32.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.GetValueSingle Method

EffectAnnotation.GetValueSingle Method

Gets the value of the EffectAnnotation as a Single.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float GetValueSingle ()

Return Value

The value of the EffectAnnotation as a Single.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.GetValueString Method

EffectAnnotation.GetValueString Method

Gets the value of the EffectAnnotation as a String.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string GetValueString ()

Return Value

The value of the EffectAnnotation as a String.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.GetValueVector2 Method

EffectAnnotation.GetValueVector2 Method

Gets the value of the EffectAnnotation as a Vector2.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector2 GetValueVector2 ()

Return Value

The value of the EffectAnnotation as a Vector2.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.GetValueVector3 Method

EffectAnnotation.GetValueVector3 Method

Gets the value of the EffectAnnotation as a Vector3.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 GetValueVector3 ()

Return Value

The value of the EffectAnnotation as a Vector3.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.GetValueVector4 Method

EffectAnnotation.GetValueVector4 Method

Gets the value of the EffectAnnotation as a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector4 GetValueVector4 ()

Return Value

The value of the EffectAnnotation as a Vector4.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation Properties

EffectAnnotation Properties

Expand image Public Properties

 | Name | Description
Public Property | ColumnCount | Gets the number of columns in this effect annotation.
Public Property | Name | Gets the name of the effect annotation.
Public Property | ParameterClass | Gets the parameter class of this effect annotation.
Public Property | ParameterType | Gets the parameter type of this effect annotation.
Public Property | RowCount | Gets the row count of this effect annotation.
Public Property | Semantic | Gets the semantic of this effect annotation.

Expand image See Also

Reference

EffectAnnotation Class
Microsoft.Xna.Framework.Graphics Namespace


EffectAnnotation.ColumnCount Property

EffectAnnotation.ColumnCount Property

Gets the number of columns in this effect annotation.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int ColumnCount { get; }

Property Value

The number of columns in this effect annotation.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.Name Property

EffectAnnotation.Name Property

Gets the name of the effect annotation.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of the effect annotation.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.ParameterClass Property

EffectAnnotation.ParameterClass Property

Gets the parameter class of this effect annotation.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectParameterClass ParameterClass { get; }

Property Value

The parameter class of this effect annotation.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.ParameterType Property

EffectAnnotation.ParameterType Property

Gets the parameter type of this effect annotation.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectParameterType ParameterType { get; }

Property Value

The parameter type of this effect annotation.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.RowCount Property

EffectAnnotation.RowCount Property

Gets the row count of this effect annotation.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int RowCount { get; }

Property Value

The row count of this effect annotation.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotation.Semantic Property

EffectAnnotation.Semantic Property

Gets the semantic of this effect annotation.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Semantic { get; }

Property Value

The semantic of this effect annotation.

Expand image See Also

Reference

EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotationCollection Class

EffectAnnotationCollection Class
See Also Members
CollapseAll image

Manipulates a collection of EffectAnnotation objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class EffectAnnotationCollection : IEnumerable<EffectAnnotation>

Expand image See Also

Reference

EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotationCollection Members

EffectAnnotationCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the EffectAnnotationCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of EffectAnnotation objects in this EffectAnnotationCollection.
Public Property | Item | Overloaded. Gets an EffectAnnotation object.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through the EffectAnnotationCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator that can iterate through the EffectAnnotationCollection.
Explicit Interface Implementation | System.Collections.Generic.IEnumerable{T}.GetEnumerator | Gets an enumerator that can iterate through the EffectAnnotationCollection.

Expand image See Also

Reference

EffectAnnotationCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectAnnotationCollection Methods

EffectAnnotationCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through the EffectAnnotationCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator that can iterate through the EffectAnnotationCollection.
Explicit Interface Implementation | System.Collections.Generic.IEnumerable{T}.GetEnumerator | Gets an enumerator that can iterate through the EffectAnnotationCollection.

Expand image See Also

Reference

EffectAnnotationCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectAnnotationCollection.GetEnumerator Method

EffectAnnotationCollection.GetEnumerator Method

Gets an enumerator that can iterate through the EffectAnnotationCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Enumerator<EffectAnnotation> GetEnumerator ()

Return Value

Enumerator for the EffectAnnotationCollection.

Expand image See Also

Reference

EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.IEnumerable{T}.GetEnumerator Method

System.Collections.Generic.IEnumerable{T}.GetEnumerator Method
See Also
CollapseAll image

Gets an enumerator that can iterate through the EffectAnnotationCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private IEnumerator<EffectAnnotation> System.Collections.Generic.IEnumerable{T}.GetEnumerator ()

Return Value

Enumerator for the EffectAnnotationCollection.

Expand image See Also

Reference

EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Gets an enumerator that can iterate through the EffectAnnotationCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

Enumerator for the EffectAnnotationCollection.

Expand image See Also

Reference

EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotationCollection Properties

EffectAnnotationCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of EffectAnnotation objects in this EffectAnnotationCollection.
Public Property | Item | Overloaded. Gets an EffectAnnotation object.

Expand image See Also

Reference

EffectAnnotationCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectAnnotationCollection.Count Property

EffectAnnotationCollection.Count Property

Gets the number of EffectAnnotation objects in this EffectAnnotationCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

The number of EffectAnnotation objects in this EffectAnnotationCollection.

Expand image See Also

Reference

EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotationCollection.Item Property

EffectAnnotationCollection.Item Property

Gets an EffectAnnotation object.

Expand image Overload List

Name | Description
EffectAnnotationCollection.Item (Int32) | Gets a specific EffectAnnotation object by using an index value.
EffectAnnotationCollection.Item (String) | Gets a specific EffectAnnotation object by using a name.

Expand image See Also

Reference

EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace


EffectAnnotationCollection.Item Property (Int32)

EffectAnnotationCollection.Item Property (Int32)
See Also
CollapseAll image

Gets a specific EffectAnnotation object by using an index value.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectAnnotation this [
         int index
] { get; }

Property Value

The EffectAnnotation object at index index.

Expand image See Also

Reference

EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectAnnotationCollection.Item Property (String)

EffectAnnotationCollection.Item Property (String)
See Also
CollapseAll image

Gets a specific EffectAnnotation object by using a name.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectAnnotation this [
         string name
] { get; }

Property Value

The EffectAnnotation object named name.

Expand image See Also

Reference

EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectMaterial Class

EffectMaterial Class
See Also Members
CollapseAll image

Contains an effect subclass which is used to load data for an EffectMaterialContent type.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class EffectMaterial : Effect

Expand image Remarks

For most purposes, this type can be ignored, and treated exactly like a regular effect. When an EffectMaterial type is loaded from .xnb format, its parameter values and textures are also loaded and automatically set on the effect, in addition to the HLSL shader code. Use this class to write a content pipeline extension to store materials inside a custom data type.

Expand image See Also

Reference

EffectMaterial Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectMaterial Members

EffectMaterial Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the EffectMaterial type.

Expand image Public Constructors

 | Name | Description
Public Method | EffectMaterial | Creates an instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)

Expand image Public Methods

 | Name | Description
Public Method | Clone | (Inherited from Effect.)
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

EffectMaterial Class
Microsoft.Xna.Framework.Graphics Namespace


EffectMaterial Constructor

EffectMaterial Constructor

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectMaterial (
         Effect cloneSource
)

Parameters

cloneSource
An instance of an object to copy initialization data from.

Expand image See Also

Reference

EffectMaterial Class
EffectMaterial Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter Class

EffectParameter Class
See Also Members Example
CollapseAll image

Represents an Effect parameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class EffectParameter

Expand image Remarks

Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.

Expand image Example

To use a EffectParameter you must:

  1. Create a EffectParameter for each parameter in your Effect that you will be setting in Draw or Update.

    C#
    public EffectParameter mWorld;
public EffectParameter mCameraView;
public EffectParameter CameraPos;
public EffectParameter mCameraProj;

  2. Assign an Effect parameter to your EffectParameter.

    C#
    mWorld = effect.Parameters["g_mWorld"];
mCameraView = effect.Parameters["g_mCameraView"];
CameraPos = effect.Parameters["g_CameraPos"];
mCameraProj = effect.Parameters["g_mCameraProj"];

  3. Call SetValue on your EffectParameter to change the parameter value.

    C#
    MyEffect.CameraPos.SetValue(CameraPos);
MyEffect.mCameraView.SetValue(view);
MyEffect.mCameraProj.SetValue(projection);
MyEffect.LightPos.SetValue(LightPos);
MyEffect.mLightView.SetValue(Matrix.CreateLookAt(LightPos,
    bounds.Center, Vector3.Up));

Expand image See Also

Reference

EffectParameter Members
Effect.Parameters
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter Members

EffectParameter Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the EffectParameter type.

Expand image Public Properties

 | Name | Description
Public Property | Annotations | Gets the collection of EffectAnnotation objects for this parameter.
Public Property | ColumnCount | Gets the number of columns in the parameter description.
Public Property | Elements | Gets the collection of effect parameters.
Public Property | Name | Gets the name of the parameter.
Public Property | ParameterClass | Gets the class of the parameter.
Public Property | ParameterType | Gets the type of the parameter.
Public Property | RowCount | Gets the number of rows in the parameter description.
Public Property | Semantic | Gets the semantic meaning, or usage, of the parameter.
Public Property | StructureMembers | Gets the collection of structure members.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetValueBoolean | Gets the value of the EffectParameter as a Boolean.
Public Method | GetValueBooleanArray | Gets the value of the EffectParameter as an array of Boolean.
Public Method | GetValueInt32 | Gets the value of the EffectParameter as an Int32.
Public Method | GetValueInt32Array | Gets the value of the EffectParameter as an array of Int32.
Public Method | GetValueMatrix | Gets the value of the EffectParameter as a Matrix.
Public Method | GetValueMatrixArray | Gets the value of the EffectParameter as an array of Matrix.
Public Method | GetValueMatrixTranspose | Gets the value of the EffectParameter as a Matrix transpose.
Public Method | GetValueMatrixTransposeArray | Gets the value of the EffectParameter as an array of Matrix transpose.
Public Method | GetValueQuaternion | Gets the value of the EffectParameter as a Quaternion.
Public Method | GetValueQuaternionArray | Gets the value of the EffectParameter as an array of Quaternion.
Public Method | GetValueSingle | Gets the value of the EffectParameter as a Single.
Public Method | GetValueSingleArray | Gets the value of the EffectParameter as an array of Single.
Public Method | GetValueString | Gets the value of the EffectParameter as an String.
Public Method | GetValueTexture2D | Gets the value of the EffectParameter as a Texture2D.
Public Method | GetValueTexture3D | Gets the value of the EffectParameter as a Texture3D.
Public Method | GetValueTextureCube | Gets the value of the EffectParameter as a TextureCube.
Public Method | GetValueVector2 | Gets the value of the EffectParameter as a Vector2.
Public Method | GetValueVector2Array | Gets the value of the EffectParameter as an array of Vector2.
Public Method | GetValueVector3 | Gets the value of the EffectParameter as a Vector3.
Public Method | GetValueVector3Array | Gets the value of the EffectParameter as an array of Vector3.
Public Method | GetValueVector4 | Gets the value of the EffectParameter as a Vector4.
Public Method | GetValueVector4Array | Gets the value of the EffectParameter as an array of Vector4.
Public Method | SetValue | Overloaded. Sets the value of the EffectParameter.
Public Method | SetValueTranspose | Overloaded. Sets the value of the EffectParameter.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectParameter Class
Microsoft.Xna.Framework.Graphics Namespace


EffectParameter Methods

EffectParameter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetValueBoolean | Gets the value of the EffectParameter as a Boolean.
Public Method | GetValueBooleanArray | Gets the value of the EffectParameter as an array of Boolean.
Public Method | GetValueInt32 | Gets the value of the EffectParameter as an Int32.
Public Method | GetValueInt32Array | Gets the value of the EffectParameter as an array of Int32.
Public Method | GetValueMatrix | Gets the value of the EffectParameter as a Matrix.
Public Method | GetValueMatrixArray | Gets the value of the EffectParameter as an array of Matrix.
Public Method | GetValueMatrixTranspose | Gets the value of the EffectParameter as a Matrix transpose.
Public Method | GetValueMatrixTransposeArray | Gets the value of the EffectParameter as an array of Matrix transpose.
Public Method | GetValueQuaternion | Gets the value of the EffectParameter as a Quaternion.
Public Method | GetValueQuaternionArray | Gets the value of the EffectParameter as an array of Quaternion.
Public Method | GetValueSingle | Gets the value of the EffectParameter as a Single.
Public Method | GetValueSingleArray | Gets the value of the EffectParameter as an array of Single.
Public Method | GetValueString | Gets the value of the EffectParameter as an String.
Public Method | GetValueTexture2D | Gets the value of the EffectParameter as a Texture2D.
Public Method | GetValueTexture3D | Gets the value of the EffectParameter as a Texture3D.
Public Method | GetValueTextureCube | Gets the value of the EffectParameter as a TextureCube.
Public Method | GetValueVector2 | Gets the value of the EffectParameter as a Vector2.
Public Method | GetValueVector2Array | Gets the value of the EffectParameter as an array of Vector2.
Public Method | GetValueVector3 | Gets the value of the EffectParameter as a Vector3.
Public Method | GetValueVector3Array | Gets the value of the EffectParameter as an array of Vector3.
Public Method | GetValueVector4 | Gets the value of the EffectParameter as a Vector4.
Public Method | GetValueVector4Array | Gets the value of the EffectParameter as an array of Vector4.
Public Method | SetValue | Overloaded. Sets the value of the EffectParameter.
Public Method | SetValueTranspose | Overloaded. Sets the value of the EffectParameter.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectParameter Class
Microsoft.Xna.Framework.Graphics Namespace


EffectParameter.GetValueBoolean Method

EffectParameter.GetValueBoolean Method

Gets the value of the EffectParameter as a Boolean.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool GetValueBoolean ()

Return Value

The value of the EffectParameter as a Boolean.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Boolean.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueBooleanArray Method

EffectParameter.GetValueBooleanArray Method

Gets the value of the EffectParameter as an array of Boolean.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool[] GetValueBooleanArray (
         int count
)

Parameters

count
The number of elements in the array.

Return Value

The value of the EffectParameter as an array of Boolean.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | When attempting to call GetValueBooleanArray which returns an array, you must request that at least one member be returned.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueInt32 Method

EffectParameter.GetValueInt32 Method

Gets the value of the EffectParameter as an Int32.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int GetValueInt32 ()

Return Value

Gets the value of the EffectParameter as an Int32.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Int32.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueInt32Array Method

EffectParameter.GetValueInt32Array Method

Gets the value of the EffectParameter as an array of Int32.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int[] GetValueInt32Array (
         int count
)

Parameters

count
The number of elements in the array.

Return Value

The value of the EffectParameter as an array of Int32.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | When attempting to call GetValueInt32Array which returns an array, you must request that at least one member be returned.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueMatrix Method

EffectParameter.GetValueMatrix Method

Gets the value of the EffectParameter as a Matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix GetValueMatrix ()

Return Value

The value of the EffectParameter as a Matrix.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Matrix.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueMatrixArray Method

EffectParameter.GetValueMatrixArray Method

Gets the value of the EffectParameter as an array of Matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix[] GetValueMatrixArray (
         int count
)

Parameters

count
The number of elements in the array.

Return Value

The value of the EffectParameter as an array of Matrix.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | When attempting to call GetValueMatrixArray which returns an array, you must request that at least one member be returned.
InvalidCastException | Unable to cast this EffectParameter to an array of type Matrix.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueMatrixTranspose Method

EffectParameter.GetValueMatrixTranspose Method

Gets the value of the EffectParameter as a Matrix transpose.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix GetValueMatrixTranspose ()

Return Value

The value of the EffectParameter as a Matrix transpose.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Matrix.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueMatrixTransposeArray Method

EffectParameter.GetValueMatrixTransposeArray Method

Gets the value of the EffectParameter as an array of Matrix transpose.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix[] GetValueMatrixTransposeArray (
         int count
)

Parameters

count
The number of elements in the array.

Return Value

The value of the EffectParameter as an array of Matrix transpose.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | count is less than or equal to zero. count must be greater than our equal to one.
InvalidCastException | Unable to cast this EffectParameter to an array of type Matrix.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueQuaternion Method

EffectParameter.GetValueQuaternion Method

Gets the value of the EffectParameter as a Quaternion.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Quaternion GetValueQuaternion ()

Return Value

The value of the EffectParameter as a Quaternion.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Quaternion.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueQuaternionArray Method

EffectParameter.GetValueQuaternionArray Method

Gets the value of the EffectParameter as an array of Quaternion.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Quaternion[] GetValueQuaternionArray (
         int count
)

Parameters

count
The number of elements in the array.

Return Value

The value of the EffectParameter as an array of Quaternion.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | count is less than or equal to zero. count must be greater than or equal to one.
InvalidCastException | Unable to cast this EffectParameter to an array of type Quaternion.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueSingle Method

EffectParameter.GetValueSingle Method

Gets the value of the EffectParameter as a Single.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float GetValueSingle ()

Return Value

The value of the EffectParameter as a Single.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Single.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueSingleArray Method

EffectParameter.GetValueSingleArray Method

Gets the value of the EffectParameter as an array of Single.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float[] GetValueSingleArray (
         int count
)

Parameters

count
The number of elements in the array.

Return Value

The value of the EffectParameter as an array of Single.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | count is less than or equal to zero. count must be greater than or equal to one.
InvalidCastException | Unable to cast this EffectParameter to an array of type Single.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueString Method

EffectParameter.GetValueString Method

Gets the value of the EffectParameter as an String.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string GetValueString ()

Return Value

The value of the EffectParameter as an String.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type String.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueTexture2D Method

EffectParameter.GetValueTexture2D Method

Gets the value of the EffectParameter as a Texture2D.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture2D GetValueTexture2D ()

Return Value

The value of the EffectParameter as a Texture2D.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The resource is not of type Texture2D.
InvalidCastException | Unable to cast this EffectParameter to type Texture2D.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueTexture3D Method

EffectParameter.GetValueTexture3D Method

Gets the value of the EffectParameter as a Texture3D.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture3D GetValueTexture3D ()

Return Value

The value of the EffectParameter as a Texture3D.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The resource is not of type Texture3D.
InvalidCastException | Unable to cast this EffectParameter to type Texture3D.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueTextureCube Method

EffectParameter.GetValueTextureCube Method

Gets the value of the EffectParameter as a TextureCube.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public TextureCube GetValueTextureCube ()

Return Value

The value of the EffectParameter as a TextureCube.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The resource is not of type TextureCube.
InvalidCastException | Unable to cast this EffectParameter to type TextureCube.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueVector2 Method

EffectParameter.GetValueVector2 Method

Gets the value of the EffectParameter as a Vector2.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector2 GetValueVector2 ()

Return Value

The value of the EffectParameter as a Vector2.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to an object of type Vector2.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueVector2Array Method

EffectParameter.GetValueVector2Array Method

Gets the value of the EffectParameter as an array of Vector2.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector2[] GetValueVector2Array (
         int count
)

Parameters

count
The number of elements in the array.

Return Value

The value of the EffectParameter as an array of Vector2.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | count is less than or equal to zero. count must be greater than or equal to one.
InvalidCastException | Unable to cast this EffectParameter to an array of type Vector2.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueVector3 Method

EffectParameter.GetValueVector3 Method

Gets the value of the EffectParameter as a Vector3.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 GetValueVector3 ()

Return Value

The value of the EffectParameter as a Vector3.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to an object of type Vector3.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueVector3Array Method

EffectParameter.GetValueVector3Array Method

Gets the value of the EffectParameter as an array of Vector3.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3[] GetValueVector3Array (
         int count
)

Parameters

count
The number of elements in the array.

Return Value

The value of the EffectParameter as an array of Vector3.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | count is less than or equal to zero. count must be greater than or equal to one.
InvalidCastException | Unable to cast this EffectParameter to an array of type Vector3.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueVector4 Method

EffectParameter.GetValueVector4 Method

Gets the value of the EffectParameter as a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector4 GetValueVector4 ()

Return Value

The value of the EffectParameter as a Vector4.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Vector4.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.GetValueVector4Array Method

EffectParameter.GetValueVector4Array Method

Gets the value of the EffectParameter as an array of Vector4.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector4[] GetValueVector4Array (
         int count
)

Parameters

count
The number of elements in the array.

Return Value

The value of the EffectParameter as an array of Vector4.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | count is less than or equal to zero. count must be greater than or equal to one.
InvalidCastException | Unable to cast this EffectParameter to an array of type Vector4.

Expand image Remarks

Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method

EffectParameter.SetValue Method

Sets the value of the EffectParameter.

Expand image Overload List

Name | Description
EffectParameter.SetValue (Boolean) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Boolean[]) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Int32) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Int32[]) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Matrix) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Matrix[]) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Quaternion) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Quaternion[]) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Single) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Single[]) | Sets the value of the EffectParameter.
EffectParameter.SetValue (String) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Texture) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector2) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector2[]) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector3) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector3[]) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector4) | Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector4[]) | Sets the value of the EffectParameter.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace


EffectParameter.SetValue Method (Boolean)

EffectParameter.SetValue Method (Boolean)
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         bool value
)

Parameters

value
[MarshalAsAttribute(U1)] The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Boolean.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Boolean[])

EffectParameter.SetValue Method (Boolean[])
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         bool[] value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to an array of type Boolean.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Int32)

EffectParameter.SetValue Method (Int32)
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         int value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Int32.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Int32[])

EffectParameter.SetValue Method (Int32[])
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         int[] value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to an arry of type Int32.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Matrix)

EffectParameter.SetValue Method (Matrix)
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Matrix value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Matrix.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Matrix[])

EffectParameter.SetValue Method (Matrix[])
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Matrix[] value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to an array of type Matrix.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Quaternion)

EffectParameter.SetValue Method (Quaternion)
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Quaternion value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Quaternion.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Quaternion[])

EffectParameter.SetValue Method (Quaternion[])
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Quaternion[] value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to an array of type Quaternion.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Single)

EffectParameter.SetValue Method (Single)
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         float value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Single.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Single[])

EffectParameter.SetValue Method (Single[])
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         float[] value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to an array of type Single.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (String)

EffectParameter.SetValue Method (String)
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         string value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type String.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Texture)

EffectParameter.SetValue Method (Texture)
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Texture value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | SetValue was called after value was disposed.
InvalidCastException | Unable to cast this EffectParameter to type Texture.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Vector2)

EffectParameter.SetValue Method (Vector2)
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Vector2 value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Vector2.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Vector2[])

EffectParameter.SetValue Method (Vector2[])
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Vector2[] value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to an array of type Vector2.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Vector3)

EffectParameter.SetValue Method (Vector3)
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Vector3 value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Vector3.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Vector3[])

EffectParameter.SetValue Method (Vector3[])
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Vector3[] value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to an array of type Vector3.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Vector4)

EffectParameter.SetValue Method (Vector4)
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Vector4 value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to type Vector4.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValue Method (Vector4[])

EffectParameter.SetValue Method (Vector4[])
See Also
CollapseAll image

Sets the value of the EffectParameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValue (
         Vector4[] value
)

Parameters

value
The value to assign to the EffectParameter.

Expand image Exceptions

Exception type | Condition
InvalidCastException | Unable to cast this EffectParameter to an array of type Vector4.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValueTranspose Method

EffectParameter.SetValueTranspose Method

Sets the value of the EffectParameter.

Expand image Overload List

Name | Description
EffectParameter.SetValueTranspose (Matrix) | Sets the value of the EffectParameter to the transpose of a Matrix.
EffectParameter.SetValueTranspose (Matrix[]) | Sets the value of the EffectParameter to the transpose of a Matrix.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace


EffectParameter.SetValueTranspose Method (Matrix)

EffectParameter.SetValueTranspose Method (Matrix)
See Also
CollapseAll image

Sets the value of the EffectParameter to the transpose of a Matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValueTranspose (
         Matrix value
)

Parameters

value
The value.

Expand image Exceptions

Exception type | Condition
InvalidCastException | This EffectParameter is not a matrix of the correct size to contain the transpose of the matrix specified in value.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.SetValueTranspose Method (Matrix[])

EffectParameter.SetValueTranspose Method (Matrix[])
See Also
CollapseAll image

Sets the value of the EffectParameter to the transpose of a Matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetValueTranspose (
         Matrix[] value
)

Parameters

value
The value.

Expand image Exceptions

Exception type | Condition
InvalidCastException | This EffectParameter is not a matrix of the correct size to contain the transpose of the matrix specified in value.

Expand image Remarks

Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter Properties

EffectParameter Properties

Expand image Public Properties

 | Name | Description
Public Property | Annotations | Gets the collection of EffectAnnotation objects for this parameter.
Public Property | ColumnCount | Gets the number of columns in the parameter description.
Public Property | Elements | Gets the collection of effect parameters.
Public Property | Name | Gets the name of the parameter.
Public Property | ParameterClass | Gets the class of the parameter.
Public Property | ParameterType | Gets the type of the parameter.
Public Property | RowCount | Gets the number of rows in the parameter description.
Public Property | Semantic | Gets the semantic meaning, or usage, of the parameter.
Public Property | StructureMembers | Gets the collection of structure members.

Expand image See Also

Reference

EffectParameter Class
Microsoft.Xna.Framework.Graphics Namespace


EffectParameter.Annotations Property

EffectParameter.Annotations Property

Gets the collection of EffectAnnotation objects for this parameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectAnnotationCollection Annotations { get; }

Property Value

The collection of EffectAnnotation objects.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.ColumnCount Property

EffectParameter.ColumnCount Property

Gets the number of columns in the parameter description.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int ColumnCount { get; }

Property Value

The number of columns in the parameter description.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.Elements Property

EffectParameter.Elements Property

Gets the collection of effect parameters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectParameterCollection Elements { get; }

Property Value

The collection of effect parameters.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.Name Property

EffectParameter.Name Property

Gets the name of the parameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of the parameter.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.ParameterClass Property

EffectParameter.ParameterClass Property

Gets the class of the parameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectParameterClass ParameterClass { get; }

Property Value

The parameter class.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.ParameterType Property

EffectParameter.ParameterType Property

Gets the type of the parameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectParameterType ParameterType { get; }

Property Value

The parameter type.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.RowCount Property

EffectParameter.RowCount Property

Gets the number of rows in the parameter description.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int RowCount { get; }

Property Value

The number of rows in the parameter description.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.Semantic Property

EffectParameter.Semantic Property

Gets the semantic meaning, or usage, of the parameter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Semantic { get; }

Property Value

The semantic meaning of the parameter.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameter.StructureMembers Property

EffectParameter.StructureMembers Property

Gets the collection of structure members.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectParameterCollection StructureMembers { get; }

Property Value

The collection of structure members.

Expand image See Also

Reference

EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameterClass Enumeration

EffectParameterClass Enumeration

Defines classes that can be used for effect parameters or shader constants.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum EffectParameterClass

Expand image Members

Member name | Description
Matrix | Constant is a matrix.
Object | Constant is either a texture, a shader, or a string.
Scalar | Constant is a scalar.
Struct | Constant is a structure.
Vector | Constant is a vector.

Expand image See Also

Reference

Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameterCollection Class

EffectParameterCollection Class
See Also Members
CollapseAll image

Manipulates a collection of EffectParameter objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class EffectParameterCollection : IEnumerable<EffectParameter>

Expand image See Also

Reference

EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameterCollection Members

EffectParameterCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the EffectParameterCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of EffectParameter objects in this EffectParameterCollection.
Public Property | Item | Overloaded. Gets an EffectParameter object.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through EffectParameterCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetParameterBySemantic | Gets an effect parameter from its semantic usage.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator that can iterate through EffectParameterCollection.
Explicit Interface Implementation | System.Collections.Generic.IEnumerable{T}.GetEnumerator | Gets an enumerator that can iterate through the EffectParameterCollection.

Expand image See Also

Reference

EffectParameterCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectParameterCollection Methods

EffectParameterCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through EffectParameterCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetParameterBySemantic | Gets an effect parameter from its semantic usage.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator that can iterate through EffectParameterCollection.
Explicit Interface Implementation | System.Collections.Generic.IEnumerable{T}.GetEnumerator | Gets an enumerator that can iterate through the EffectParameterCollection.

Expand image See Also

Reference

EffectParameterCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectParameterCollection.GetEnumerator Method

EffectParameterCollection.GetEnumerator Method

Gets an enumerator that can iterate through EffectParameterCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Enumerator<EffectParameter> GetEnumerator ()

Return Value

Enumerator for the EffectParameterCollection.

Expand image See Also

Reference

EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameterCollection.GetParameterBySemantic Method

EffectParameterCollection.GetParameterBySemantic Method

Gets an effect parameter from its semantic usage.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectParameter GetParameterBySemantic (
         string semantic
)

Parameters

semantic
The semantic meaning, or usage, of the parameter.

Return Value

The first parameter that matches the semantic usage, or null if no matching parameter was found.

Expand image See Also

Reference

EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.IEnumerable{T}.GetEnumerator Method

System.Collections.Generic.IEnumerable{T}.GetEnumerator Method
See Also
CollapseAll image

Gets an enumerator that can iterate through the EffectParameterCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private IEnumerator<EffectParameter> System.Collections.Generic.IEnumerable{T}.GetEnumerator ()

Return Value

Enumerator for the EffectParameterCollection.

Expand image See Also

Reference

EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Gets an enumerator that can iterate through EffectParameterCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

Enumerator for the EffectParameterCollection.

Expand image See Also

Reference

EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameterCollection Properties

EffectParameterCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of EffectParameter objects in this EffectParameterCollection.
Public Property | Item | Overloaded. Gets an EffectParameter object.

Expand image See Also

Reference

EffectParameterCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectParameterCollection.Count Property

EffectParameterCollection.Count Property

Gets the number of EffectParameter objects in this EffectParameterCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

The number of EffectParameter objects in this EffectParameterCollection.

Expand image See Also

Reference

EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameterCollection.Item Property

EffectParameterCollection.Item Property

Gets an EffectParameter object.

Expand image Overload List

Name | Description
EffectParameterCollection.Item (Int32) | Gets a specific EffectParameter object by using an index value.
EffectParameterCollection.Item (String) | Gets a specific EffectParameter by name.

Expand image See Also

Reference

EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace


EffectParameterCollection.Item Property (Int32)

EffectParameterCollection.Item Property (Int32)
See Also
CollapseAll image

Gets a specific EffectParameter object by using an index value.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectParameter this [
         int index
] { get; }

Property Value

The EffectParameter object at index index.

Expand image See Also

Reference

EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameterCollection.Item Property (String)

EffectParameterCollection.Item Property (String)
See Also
CollapseAll image

Gets a specific EffectParameter by name.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectParameter this [
         string name
] { get; }

Property Value

The EffectParameter object named name.

Expand image See Also

Reference

EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectParameterType Enumeration

EffectParameterType Enumeration

Defines types that can be used for effect parameters or shader constants.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum EffectParameterType

Expand image Members

Member name | Description
Bool | Parameter is a Boolean. Any nonzero value passed in will be mapped to 1 (TRUE) before being written into the constant table; otherwise, the value will be set to 0 in the constant table.
Int32 | Parameter is an integer. Any floating-point values passed in will be rounded off (to zero decimal places) before being written into the constant table.
Single | Parameter is a floating-point number.
String | Parameter is a string.
Texture | Parameter is a texture.
Texture1D | Parameter is a 1D texture.
Texture2D | Parameter is a 2D texture.
Texture3D | Parameter is a 3D texture.
TextureCube | Parameter is a cube texture.
Void | Parameter is a void pointer.

Expand image See Also

Reference

Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectPass Class

EffectPass Class
See Also Members
CollapseAll image

Contains rendering state for drawing with an effect; an effect can contain one or more passes.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class EffectPass

Expand image See Also

Reference

EffectPass Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectPass Members

EffectPass Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the EffectPass type.

Expand image Public Properties

 | Name | Description
Public Property | Annotations | Gets the set of EffectAnnotation objects for this EffectPass.
Public Property | Name | Gets the name of this pass.

Expand image Public Methods

 | Name | Description
Public Method | Apply | Begins this pass.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectPass Class
Microsoft.Xna.Framework.Graphics Namespace


EffectPass Methods

EffectPass Methods

Expand image Public Methods

 | Name | Description
Public Method | Apply | Begins this pass.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectPass Class
Microsoft.Xna.Framework.Graphics Namespace


EffectPass.Apply Method

EffectPass.Apply Method

Begins this pass.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Apply ()

Expand image See Also

Reference

EffectPass Class
EffectPass Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectPass Properties

EffectPass Properties

Expand image Public Properties

 | Name | Description
Public Property | Annotations | Gets the set of EffectAnnotation objects for this EffectPass.
Public Property | Name | Gets the name of this pass.

Expand image See Also

Reference

EffectPass Class
Microsoft.Xna.Framework.Graphics Namespace


EffectPass.Annotations Property

EffectPass.Annotations Property

Gets the set of EffectAnnotation objects for this EffectPass.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectAnnotationCollection Annotations { get; }

Property Value

The EffectAnnotationCollection containing EffectAnnotation objects for this EffectPass.

Expand image See Also

Reference

EffectPass Class
EffectPass Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectPass.Name Property

EffectPass.Name Property

Gets the name of this pass.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this pass.

Expand image See Also

Reference

EffectPass Class
EffectPass Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectPassCollection Class

EffectPassCollection Class
See Also Members
CollapseAll image

Manipulates a collection of EffectPass objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class EffectPassCollection : IEnumerable<EffectPass>

Expand image See Also

Reference

EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectPassCollection Members

EffectPassCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the EffectPassCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of objects in the collection.
Public Property | Item | Overloaded. Gets an element in the collection.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through the EffectPassCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator that can iterate through the EffectPassCollection.
Explicit Interface Implementation | System.Collections.Generic.IEnumerable{T}.GetEnumerator | Gets an enumerator that can iterate through the EffectPassCollection.

Expand image See Also

Reference

EffectPassCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectPassCollection Methods

EffectPassCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through the EffectPassCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator that can iterate through the EffectPassCollection.
Explicit Interface Implementation | System.Collections.Generic.IEnumerable{T}.GetEnumerator | Gets an enumerator that can iterate through the EffectPassCollection.

Expand image See Also

Reference

EffectPassCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectPassCollection.GetEnumerator Method

EffectPassCollection.GetEnumerator Method

Gets an enumerator that can iterate through the EffectPassCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Enumerator<EffectPass> GetEnumerator ()

Return Value

Enumerator for the EffectPassCollection.

Expand image See Also

Reference

EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.IEnumerable{T}.GetEnumerator Method

System.Collections.Generic.IEnumerable{T}.GetEnumerator Method
See Also
CollapseAll image

Gets an enumerator that can iterate through the EffectPassCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private IEnumerator<EffectPass> System.Collections.Generic.IEnumerable{T}.GetEnumerator ()

Return Value

Enumerator for the EffectPassCollection.

Expand image See Also

Reference

EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Gets an enumerator that can iterate through the EffectPassCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

Enumerator for the EffectPassCollection.

Expand image See Also

Reference

EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectPassCollection Properties

EffectPassCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of objects in the collection.
Public Property | Item | Overloaded. Gets an element in the collection.

Expand image See Also

Reference

EffectPassCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectPassCollection.Count Property

EffectPassCollection.Count Property

Gets the number of objects in the collection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

The number of objects in the collection.

Expand image See Also

Reference

EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectPassCollection.Item Property

EffectPassCollection.Item Property

Gets an element in the collection.

Expand image Overload List

Name | Description
EffectPassCollection.Item (Int32) | Gets a specific element in the collection by using an index value.
EffectPassCollection.Item (String) | Gets a specific element in the collection by using a name.

Expand image See Also

Reference

EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace


EffectPassCollection.Item Property (Int32)

EffectPassCollection.Item Property (Int32)
See Also
CollapseAll image

Gets a specific element in the collection by using an index value.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectPass this [
         int index
] { get; }

Property Value

The object at index index.

Expand image See Also

Reference

EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectPassCollection.Item Property (String)

EffectPassCollection.Item Property (String)
See Also
CollapseAll image

Gets a specific element in the collection by using a name.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectPass this [
         string name
] { get; }

Property Value

The object named name.

Expand image See Also

Reference

EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectTechnique Class

EffectTechnique Class
See Also Members Example
CollapseAll image

Represents an effect technique.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class EffectTechnique

Expand image Remarks

Creating and assigning a EffectTechnique instance for each technique in your Effect is significantly faster than using the Techniques indexed property on Effect.

Expand image Example

To use a EffectTechnique you must:

  1. Create a EffectTechnique for each technique in your Effect.

    C#
    public EffectTechnique texture;
public EffectTechnique shadows;
public EffectTechnique shadowMap;

  2. Assign an Effect technique to your EffectTechnique.

    C#
    texture = effect.Techniques["TextureRender"];
shadowMap = effect.Techniques["ShadowMapRender"];
shadows = effect.Techniques["ShadowRender"];

  3. Assign your EffectTechnique to the CurrentTechnique of your Effect before drawing.

    C#
    private void DrawScene(EffectTechnique technique)
{
    MyEffect.mWorld.SetValue(terrainWorld);
    MyEffect.MeshTexture.SetValue(terrainTex);
    foreach (ModelMesh mesh in terrain.Meshes)
    {
        foreach (Effect effect in mesh.Effects)
        {
            effect.CurrentTechnique = technique;
            mesh.Draw();
        }
    }
}

Expand image See Also

Concepts

Shader Content Catalog at XNA Creators Club Online

Reference

EffectTechnique Members
Effect.Techniques
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectTechnique Members

EffectTechnique Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the EffectTechnique type.

Expand image Public Properties

 | Name | Description
Public Property | Annotations | Gets the EffectAnnotation objects associated with this technique.
Public Property | Name | Gets the name of this technique.
Public Property | Passes | Gets the collection of EffectPass objects this rendering technique requires.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectTechnique Class
Microsoft.Xna.Framework.Graphics Namespace


EffectTechnique Properties

EffectTechnique Properties

Expand image Public Properties

 | Name | Description
Public Property | Annotations | Gets the EffectAnnotation objects associated with this technique.
Public Property | Name | Gets the name of this technique.
Public Property | Passes | Gets the collection of EffectPass objects this rendering technique requires.

Expand image See Also

Reference

EffectTechnique Class
Microsoft.Xna.Framework.Graphics Namespace


EffectTechnique.Annotations Property

EffectTechnique.Annotations Property

Gets the EffectAnnotation objects associated with this technique.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectAnnotationCollection Annotations { get; }

Property Value

The EffectAnnotation objects associated with this technique.

Expand image See Also

Reference

EffectTechnique Class
EffectTechnique Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectTechnique.Name Property

EffectTechnique.Name Property

Gets the name of this technique.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this technique.

Expand image See Also

Reference

EffectTechnique Class
EffectTechnique Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectTechnique.Passes Property

EffectTechnique.Passes Property

Gets the collection of EffectPass objects this rendering technique requires.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectPassCollection Passes { get; }

Property Value

The collection of EffectPass objects this rendering technique requires.

Expand image Remarks

Some video cards can render two textures in a single pass. However, if a card does not have this capability, it is often possible to render the same effect in two passes, using one texture for each pass.

Expand image See Also

Reference

EffectTechnique Class
EffectTechnique Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectTechniqueCollection Class

EffectTechniqueCollection Class
See Also Members
CollapseAll image

Manipulates a collection of EffectTechnique objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class EffectTechniqueCollection : IEnumerable<EffectTechnique>

Expand image See Also

Reference

EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectTechniqueCollection Members

EffectTechniqueCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the EffectTechniqueCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of objects in the collection.
Public Property | Item | Overloaded. Gets an element in the collection.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through the EffectTechniqueCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator that can iterate through the EffectTechniqueCollection.
Explicit Interface Implementation | System.Collections.Generic.IEnumerable{T}.GetEnumerator | Gets an enumerator that can iterate through the EffectTechniqueCollection.

Expand image See Also

Reference

EffectTechniqueCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectTechniqueCollection Methods

EffectTechniqueCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that can iterate through the EffectTechniqueCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator that can iterate through the EffectTechniqueCollection.
Explicit Interface Implementation | System.Collections.Generic.IEnumerable{T}.GetEnumerator | Gets an enumerator that can iterate through the EffectTechniqueCollection.

Expand image See Also

Reference

EffectTechniqueCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectTechniqueCollection.GetEnumerator Method

EffectTechniqueCollection.GetEnumerator Method

Gets an enumerator that can iterate through the EffectTechniqueCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Enumerator<EffectTechnique> GetEnumerator ()

Return Value

Enumerator of the EffectTechniqueCollection.

Expand image See Also

Reference

EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.Generic.IEnumerable{T}.GetEnumerator Method

System.Collections.Generic.IEnumerable{T}.GetEnumerator Method
See Also
CollapseAll image

Gets an enumerator that can iterate through the EffectTechniqueCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private IEnumerator<EffectTechnique> System.Collections.Generic.IEnumerable{T}.GetEnumerator ()

Return Value

Enumerator for the EffectTechniqueCollection.

Expand image See Also

Reference

EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Gets an enumerator that can iterate through the EffectTechniqueCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

Enumerator for the EffectTechniqueCollection.

Expand image See Also

Reference

EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectTechniqueCollection Properties

EffectTechniqueCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of objects in the collection.
Public Property | Item | Overloaded. Gets an element in the collection.

Expand image See Also

Reference

EffectTechniqueCollection Class
Microsoft.Xna.Framework.Graphics Namespace


EffectTechniqueCollection.Count Property

EffectTechniqueCollection.Count Property

Gets the number of objects in the collection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

The number of objects in the collection.

Expand image See Also

Reference

EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectTechniqueCollection.Item Property

EffectTechniqueCollection.Item Property

Gets an element in the collection.

Expand image Overload List

Name | Description
EffectTechniqueCollection.Item (Int32) | Gets a specific element in the collection by using an index value.
EffectTechniqueCollection.Item (String) | Gets a specific element in the collection by using a name.

Expand image See Also

Reference

EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace


EffectTechniqueCollection.Item Property (Int32)

EffectTechniqueCollection.Item Property (Int32)
See Also
CollapseAll image

Gets a specific element in the collection by using an index value.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectTechnique this [
         int index
] { get; }

Property Value

The object at index index.

Expand image See Also

Reference

EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EffectTechniqueCollection.Item Property (String)

EffectTechniqueCollection.Item Property (String)
See Also
CollapseAll image

Gets a specific element in the collection by using a name.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EffectTechnique this [
         string name
] { get; }

Property Value

The object named name.

Expand image See Also

Reference

EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect Class

EnvironmentMapEffect Class
See Also Members
CollapseAll image

Contains a configurable effect that supports environment mapping.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class EnvironmentMapEffect : Effect, IEffectMatrices, IEffectLights, IEffectFog

Expand image See Also

Reference

EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect Members

EnvironmentMapEffect Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the EnvironmentMapEffect type.

Expand image Public Constructors

 | Name | Description
Public Method | EnvironmentMapEffect | Overloaded. Creates a new EnvironmentMapEffect object.

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).
Public Property | AmbientLightColor | Gets or sets the ambient color for a light, the range of color values is from 0 to 1.
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | DiffuseColor | Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.
Public Property | DirectionalLight0 | Gets the first directional light.
Public Property | DirectionalLight1 | Gets the second directional light.
Public Property | DirectionalLight2 | Gets the third directional light.
Public Property | EmissiveColor | Gets or sets the emissive color for a material, the range of color values is from 0 to 1.
Public Property | EnvironmentMap | Gets or sets the current environment map texture.
Public Property | EnvironmentMapAmount | Gets or sets the amount of the environment map color (RGB) that will be blended over the base texture. The value ranges from 0 to 1; the default value is 1.
Public Property | EnvironmentMapSpecular | Gets or sets the amount of the environment map alpha value that will be added to the base texture. The value ranges from 0 to 1; the default value is 0.
Public Property | FogColor | Gets or sets the fog color, the range of color values is from 0 to 1.
Public Property | FogEnabled | Gets or sets the fog enable flag.
Public Property | FogEnd | Gets or sets the maximum z value for fog, which ranges from 0 to 1.
Public Property | FogStart | Gets or sets the minimum z value for fog, which ranges from 0 to 1.
Public Property | FresnelFactor | Gets or sets the Fresnel factor used for the environment map blending.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | Projection | Gets or sets the projection matrix.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)
Public Property | Texture | Gets or sets the current texture.
Public Property | View | Gets or sets the view matrix.
Public Property | World | Gets or sets the world matrix.

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a clone of the current EnvironmentMapEffect instance.
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | EnableDefaultLighting | Sets up standard key, fill, and back lighting for an EnvironmentMapEffect.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Computes derived parameter values immediately before applying the effect.

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | LightingEnabled Property | Enables lighting in an EnvironmentMapEffect.

Expand image See Also

Reference

EnvironmentMapEffect Class
Microsoft.Xna.Framework.Graphics Namespace


EnvironmentMapEffect Constructor

EnvironmentMapEffect Constructor

Creates a new EnvironmentMapEffect object.

Expand image Overload List

Name | Description
EnvironmentMapEffect (EnvironmentMapEffect) | Creates a new EnvironmentMapEffect by cloning parameter settings from an existing instance.
EnvironmentMapEffect (GraphicsDevice) | Creates a new EnvironmentMapEffect with default parameter settings.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace


EnvironmentMapEffect Constructor (EnvironmentMapEffect)

EnvironmentMapEffect Constructor (EnvironmentMapEffect)
See Also
CollapseAll image

Creates a new EnvironmentMapEffect by cloning parameter settings from an existing instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected EnvironmentMapEffect (
         EnvironmentMapEffect cloneSource
)

Parameters

cloneSource
An existing instance.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect Constructor (GraphicsDevice)

EnvironmentMapEffect Constructor (GraphicsDevice)
See Also
CollapseAll image

Creates a new EnvironmentMapEffect with default parameter settings.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public EnvironmentMapEffect (
         GraphicsDevice device
)

Parameters

device
The graphics device.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect Methods

EnvironmentMapEffect Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a clone of the current EnvironmentMapEffect instance.
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | EnableDefaultLighting | Sets up standard key, fill, and back lighting for an EnvironmentMapEffect.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Computes derived parameter values immediately before applying the effect.

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | LightingEnabled Property | Enables lighting in an EnvironmentMapEffect.

Expand image See Also

Reference

EnvironmentMapEffect Class
Microsoft.Xna.Framework.Graphics Namespace


EnvironmentMapEffect.Clone Method

EnvironmentMapEffect.Clone Method

Creates a clone of the current EnvironmentMapEffect instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override Effect Clone ()

Return Value

A cloned copy of the current instance.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.EnableDefaultLighting Method

EnvironmentMapEffect.EnableDefaultLighting Method

Sets up standard key, fill, and back lighting for an EnvironmentMapEffect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void EnableDefaultLighting ()

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.OnApply Method

EnvironmentMapEffect.OnApply Method

Computes derived parameter values immediately before applying the effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected internal override void OnApply ()

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect Properties

EnvironmentMapEffect Properties

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).
Public Property | AmbientLightColor | Gets or sets the ambient color for a light, the range of color values is from 0 to 1.
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | DiffuseColor | Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.
Public Property | DirectionalLight0 | Gets the first directional light.
Public Property | DirectionalLight1 | Gets the second directional light.
Public Property | DirectionalLight2 | Gets the third directional light.
Public Property | EmissiveColor | Gets or sets the emissive color for a material, the range of color values is from 0 to 1.
Public Property | EnvironmentMap | Gets or sets the current environment map texture.
Public Property | EnvironmentMapAmount | Gets or sets the amount of the environment map color (RGB) that will be blended over the base texture. The value ranges from 0 to 1; the default value is 1.
Public Property | EnvironmentMapSpecular | Gets or sets the amount of the environment map alpha value that will be added to the base texture. The value ranges from 0 to 1; the default value is 0.
Public Property | FogColor | Gets or sets the fog color, the range of color values is from 0 to 1.
Public Property | FogEnabled | Gets or sets the fog enable flag.
Public Property | FogEnd | Gets or sets the maximum z value for fog, which ranges from 0 to 1.
Public Property | FogStart | Gets or sets the minimum z value for fog, which ranges from 0 to 1.
Public Property | FresnelFactor | Gets or sets the Fresnel factor used for the environment map blending.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | Projection | Gets or sets the projection matrix.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)
Public Property | Texture | Gets or sets the current texture.
Public Property | View | Gets or sets the view matrix.
Public Property | World | Gets or sets the world matrix.

Expand image See Also

Reference

EnvironmentMapEffect Class
Microsoft.Xna.Framework.Graphics Namespace


EnvironmentMapEffect.Alpha Property

EnvironmentMapEffect.Alpha Property

Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float Alpha { get; set; }

Property Value

The alpha value.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.AmbientLightColor Property

EnvironmentMapEffect.AmbientLightColor Property

Gets or sets the ambient color for a light, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 AmbientLightColor { get; set; }

Property Value

The ambient color.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.DiffuseColor Property

EnvironmentMapEffect.DiffuseColor Property

Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 DiffuseColor { get; set; }

Property Value

The diffuse color.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.DirectionalLight0 Property

EnvironmentMapEffect.DirectionalLight0 Property

Gets the first directional light.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight0 { get; }

Property Value

The first light.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.DirectionalLight1 Property

EnvironmentMapEffect.DirectionalLight1 Property

Gets the second directional light.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight1 { get; }

Property Value

The second light.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.DirectionalLight2 Property

EnvironmentMapEffect.DirectionalLight2 Property

Gets the third directional light.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight2 { get; }

Property Value

The third light.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.EmissiveColor Property

EnvironmentMapEffect.EmissiveColor Property

Gets or sets the emissive color for a material, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 EmissiveColor { get; set; }

Property Value

The emissive color.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.EnvironmentMap Property

EnvironmentMapEffect.EnvironmentMap Property

Gets or sets the current environment map texture.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public TextureCube EnvironmentMap { get; set; }

Property Value

The environment map texture.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.EnvironmentMapAmount Property

EnvironmentMapEffect.EnvironmentMapAmount Property

Gets or sets the amount of the environment map color (RGB) that will be blended over the base texture. The value ranges from 0 to 1; the default value is 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float EnvironmentMapAmount { get; set; }

Property Value

The RGB blend factor.

Expand image Remarks

If set to zero, the RGB channels of the environment map will be completely ignored (the environment map alpha may still be visible if EnvironmentMapSpecular is greater than zero).

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.EnvironmentMapSpecular Property

EnvironmentMapEffect.EnvironmentMapSpecular Property

Gets or sets the amount of the environment map alpha value that will be added to the base texture. The value ranges from 0 to 1; the default value is 0.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 EnvironmentMapSpecular { get; set; }

Property Value

The environment map alpha value.

Expand image Remarks

Use this value to implement cheap specular lighting, by encoding one or more specular highlight patterns into the environment map alpha channel, then setting the EnvironmentMapSpecular to the desired specular light color.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.FogColor Property

EnvironmentMapEffect.FogColor Property

Gets or sets the fog color, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 FogColor { get; set; }

Property Value

The fog color.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.FogEnabled Property

EnvironmentMapEffect.FogEnabled Property

Gets or sets the fog enable flag.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool FogEnabled { get; set; }

Property Value

True to enable fog; false otherwise.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.FogEnd Property

EnvironmentMapEffect.FogEnd Property

Gets or sets the maximum z value for fog, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogEnd { get; set; }

Property Value

The distance to stop adding fog.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.FogStart Property

EnvironmentMapEffect.FogStart Property

Gets or sets the minimum z value for fog, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogStart { get; set; }

Property Value

The distance to begin adding fog.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.FresnelFactor Property

EnvironmentMapEffect.FresnelFactor Property

Gets or sets the Fresnel factor used for the environment map blending.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FresnelFactor { get; set; }

Property Value

The Fresnel factor.

Expand image Remarks

The default value is 1. Use 0 to disable Fresnel lighting; this makes the environment map visible independent of the viewing angle. Use a higher value to make the environment map visible around silhouette edges; use a lower value to make the environment map visible everywhere. Fresnel lighting only affects the environment map color (RGB values), alpha is not affected. Control the intensity of the color values using EnvironmentMapAmount; control the intensity of the alpha value with EnvironmentMapSpecular.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LightingEnabled Property

LightingEnabled Property

Enables lighting in an EnvironmentMapEffect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private bool Microsoft.Xna.Framework.Graphics.IEffectLights.LightingEnabled { get; set; }

Property Value

True to enable lighting; false otherwise.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.Projection Property

EnvironmentMapEffect.Projection Property

Gets or sets the projection matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix Projection { get; set; }

Property Value

A matrix that contains a projection transform.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.Texture Property

EnvironmentMapEffect.Texture Property

Gets or sets the current texture.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture2D Texture { get; set; }

Property Value

The current texture.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.View Property

EnvironmentMapEffect.View Property

Gets or sets the view matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix View { get; set; }

Property Value

A matrix that contains a view transform.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect.World Property

EnvironmentMapEffect.World Property

Gets or sets the world matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix World { get; set; }

Property Value

A matrix that contains a world transform.

Expand image See Also

Reference

EnvironmentMapEffect Class
EnvironmentMapEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


EnvironmentMapEffect Events

EnvironmentMapEffect Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

EnvironmentMapEffect Class
Microsoft.Xna.Framework.Graphics Namespace


FillMode Enumeration

FillMode Enumeration

Describes options for filling the vertices and lines that define a primitive.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum FillMode

Expand image Members

Member name | Description
Solid | Draw solid faces for each primitive.
WireFrame | Draw lines connecting the vertices that define a primitive face.

Expand image See Also

Reference

RasterizerState.FillMode Property
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter Class

GraphicsAdapter Class
See Also Members
CollapseAll image

Provides methods to retrieve and manipulate graphics adapters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class GraphicsAdapter

Expand image See Also

Reference

GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter Members

GraphicsAdapter Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the GraphicsAdapter type.

Expand image Public Properties

 | Name | Description
 | Adapters | Collection of available adapters on the system.
Public Property | CurrentDisplayMode | Gets the current display mode.
 | DefaultAdapter | Gets the default adapter.
Public Property | Description | Retrieves a string used for presentation to the user.
Public Property | DeviceId | Retrieves a value that is used to help identify a particular chip set.
Public Property | DeviceName | Retrieves a string that contains the device name for a Microsoft Windows Graphics Device Interface (GDI).
Public Property | IsDefaultAdapter | Determines if this instance of GraphicsAdapter is the default adapter.
Public Property | IsWideScreen | Determines if the graphics adapter is in widescreen mode.
Public Property | MonitorHandle | Retrieves the handle of the monitor associated with the Microsoft Direct3D object.
Public Property | Revision | Retrieves a value used to help identify the revision level of a particular chip set.
Public Property | SubSystemId | Retrieves a value used to identify the subsystem.
Public Property | SupportedDisplayModes | Returns a collection of supported display modes for the current adapter.
 | UseNullDevice | Gets or sets a NULL device.
 | UseReferenceDevice | Gets or sets a reference device.
Public Property | VendorId | Retrieves a value used to identify the manufacturer.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsProfileSupported | Tests to see if the adapter supports the requested profile.
Public Method | QueryBackBufferFormat | Queries the adapter for support for the requested back buffer format.
Public Method | QueryRenderTargetFormat | Queries the adapter for support for the requested render target format.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GraphicsAdapter Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsAdapter Methods

GraphicsAdapter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IsProfileSupported | Tests to see if the adapter supports the requested profile.
Public Method | QueryBackBufferFormat | Queries the adapter for support for the requested back buffer format.
Public Method | QueryRenderTargetFormat | Queries the adapter for support for the requested render target format.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GraphicsAdapter Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsAdapter.IsProfileSupported Method

GraphicsAdapter.IsProfileSupported Method

Tests to see if the adapter supports the requested profile.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsProfileSupported (
         GraphicsProfile graphicsProfile
)

Parameters

graphicsProfile
The graphics profile.

Return Value

True if the adapter supports the profile; false otherwise.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.QueryBackBufferFormat Method

GraphicsAdapter.QueryBackBufferFormat Method

Queries the adapter for support for the requested back buffer format.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool QueryBackBufferFormat (
         GraphicsProfile graphicsProfile,
         SurfaceFormat format,
         DepthFormat depthFormat,
         int multiSampleCount,
         out SurfaceFormat selectedFormat,
         out DepthFormat selectedDepthFormat,
         out int selectedMultiSampleCount
)

Parameters

graphicsProfile
The graphics profile.
format
The requested surface data format.
depthFormat
The requested depth buffer format.
multiSampleCount
The requested number of multisampling locations.
selectedFormat
[OutAttribute] The best format the adapter supports for the requested surface data format.
selectedDepthFormat
[OutAttribute] The best format the adapter supports for the requested depth data format.
selectedMultiSampleCount
[OutAttribute] The best format the adapter supports for the requested number of multisampling locations.

Return Value

True if the adapter supports the requested format; false otherwise.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.QueryRenderTargetFormat Method

GraphicsAdapter.QueryRenderTargetFormat Method

Queries the adapter for support for the requested render target format.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool QueryRenderTargetFormat (
         GraphicsProfile graphicsProfile,
         SurfaceFormat format,
         DepthFormat depthFormat,
         int multiSampleCount,
         out SurfaceFormat selectedFormat,
         out DepthFormat selectedDepthFormat,
         out int selectedMultiSampleCount
)

Parameters

graphicsProfile
The graphics profile.
format
The requested surface data format.
depthFormat
The requested depth buffer format.
multiSampleCount
The requested number of multisampling locations.
selectedFormat
[OutAttribute] The best format the adapter supports for the requested surface data format.
selectedDepthFormat
[OutAttribute] The best format the adapter supports for the requested depth data format.
selectedMultiSampleCount
[OutAttribute] The best format the adapter supports for the requested number of multisampling locations.

Return Value

True if the adapter supports the requested format; false otherwise.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter Properties

GraphicsAdapter Properties

Expand image Public Properties

 | Name | Description
 | Adapters | Collection of available adapters on the system.
Public Property | CurrentDisplayMode | Gets the current display mode.
 | DefaultAdapter | Gets the default adapter.
Public Property | Description | Retrieves a string used for presentation to the user.
Public Property | DeviceId | Retrieves a value that is used to help identify a particular chip set.
Public Property | DeviceName | Retrieves a string that contains the device name for a Microsoft Windows Graphics Device Interface (GDI).
Public Property | IsDefaultAdapter | Determines if this instance of GraphicsAdapter is the default adapter.
Public Property | IsWideScreen | Determines if the graphics adapter is in widescreen mode.
Public Property | MonitorHandle | Retrieves the handle of the monitor associated with the Microsoft Direct3D object.
Public Property | Revision | Retrieves a value used to help identify the revision level of a particular chip set.
Public Property | SubSystemId | Retrieves a value used to identify the subsystem.
Public Property | SupportedDisplayModes | Returns a collection of supported display modes for the current adapter.
 | UseNullDevice | Gets or sets a NULL device.
 | UseReferenceDevice | Gets or sets a reference device.
Public Property | VendorId | Retrieves a value used to identify the manufacturer.

Expand image See Also

Reference

GraphicsAdapter Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsAdapter.Adapters Property

GraphicsAdapter.Adapters Property

Collection of available adapters on the system.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static ReadOnlyCollection<GraphicsAdapter> Adapters { get; }

Property Value

The collection of adapters.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.CurrentDisplayMode Property

GraphicsAdapter.CurrentDisplayMode Property

Gets the current display mode.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DisplayMode CurrentDisplayMode { get; }

Property Value

The current display mode.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.DefaultAdapter Property

GraphicsAdapter.DefaultAdapter Property

Gets the default adapter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static GraphicsAdapter DefaultAdapter { get; }

Property Value

The default adapter.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.Description Property

GraphicsAdapter.Description Property

Retrieves a string used for presentation to the user.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Description { get; }

Property Value

Description of the adapter.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.DeviceId Property

GraphicsAdapter.DeviceId Property

Retrieves a value that is used to help identify a particular chip set.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int DeviceId { get; }

Property Value

Value that helps identify the chip set. The returned value may be zero if it is unknown.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.DeviceName Property

GraphicsAdapter.DeviceName Property

Retrieves a string that contains the device name for a Microsoft Windows Graphics Device Interface (GDI).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string DeviceName { get; }

Property Value

The name of the device.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.IsDefaultAdapter Property

GraphicsAdapter.IsDefaultAdapter Property

Determines if this instance of GraphicsAdapter is the default adapter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsDefaultAdapter { get; }

Property Value

true if this instance of GraphicsAdapter is the default adapter, false otherwise.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.IsWideScreen Property

GraphicsAdapter.IsWideScreen Property

Determines if the graphics adapter is in widescreen mode.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsWideScreen { get; }

Property Value

true if the graphics adapter is in widescreen mode; false otherwise.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.MonitorHandle Property

GraphicsAdapter.MonitorHandle Property

Retrieves the handle of the monitor associated with the Microsoft Direct3D object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public IntPtr MonitorHandle { get; }

Property Value

The handle of the monitor.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.Revision Property

GraphicsAdapter.Revision Property

Retrieves a value used to help identify the revision level of a particular chip set.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Revision { get; }

Property Value

Value used to help identify the revision level of the chip set. This value may be zero if it is unknown.

Expand image Remarks

The VendorId, DeviceId, SubSystemId, and Revision members can be used in tandem to identify particular chip sets. However, these members should be used with caution.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.SubSystemId Property

GraphicsAdapter.SubSystemId Property

Retrieves a value used to identify the subsystem.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int SubSystemId { get; }

Property Value

Value used to identify the subsystem, typically the particular board. This value may be zero if it is unknown.

Expand image Remarks

The VendorId, DeviceId, SubSystemId, and Revision members can be used in tandem to identify particular chip sets. However, these members should be used with caution.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.SupportedDisplayModes Property

GraphicsAdapter.SupportedDisplayModes Property

Returns a collection of supported display modes for the current adapter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DisplayModeCollection SupportedDisplayModes { get; }

Property Value

The supported display modes for the adapter.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.UseNullDevice Property

GraphicsAdapter.UseNullDevice Property

Gets or sets a NULL device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool UseNullDevice { get; set; }

Property Value

True to enable a NULL device; false otherwise.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.UseReferenceDevice Property

GraphicsAdapter.UseReferenceDevice Property

Gets or sets a reference device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool UseReferenceDevice { get; set; }

Property Value

True to enable a reference device; false otherwise.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsAdapter.VendorId Property

GraphicsAdapter.VendorId Property

Retrieves a value used to identify the manufacturer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int VendorId { get; }

Property Value

Value used to identify the manufacturer. This value may be zero if it is unknown.

Expand image Remarks

The VendorId, DeviceId, SubSystemId, and Revision members can be used in tandem to identify particular chip sets. However, these members should be used with caution.

Expand image See Also

Reference

GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice Class

GraphicsDevice Class
See Also Members
CollapseAll image

Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class GraphicsDevice : IDisposable

Expand image See Also

Reference

GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice Members

GraphicsDevice Members
See Also Constructors Events Methods Properties
CollapseAll image

The following tables list the members exposed by the GraphicsDevice type.

Expand image Public Constructors

 | Name | Description
Public Method | GraphicsDevice | Creates an instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | Adapter | Gets the graphics adapter.
Public Property | BlendFactor | Gets or sets the color used for a constant-blend factor during alpha blending. The default value is Color.White.
Public Property | BlendState | Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is BlendState.Opaque.
Public Property | DepthStencilState | Gets or sets a system-defined instance of a depth-stencil state object. The default value is DepthStencilState.Default.
Public Property | DisplayMode | Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.
Public Property | GraphicsDeviceStatus | Retrieves the status of the device.
Public Property | GraphicsProfile | Gets the graphics profile. The default value is GraphicsProfile.Reach.
Public Property | Indices | Gets or sets index data. The default value is null.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | MultiSampleMask | Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff).
Public Property | PresentationParameters | Gets the presentation parameters associated with this graphics device.
Public Property | RasterizerState | Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
Public Property | ReferenceStencil | Gets or sets a reference value for stencil testing. The default value is zero.
Public Property | SamplerStates | Retrieves a collection of SamplerState objects for the current GraphicsDevice.
Public Property | ScissorRectangle | Gets or sets the rectangle used for scissor testing. By default, the size matches the render target size.
Public Property | Textures | Returns the collection of textures that have been assigned to the texture stages of the device.
Public Property | VertexSamplerStates | Gets the collection of vertex sampler states.
Public Property | VertexTextures | Gets the collection of vertex textures that support texture lookup in the vertex shader using the texldl statement. The vertex engine contains four texture sampler stages.
Public Property | Viewport | Gets or sets a viewport identifying the portion of the render target to receive draw calls.

Expand image Public Methods

 | Name | Description
Public Method | Clear | Overloaded. Clears resource buffers.
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | DrawIndexedPrimitives | Renders the specified geometric primitive, based on indexing into an array of vertices.
Public Method | DrawInstancedPrimitives | Draws a series of instanced models.
Public Method | DrawPrimitives | Renders a sequence of non-indexed geometric primitives of the specified type from the current set of data input streams.
Public Method | DrawUserIndexedPrimitives | Overloaded. Renders geometric primitives.
Public Method | DrawUserPrimitives | Overloaded. Renders geometric primitives.
Public Method | Equals | (Inherited from Object.)
Public Method | GetBackBufferData | Overloaded. Gets the contents of the back buffer.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetRenderTargets | Gets a render target surface.
Public Method | GetType | (Inherited from Object.)
Public Method | GetVertexBuffers | Gets the vertex buffers.
Public Method | Present | Overloaded. Presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.
Public Method | Reset | Overloaded. Resets the presentation parameters for the current GraphicsDevice.
Public Method | SetRenderTarget | Overloaded. Sets a new color buffer for a GraphicsDevice.
Public Method | SetRenderTargets | Sets an array of render targets.
Public Method | SetVertexBuffer | Overloaded. Sets or binds a vertex buffer to a device.
Public Method | SetVertexBuffers | Sets the vertex buffers.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | DeviceLost | Occurs when a GraphicsDevice is about to be lost (for example, immediately before a reset).
Public Event | DeviceReset | Occurs after a GraphicsDevice is reset, allowing an application to recreate all resources.
Public Event | DeviceResetting | Occurs when a GraphicsDevice is resetting, allowing the application to cancel the default handling of the reset.
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime.
Public Event | ResourceCreated | Occurs when a resource is created.
Public Event | ResourceDestroyed | Occurs when a resource is destroyed.

Expand image See Also

Reference

GraphicsDevice Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice Constructor

GraphicsDevice Constructor

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public GraphicsDevice (
         GraphicsAdapter adapter,
         GraphicsProfile graphicsProfile,
         PresentationParameters presentationParameters
)

Parameters

adapter
The display adapter.
graphicsProfile
The graphics profile.
presentationParameters
The presentation options.

Expand image Exceptions

Exception type | Condition
NoSuitableGraphicsDeviceException | The graphics adapter does not support the requested capabilities.
NotSupportedException | Could not find a graphics device that supports the profile.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice Methods

GraphicsDevice Methods

Expand image Public Methods

 | Name | Description
Public Method | Clear | Overloaded. Clears resource buffers.
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | DrawIndexedPrimitives | Renders the specified geometric primitive, based on indexing into an array of vertices.
Public Method | DrawInstancedPrimitives | Draws a series of instanced models.
Public Method | DrawPrimitives | Renders a sequence of non-indexed geometric primitives of the specified type from the current set of data input streams.
Public Method | DrawUserIndexedPrimitives | Overloaded. Renders geometric primitives.
Public Method | DrawUserPrimitives | Overloaded. Renders geometric primitives.
Public Method | Equals | (Inherited from Object.)
Public Method | GetBackBufferData | Overloaded. Gets the contents of the back buffer.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetRenderTargets | Gets a render target surface.
Public Method | GetType | (Inherited from Object.)
Public Method | GetVertexBuffers | Gets the vertex buffers.
Public Method | Present | Overloaded. Presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.
Public Method | Reset | Overloaded. Resets the presentation parameters for the current GraphicsDevice.
Public Method | SetRenderTarget | Overloaded. Sets a new color buffer for a GraphicsDevice.
Public Method | SetRenderTargets | Sets an array of render targets.
Public Method | SetVertexBuffer | Overloaded. Sets or binds a vertex buffer to a device.
Public Method | SetVertexBuffers | Sets the vertex buffers.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GraphicsDevice Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.Clear Method

GraphicsDevice.Clear Method

Clears resource buffers.

Expand image Overload List

Name | Description
GraphicsDevice.Clear (ClearOptions, Color, Single, Int32) | Clears resource buffers.
GraphicsDevice.Clear (ClearOptions, Vector4, Single, Int32) | Clears resource buffers.
GraphicsDevice.Clear (Color) | Clears resource buffers.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.Clear Method (ClearOptions, Color, Single, Int32)

GraphicsDevice.Clear Method (ClearOptions, Color, Single, Int32)
See Also
CollapseAll image

Clears resource buffers.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Clear (
         ClearOptions options,
         Color color,
         float depth,
         int stencil
)

Parameters

options
Options for clearing a buffer.
color
Set this color value in the buffer.
depth
Set this depth value in the buffer.
stencil
Set this stencil value in the buffer.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Clear Method (ClearOptions, Vector4, Single, Int32)

GraphicsDevice.Clear Method (ClearOptions, Vector4, Single, Int32)
See Also
CollapseAll image

Clears resource buffers.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Clear (
         ClearOptions options,
         Vector4 color,
         float depth,
         int stencil
)

Parameters

options
Options for clearing a buffer.
color
Set this four-component color value in the buffer.
depth
Set this depth value in the buffer.
stencil
Set this stencil value in the buffer.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Clear Method (Color)

GraphicsDevice.Clear Method (Color)
See Also
CollapseAll image

Clears resource buffers.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Clear (
         Color color
)

Parameters

color
Set this color value in all buffers.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Dispose Method

GraphicsDevice.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
GraphicsDevice.Dispose () | Immediately releases the unmanaged resources used by this object.
GraphicsDevice.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image Remarks

Call Dispose when you are finished using the GraphicsDevice. The Dispose method leaves the GraphicsDevice in an unusable state. After calling Dispose, you must release all references to the GraphicsDevice so the garbage collector can reclaim the memory that the GraphicsDevice was occupying.

Note
Always call Dispose before you release your last reference to the GraphicsDevice. Otherwise, the resources it is using will not be freed until the garbage collector calls the GraphicsDevice object's Finalize method.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.Dispose Method ()

GraphicsDevice.Dispose Method ()
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image Remarks

Call Dispose when you are finished using the GraphicsDevice. The Dispose method leaves the GraphicsDevice in an unusable state. After calling Dispose, you must release all references to the GraphicsDevice so the garbage collector can reclaim the memory that the GraphicsDevice was occupying.

Note
Always call Dispose before you release your last reference to the GraphicsDevice. Otherwise, the resources it is using will not be freed until the garbage collector calls the GraphicsDevice object's Finalize method.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Dispose Method (Boolean)

GraphicsDevice.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image Remarks

This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.

When the disposing parameter is true, this method releases all resources held by any managed objects that this GraphicsDevice references. This method invokes the Dispose method of each referenced object.

Note

Notes to Inheritors

Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects disposed of in an earlier call to Dispose.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DrawIndexedPrimitives Method

GraphicsDevice.DrawIndexedPrimitives Method

Renders the specified geometric primitive, based on indexing into an array of vertices.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawIndexedPrimitives (
         PrimitiveType primitiveType,
         int baseVertex,
         int minVertexIndex,
         int numVertices,
         int startIndex,
         int primitiveCount
)

Parameters

primitiveType
Describes the type of primitive to render. PrimitiveType.PointList is not supported with this method.
baseVertex
Offset to add to each vertex index in the index buffer.
minVertexIndex
Minimum vertex index for vertices used during the call. The minVertexIndex parameter and all of the indices in the index stream are relative to the baseVertex parameter.
numVertices
Number of vertices used during the call. The first vertex is located at index: baseVertex + minVertexIndex.
startIndex
Location in the index array at which to start reading vertices.
primitiveCount
Number of primitives to render. The number of vertices used is a function of primitiveCount and primitiveType.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | primitiveCount is less than or equal to zero. When drawing, at least one primitive must be drawn.
InvalidOperationException

One of the following conditions is true:

  • A valid vertex shader and pixel shader was not set before calling DrawIndexedPrimitives. Both a valid vertex shader and pixel shader (or valid effect) must be set on the device before any draw operations may be performed.
  • Indices is not a valid index buffer. A valid vertex buffer and a valid index buffer must be set on the device before any draw operations may be performed.
  • The active render target and depth stencil surface do not have the same pixel size and multisampling type.
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes.

Expand image Example

The vertex stream and index data of the graphics device must be set before any call to DrawIndexedPrimitives. The following example sets the index data; it associates a user-created vertex buffer of type VertexPositionNormalTexture with vertex stream 0 (zero) of the graphics device.

C#
// Initialize the vertex buffer, allocating memory for each vertex.
vertexBuffer = new VertexBuffer(graphics.GraphicsDevice, vertexDeclaration,
    points, BufferUsage.None);

// Set the vertex buffer data to the array of vertices.
vertexBuffer.SetData<VertexPositionColor>(pointList);

Expand image Remarks

This method draws indexed primitives from the current set of data input streams.

The minVertexIndex and numVertices parameters specify the range of vertex indices used for each call to DrawIndexedPrimitives. These vertex indices are used to optimize vertex processing of indexed primitives by processing a sequential range of vertices prior to indexing into them. Indices used during this call cannot reference any vertices outside this range.

If no index array is set, DrawIndexedPrimitives fails.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DrawInstancedPrimitives Method

GraphicsDevice.DrawInstancedPrimitives Method

Draws a series of instanced models.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawInstancedPrimitives (
         PrimitiveType primitiveType,
         int baseVertex,
         int minVertexIndex,
         int numVertices,
         int startIndex,
         int primitiveCount,
         int instanceCount
)

Parameters

primitiveType
The primitive type.
baseVertex
Offset to add to each vertex index in the index buffer.
minVertexIndex
Minimum vertex index for vertices used during the call. The minVertexIndex parameter and all of the indices in the index stream are relative to the baseVertex parameter.
numVertices
Number of vertices used during the call. The first vertex is located at index: baseVertex + minVertexIndex.
startIndex
Location in the index array at which to start reading vertices.
primitiveCount
Number of primitives to render. The number of vertices used is a function of primitiveCount and primitiveType.
instanceCount
Number of primitives to render.

Expand image Exceptions

Exception type | Condition
NotImplementedException | This method is not implemented for Windows Phone, which does not support instancing.

Expand image Remarks

This method provides a mechanism for gathering vertex shader input data from different streams at different frequencies (typically by interpreting one data stream as a per-instance world transform); this approach requires a custom shader to interpret the input data. For more information, see DrawInstancedPrimitives in XNA Game Studio 4.0.

Cited Works

"DrawInstancedPrimitives in XNA Game Studio 4.0." Shawn Hargreaves Blog. http://blogs.msdn.com/b/shawnhar/archive/2010/06/17/drawinstancedprimitives-in-xna-game-studio-4-0.aspx. June 2010.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DrawPrimitives Method

GraphicsDevice.DrawPrimitives Method

Renders a sequence of non-indexed geometric primitives of the specified type from the current set of data input streams.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawPrimitives (
         PrimitiveType primitiveType,
         int startVertex,
         int primitiveCount
)

Parameters

primitiveType
Describes the type of primitive to render.
startVertex
Index of the first vertex to load. Beginning at startVertex, the correct number of vertices is read out of the vertex buffer.
primitiveCount
Number of primitives to render. The primitiveCount is the number of primitives as determined by the primitive type. If it is a line list, each primitive has two vertices. If it is a triangle list, each primitive has three vertices.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | primitiveCount is less than or equal to zero. When drawing, at least one primitive must be drawn.
InvalidOperationException

One of the following conditions is true:

  • A valid vertex shader and pixel shader was not set before calling DrawPrimitives. Both a valid vertex shader and pixel shader (or valid effect) must be set on the device before any draw operations may be performed.
  • The active render target and depth stencil surface do not have the same pixel size and multisampling type.

Expand image Remarks

DrawPrimitives should not be called with a single triangle at a time.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DrawUserIndexedPrimitives Method

GraphicsDevice.DrawUserIndexedPrimitives Method

Renders geometric primitives.

Expand image Overload List

Name | Description
GraphicsDevice.DrawUserIndexedPrimitives (PrimitiveType, T[], Int32, Int32, Int16[], Int32, Int32) | Renders indexed primitives from a 16-bit index buffer and other related input parameters.
GraphicsDevice.DrawUserIndexedPrimitives (PrimitiveType, T[], Int32, Int32, Int16[], Int32, Int32, VertexDeclaration) | Renders indexed primitives from a 16-bit index buffer, a vertex declaration, and other related input parameters.
GraphicsDevice.DrawUserIndexedPrimitives (PrimitiveType, T[], Int32, Int32, Int32[], Int32, Int32) | Renders indexed primitives from a 32-bit index buffer and other related input parameters.
GraphicsDevice.DrawUserIndexedPrimitives (PrimitiveType, T[], Int32, Int32, Int32[], Int32, Int32, VertexDeclaration) | Renders indexed primitives from a 32-bit index buffer, a vertex declaration, and other related input parameters.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.DrawUserIndexedPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, Int16[], Int32, Int32)

GraphicsDevice.DrawUserIndexedPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, Int16[], Int32, Int32)
See Also
CollapseAll image

Renders indexed primitives from a 16-bit index buffer and other related input parameters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawUserIndexedPrimitives<T> (
         PrimitiveType primitiveType,
         T[] vertexData,
         int vertexOffset,
         int numVertices,
         short[] indexData,
         int indexOffset,
         int primitiveCount
) where T :

Type Parameters

T
Per-vertex data type.

Parameters

primitiveType
The primitive type.
vertexData
The vertex data.
vertexOffset
Offset (in bytes) from the beginning of the vertex buffer to the first vertex to draw.
numVertices
Number of vertices to draw.
indexData
The index data.
indexOffset
Offset (in bytes) from the beginning of the index buffer to the first index to use.
primitiveCount
Number of primitives to render.

Expand image Exceptions

Exception type | Condition
ArgumentException

One of the following conditions is true:

  • vertexOffset + numVertices is outside of the range of vertexData.
  • There are not enough indices in indexData based on the number of primitives requested by primitiveCount.
ArgumentNullException | vertexData or indexData is null.
ArgumentOutOfRangeException One of the following conditions is true:
  • indexOffset or vertexOffset is not in a range allowed by indexData or vertexData.
  • primitiveCount or numVertices is less than or equal to zero. When drawing, at least one primitive must be drawn.
InvalidOperationException

One of the following conditions is true:

  • A valid VertexDeclaration must be set on the device before any draw operations can be performed.
  • A valid vertex shader was not set before calling DrawUserIndexedPrimitives. A valid vertex shader or valid effect must be set on the device before any draw operations may be performed. See Creating a Basic Effect for more information about using an effect.
  • vertexData is not a valid vertex buffer, or indexData is not a valid index buffer. A valid vertex buffer (and a valid index buffer if you are using indexed primitives) must be set on the device before any draw operations may be performed.
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DrawUserIndexedPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, Int16[], Int32, Int32, VertexDeclaration)

GraphicsDevice.DrawUserIndexedPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, Int16[], Int32, Int32, VertexDeclaration)
See Also
CollapseAll image

Renders indexed primitives from a 16-bit index buffer, a vertex declaration, and other related input parameters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawUserIndexedPrimitives<T> (
         PrimitiveType primitiveType,
         T[] vertexData,
         int vertexOffset,
         int numVertices,
         short[] indexData,
         int indexOffset,
         int primitiveCount,
         VertexDeclaration vertexDeclaration
) where T : struct

Type Parameters

T
Per-vertex data type.

Parameters

primitiveType
The primitive type.
vertexData
The vertex data.
vertexOffset
Offset (in bytes) from the beginning of the vertex buffer to the first vertex to draw.
numVertices
Number of vertices to draw.
indexData
The index data.
indexOffset
Offset (in bytes) from the beginning of the index buffer to the first index to use.
primitiveCount
Number of primitives to render.
vertexDeclaration
The vertex declaration.

Expand image Exceptions

Exception type | Condition
ArgumentException

One of the following conditions is true:

  • vertexOffset + numVertices is outside of the range of vertexData.
  • There are not enough indices in indexData based on the number of primitives requested by primitiveCount.
ArgumentNullException | vertexData or indexData is null.
ArgumentOutOfRangeException One of the following conditions is true:
  • indexOffset or vertexOffset is not in a range allowed by indexData or vertexData.
  • primitiveCount or numVertices is less than or equal to zero. When drawing, at least one primitive must be drawn.
InvalidOperationException

One of the following conditions is true:

  • A valid VertexDeclaration must be set on the device before any draw operations can be performed.
  • A valid vertex shader was not set before calling DrawUserIndexedPrimitives. A valid vertex shader or valid effect must be set on the device before any draw operations may be performed. See Creating a Basic Effect for more information about using an effect.
  • vertexData is not a valid vertex buffer, or indexData is not a valid index buffer. A valid vertex buffer (and a valid index buffer if you are using indexed primitives) must be set on the device before any draw operations may be performed.
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DrawUserIndexedPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, Int32[], Int32, Int32)

GraphicsDevice.DrawUserIndexedPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, Int32[], Int32, Int32)
See Also
CollapseAll image

Renders indexed primitives from a 32-bit index buffer and other related input parameters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawUserIndexedPrimitives<T> (
         PrimitiveType primitiveType,
         T[] vertexData,
         int vertexOffset,
         int numVertices,
         int[] indexData,
         int indexOffset,
         int primitiveCount
) where T :

Type Parameters

T
Per-vertex data type.

Parameters

primitiveType
The primitive type.
vertexData
The vertex data.
vertexOffset
Offset (in bytes) from the beginning of the vertex buffer to the first vertex to draw.
numVertices
Number of vertices to draw.
indexData
The index data.
indexOffset
Offset (in bytes) from the beginning of the index buffer to the first index to use.
primitiveCount
Number of primitives to render.

Expand image Exceptions

Exception type | Condition
ArgumentException

One of the following conditions is true:

  • vertexOffset + numVertices is outside of the range of vertexData.
  • There are not enough indices in indexData based on the number of primitives requested by primitiveCount.
ArgumentNullException | vertexData or indexData is null.
ArgumentOutOfRangeException One of the following conditions is true:
  • indexOffset or vertexOffset is not in a range allowed by indexData or vertexData.
  • primitiveCount or numVertices is less than or equal to zero. When drawing, at least one primitive must be drawn.
InvalidOperationException

One of the following conditions is true:

  • A valid VertexDeclaration must be set on the device before any draw operations can be performed.
  • A valid vertex shader was not set before calling DrawUserIndexedPrimitives. A valid vertex shader or valid effect must be set on the device before any draw operations may be performed. See Creating a Basic Effect for more information about using an effect.
  • vertexData is not a valid vertex buffer, or indexData is not a valid index buffer. A valid vertex buffer (and a valid index buffer if you are using indexed primitives) must be set on the device before any draw operations may be performed.
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DrawUserIndexedPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, Int32[], Int32, Int32, VertexDeclaration)

GraphicsDevice.DrawUserIndexedPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, Int32[], Int32, Int32, VertexDeclaration)
See Also
CollapseAll image

Renders indexed primitives from a 32-bit index buffer, a vertex declaration, and other related input parameters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawUserIndexedPrimitives<T> (
         PrimitiveType primitiveType,
         T[] vertexData,
         int vertexOffset,
         int numVertices,
         int[] indexData,
         int indexOffset,
         int primitiveCount,
         VertexDeclaration vertexDeclaration
) where T : struct

Type Parameters

T
>Per-vertex data type.

Parameters

primitiveType
The primitive type.
vertexData
The vertex data.
vertexOffset
Offset (in bytes) from the beginning of the vertex buffer to the first vertex to draw.
numVertices
Number of vertices to draw.
indexData
The index data.
indexOffset
Offset (in bytes) from the beginning of the index buffer to the first index to use.
primitiveCount
Number of primitives to render.
vertexDeclaration
The vertex declaration.

Expand image Exceptions

Exception type | Condition
ArgumentException

One of the following conditions is true:

  • vertexOffset + numVertices is outside of the range of vertexData.
  • There are not enough indices in indexData based on the number of primitives requested by primitiveCount.
ArgumentNullException | vertexData or indexData is null.
ArgumentOutOfRangeException One of the following conditions is true:
  • indexOffset or vertexOffset is not in a range allowed by indexData or vertexData.
  • primitiveCount or numVertices is less than or equal to zero. When drawing, at least one primitive must be drawn.
InvalidOperationException

One of the following conditions is true:

  • A valid VertexDeclaration must be set on the device before any draw operations can be performed.
  • A valid vertex shader was not set before calling DrawUserIndexedPrimitives. A valid vertex shader or valid effect must be set on the device before any draw operations may be performed. See Creating a Basic Effect for more information about using an effect.
  • vertexData is not a valid vertex buffer, or indexData is not a valid index buffer. A valid vertex buffer (and a valid index buffer if you are using indexed primitives) must be set on the device before any draw operations may be performed.
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DrawUserPrimitives Method

GraphicsDevice.DrawUserPrimitives Method

Renders geometric primitives.

Expand image Overload List

Name | Description
GraphicsDevice.DrawUserPrimitives (PrimitiveType, T[], Int32, Int32) | Draws primitives.
GraphicsDevice.DrawUserPrimitives (PrimitiveType, T[], Int32, Int32, VertexDeclaration) | Draws primitives.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.DrawUserPrimitives Generic Method (PrimitiveType, T[], Int32, Int32)

GraphicsDevice.DrawUserPrimitives Generic Method (PrimitiveType, T[], Int32, Int32)
See Also
CollapseAll image

Draws primitives.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawUserPrimitives<T> (
         PrimitiveType primitiveType,
         T[] vertexData,
         int vertexOffset,
         int primitiveCount
) where T :

Type Parameters

T
Per-vertex data type.

Parameters

primitiveType
Describes the type of primitive to render.
vertexData
The vertex data.
vertexOffset
Offset (in vertices) from the beginning of the buffer to start reading data.
primitiveCount
Number of primitives to render.

Expand image Exceptions

Exception type | Condition
ArgumentException | vertexOffset + numVertices is outside of the range of vertexData.
ArgumentNullException | vertexData is null.
ArgumentOutOfRangeException

One of the following conditions is true:

  • primitiveCount is less than or equal to zero. When drawing, at least one primitive must be drawn.
  • vertexOffset is less than zero or greater than the length of vertexData.
InvalidOperationException

One of the following conditions is true:

  • A valid vertex shader and pixel shader was not set before calling DrawUserPrimitives. Both a valid vertex shader and pixel shader (or valid effect) must be set on the device before any draw operations may be performed.
  • vertexData is not a valid vertex buffer. A valid vertex buffer must be set on the device before any draw operations may be performed.

Expand image Remarks

This method is intended for use when drawing dynamic geometry specified by the user. It supports only a single vertex stream. The effect of this call is to use the provided vertex data pointer and stride for vertex stream 0. It is invalid to have the declaration of the current vertex shader refer to vertex streams other than stream 0.

The vertex data passed to DrawUserPrimitives does not need to persist after the call. Access to the data is completed before returning from the call.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DrawUserPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, VertexDeclaration)

GraphicsDevice.DrawUserPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, VertexDeclaration)
See Also
CollapseAll image

Draws primitives.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawUserPrimitives<T> (
         PrimitiveType primitiveType,
         T[] vertexData,
         int vertexOffset,
         int primitiveCount,
         VertexDeclaration vertexDeclaration
) where T : struct

Type Parameters

T
Per-vertex data type.

Parameters

primitiveType
Describes the type of primitive to render.
vertexData
The vertex data.
vertexOffset
Offset (in vertices) from the beginning of the buffer to start reading data.
primitiveCount
Number of primitives to render.
vertexDeclaration
The vertex declaration, which defines per-vertex data.

Expand image Exceptions

Exception type | Condition
ArgumentException | vertexOffset + numVertices is outside of the range of vertexData.
ArgumentNullException | vertexData is null.
ArgumentOutOfRangeException

One of the following conditions is true:

  • primitiveCount is less than or equal to zero. When drawing, at least one primitive must be drawn.
  • vertexOffset is less than zero or greater than the length of vertexData.
InvalidOperationException

One of the following conditions is true:

  • A valid vertex shader and pixel shader was not set before calling DrawUserPrimitives. Both a valid vertex shader and pixel shader (or valid effect) must be set on the device before any draw operations may be performed.
  • vertexData is not a valid vertex buffer. A valid vertex buffer must be set on the device before any draw operations may be performed.

Expand image Remarks

This method is intended for use when drawing dynamic geometry specified by the user. It supports only a single vertex stream. The effect of this call is to use the provided vertex data pointer and stride for vertex stream 0. It is invalid to have the declaration of the current vertex shader refer to vertex streams other than stream 0.

The vertex data passed to DrawUserPrimitives does not need to persist after the call. Access to the data is completed before returning from the call.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Finalize Method

GraphicsDevice.Finalize Method

Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image Remarks

This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is invoked automatically during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by the garbage collector.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.GetBackBufferData Method

GraphicsDevice.GetBackBufferData Method

Gets the contents of the back buffer.

Expand image Overload List

Name | Description
GraphicsDevice.GetBackBufferData (Nullable<Rectangle>, T[], Int32, Int32) | Gets the contents of the back buffer.
GraphicsDevice.GetBackBufferData (T[]) | Gets the contents of the back buffer.
GraphicsDevice.GetBackBufferData (T[], Int32, Int32) | Gets the contents of the back buffer.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.GetBackBufferData Generic Method (Nullable<Rectangle>, T[], Int32, Int32)

GraphicsDevice.GetBackBufferData Generic Method (Nullable<Rectangle>, T[], Int32, Int32)
See Also
CollapseAll image

Gets the contents of the back buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetBackBufferData<T> (
         Nullable<Rectangle> rect,
         T[] data,
         int startIndex,
         int elementCount
) where T : struct

Type Parameters

T
The type of the elements in the array.

Parameters

rect
The section of the back buffer to copy. null indicates the data will be copied from the entire back buffer.
data
Array of data.
startIndex
The first element to use.
elementCount
The number of elements to use.

Expand image Exceptions

Exception type | Condition
NotSupportedException | Profile does not support getting back buffer data.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.GetBackBufferData Generic Method (T[])

GraphicsDevice.GetBackBufferData Generic Method (T[])
See Also
CollapseAll image

Gets the contents of the back buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetBackBufferData<T> (
         T[] data
) where T : struct

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.GetBackBufferData Generic Method (T[], Int32, Int32)

GraphicsDevice.GetBackBufferData Generic Method (T[], Int32, Int32)
See Also
CollapseAll image

Gets the contents of the back buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetBackBufferData<T> (
         T[] data,
         int startIndex,
         int elementCount
) where T : struct

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.
startIndex
The first element to use.
elementCount
The number of elements to use.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.GetRenderTargets Method

GraphicsDevice.GetRenderTargets Method

Gets a render target surface.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTargetBinding[] GetRenderTargets ()

Return Value

An array of bound render targets.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | An invalid render target index was requested. On Xbox 360, there is only one render target available and renderTargetIndex must be zero.

Expand image Remarks

The GraphicsDevice can support multiple render targets.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.GetVertexBuffers Method

GraphicsDevice.GetVertexBuffers Method

Gets the vertex buffers.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexBufferBinding[] GetVertexBuffers ()

Return Value

An array of vertex buffers.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Present Method

GraphicsDevice.Present Method

Presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.

Expand image Overload List

Name | Description
GraphicsDevice.Present () | Presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.
GraphicsDevice.Present (Nullable<Rectangle>, Nullable<Rectangle>, IntPtr) | Specifies the window target for a presentation and presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.

Expand image Exceptions

Exception type | Condition
DeviceLostException | The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.

Expand image Remarks

If necessary, a stretch operation is applied to transfer the pixels within the source rectangle to the destination rectangle in the client area of the target window.

Expand image See Also

Reference

Reset
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.Present Method ()

GraphicsDevice.Present Method ()
See Also
CollapseAll image

Presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Present ()

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | Present was called after the GraphicsDevice was disposed.
DeviceLostException | The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.

Expand image See Also

Reference

Present
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Present Method (Nullable<Rectangle>, Nullable<Rectangle>, IntPtr)

GraphicsDevice.Present Method (Nullable<Rectangle>, Nullable<Rectangle>, IntPtr)
See Also
CollapseAll image

Specifies the window target for a presentation and presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Present (
         Nullable<Rectangle> sourceRectangle,
         Nullable<Rectangle> destinationRectangle,
         IntPtr overrideWindowHandle
)

Parameters

sourceRectangle
The source rectangle. If null, the entire source surface is presented. If the rectangle exceeds the source surface, the rectangle is clipped to the source surface.
destinationRectangle
The destination rectangle, in window client coordinates. If null, the entire client area is filled. If the rectangle exceeds the destination client area, the rectangle is clipped to the destination client area.
overrideWindowHandle
Destination window containing the client area that is the target for this presentation. If not specified, this is DeviceWindowHandle.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | Present was called after the GraphicsDevice was disposed.
DeviceLostException | The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Reset Method

GraphicsDevice.Reset Method

Resets the presentation parameters for the current GraphicsDevice.

Expand image Overload List

Name | Description
GraphicsDevice.Reset () | Resets the presentation parameters for the current GraphicsDevice.
GraphicsDevice.Reset (PresentationParameters) | Resets the current GraphicsDevice with the specified PresentationParameters.
GraphicsDevice.Reset (PresentationParameters, GraphicsAdapter) | Resets the specified Reset with the specified presentation parameters.

Expand image Exceptions

Exception type | Condition
DeviceLostException | The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
OutOfMemoryException | Direct3D could not allocate sufficient memory to complete the call.

Expand image Remarks

When switching to full screen mode, Microsoft Direct3D tries to find a desktop format that matches the back buffer format, so that back and front buffer formats are identical. This eliminates the need for color conversion.

Calling Reset causes all texture memory surfaces and state information to be lost, and managed textures to be flushed from video memory. Before calling Reset for a GraphicsDevice, an application should release any explicit render targets, depth stencil surfaces, additional swap chains, and default resources associated with the GraphicsDevice.

Swap chains are either full screen or windowed. If the new swap chain is full screen, the adapter is placed in the display mode that matches the new size.

A call to Reset fails if made on a different thread than the one used to create the GraphicsDevice being reset.

Pixel shaders and vertex shaders survive Reset calls for DirectX 9.0. They do not need to be re-created explicitly by the application.

Unknown can be specified for the windowed-mode back-buffer format when creating a GraphicsDevice and Reset. This means the application does not have to query the current desktop format before calling a GraphicsDevice constructor for windowed mode. For full screen mode, the back-buffer format must be specified.

When trying to reset more than one display adapter in a group, pass in an array of PresentationParameters objects, one for each display in the adapter group.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.Reset Method ()

GraphicsDevice.Reset Method ()
See Also
CollapseAll image

Resets the presentation parameters for the current GraphicsDevice.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Reset ()

Expand image Exceptions

Exception type | Condition
DeviceLostException | The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
OutOfMemoryException | Direct3D could not allocate sufficient memory to complete the call."

Expand image See Also

Reference

Reset
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Reset Method (PresentationParameters)

GraphicsDevice.Reset Method (PresentationParameters)
See Also
CollapseAll image

Resets the current GraphicsDevice with the specified PresentationParameters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Reset (
         PresentationParameters presentationParameters
)

Parameters

presentationParameters
Describes the new presentation parameters. This value cannot be null.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | presentationParameters is null.
DeviceLostException | The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
OutOfMemoryException | Direct3D could not allocate sufficient memory to complete the call.

Expand image See Also

Reference

Reset
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Reset Method (PresentationParameters, GraphicsAdapter)

GraphicsDevice.Reset Method (PresentationParameters, GraphicsAdapter)
See Also
CollapseAll image

Resets the specified Reset with the specified presentation parameters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Reset (
         PresentationParameters presentationParameters,
         GraphicsAdapter graphicsAdapter
)

Parameters

presentationParameters
Describes the new presentation parameters. This value cannot be null.
graphicsAdapter
The graphics device being reset.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | presentationParameters is null.
DeviceLostException | The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
OutOfMemoryException | Direct3D could not allocate sufficient memory to complete the call."

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.SetRenderTarget Method

GraphicsDevice.SetRenderTarget Method

Sets a new color buffer for a GraphicsDevice.

Expand image Overload List

Name | Description
GraphicsDevice.SetRenderTarget (RenderTarget2D) | Sets a new render target for this GraphicsDevice.
GraphicsDevice.SetRenderTarget (RenderTargetCube, CubeMapFace) | Sets a new render target for this GraphicsDevice.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.SetRenderTarget Method (RenderTarget2D)

GraphicsDevice.SetRenderTarget Method (RenderTarget2D)
See Also
CollapseAll image

Sets a new render target for this GraphicsDevice.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetRenderTarget (
         RenderTarget2D renderTarget
)

Parameters

renderTarget
A new render target for the device, or null to set the device render target to the back buffer of the device.

Expand image Exceptions

Exception type | Condition
ArgumentException | An invalid render target index was requested. On Xbox 360, there is only one render target available and renderTargetIndex must be zero.
ArgumentOutOfRangeException | The render target index must be within the valid range for this device.
ObjectDisposedException | SetRenderTarget was called after this renderTarget was disposed.

Expand image Remarks

The following restrictions apply when using this method.

  • The multisample type must be the same for the render target and the depth stencil surface.
  • The formats must be compatible for the render target and the depth stencil surface.
  • The size of the depth stencil surface must be greater than or equal to the size of the render target.

These restrictions are validated only when using the debug runtime when any of the GraphicsDevice drawing methods are called.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.SetRenderTarget Method (RenderTargetCube, CubeMapFace)

GraphicsDevice.SetRenderTarget Method (RenderTargetCube, CubeMapFace)
See Also
CollapseAll image

Sets a new render target for this GraphicsDevice.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetRenderTarget (
         RenderTargetCube renderTarget,
         CubeMapFace cubeMapFace
)

Parameters

renderTarget
A new render target for the device, or null to set the device render target to the back buffer of the device.
cubeMapFace
The cube map face type.

Expand image Exceptions

Exception type | Condition
ArgumentException | An invalid render target index was requested. On Xbox 360, there is only one render target available and renderTargetIndex must be zero.
ArgumentOutOfRangeException | The render target index must be within the valid range for this device.
ObjectDisposedException | SetRenderTarget was called after this renderTarget was disposed.

Expand image Remarks

The following restrictions apply when using this method.

  • The multisample type must be the same for the render target and the depth stencil surface.
  • The formats must be compatible for the render target and the depth stencil surface.
  • The size of the depth stencil surface must be greater than or equal to the size of the render target.

These restrictions are validated only when using the debug runtime when any of the GraphicsDevice drawing methods are called.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.SetRenderTargets Method

GraphicsDevice.SetRenderTargets Method

Sets an array of render targets.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetRenderTargets (
         params RenderTargetBinding[] renderTargets
)

Parameters

renderTargets
[ParamArrayAttribute] An array of render targets.

Expand image Exceptions

Exception type | Condition
NotSupportedException | The profile supports a maximum of 1 simultaneous render targets.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.SetVertexBuffer Method

GraphicsDevice.SetVertexBuffer Method

Sets or binds a vertex buffer to a device.

Expand image Overload List

Name | Description
GraphicsDevice.SetVertexBuffer (VertexBuffer) | Sets or binds a vertex buffer to the device.
GraphicsDevice.SetVertexBuffer (VertexBuffer, Int32) | Sets or binds a vertex buffer to the device.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.SetVertexBuffer Method (VertexBuffer)

GraphicsDevice.SetVertexBuffer Method (VertexBuffer)
See Also
CollapseAll image

Sets or binds a vertex buffer to the device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetVertexBuffer (
         VertexBuffer vertexBuffer
)

Parameters

vertexBuffer
A vertex buffer.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.SetVertexBuffer Method (VertexBuffer, Int32)

GraphicsDevice.SetVertexBuffer Method (VertexBuffer, Int32)
See Also
CollapseAll image

Sets or binds a vertex buffer to the device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetVertexBuffer (
         VertexBuffer vertexBuffer,
         int vertexOffset
)

Parameters

vertexBuffer
A vertex buffer.
vertexOffset
The offset (in bytes) from the beginning of the buffer.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.SetVertexBuffers Method

GraphicsDevice.SetVertexBuffers Method

Sets the vertex buffers.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetVertexBuffers (
         params VertexBufferBinding[] vertexBuffers
)

Parameters

vertexBuffers
[ParamArrayAttribute] An array of vertex buffers.

Expand image Exceptions

Exception type | Condition
NotSupportedException | The profile does not support the vertex texture format.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice Properties

GraphicsDevice Properties

Expand image Public Properties

 | Name | Description
Public Property | Adapter | Gets the graphics adapter.
Public Property | BlendFactor | Gets or sets the color used for a constant-blend factor during alpha blending. The default value is Color.White.
Public Property | BlendState | Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is BlendState.Opaque.
Public Property | DepthStencilState | Gets or sets a system-defined instance of a depth-stencil state object. The default value is DepthStencilState.Default.
Public Property | DisplayMode | Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.
Public Property | GraphicsDeviceStatus | Retrieves the status of the device.
Public Property | GraphicsProfile | Gets the graphics profile. The default value is GraphicsProfile.Reach.
Public Property | Indices | Gets or sets index data. The default value is null.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | MultiSampleMask | Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff).
Public Property | PresentationParameters | Gets the presentation parameters associated with this graphics device.
Public Property | RasterizerState | Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
Public Property | ReferenceStencil | Gets or sets a reference value for stencil testing. The default value is zero.
Public Property | SamplerStates | Retrieves a collection of SamplerState objects for the current GraphicsDevice.
Public Property | ScissorRectangle | Gets or sets the rectangle used for scissor testing. By default, the size matches the render target size.
Public Property | Textures | Returns the collection of textures that have been assigned to the texture stages of the device.
Public Property | VertexSamplerStates | Gets the collection of vertex sampler states.
Public Property | VertexTextures | Gets the collection of vertex textures that support texture lookup in the vertex shader using the texldl statement. The vertex engine contains four texture sampler stages.
Public Property | Viewport | Gets or sets a viewport identifying the portion of the render target to receive draw calls.

Expand image See Also

Reference

GraphicsDevice Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.Adapter Property

GraphicsDevice.Adapter Property

Gets the graphics adapter.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public GraphicsAdapter Adapter { get; }

Property Value

The graphics adapter.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.BlendFactor Property

GraphicsDevice.BlendFactor Property

Gets or sets the color used for a constant-blend factor during alpha blending. The default value is Color.White.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Color BlendFactor { get; set; }

Property Value

The color used for a constant-blend factor during alpha blending.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.BlendState Property

GraphicsDevice.BlendState Property

Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is BlendState.Opaque.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public BlendState BlendState { get; set; }

Property Value

A BlendState instance.

Expand image Exceptions

Exception type Condition
NotSupportedException One or more of the following is true:
  • ColorSourceBlend, ColorDestinationBlend, and AlphaSourceBlend must be set to the same value.
  • ColorBlendFunction and AlphaBlendFunction must be set to the same value.
  • ColorDestinationBlend must be set to Blend.
  • AlphaDestinationBlend must be set to Blend.
  • ColorSourceBlend and ColorDestinationBlend must be set to Blend.One when using BlendFunction.Min or BlendFunction.Max.
  • AlphaSourceBlend and AlphaDestinationBlend must be set to Blend.One when using BlendFunction.Min or BlendFunction.Max.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DepthStencilState Property

GraphicsDevice.DepthStencilState Property

Gets or sets a system-defined instance of a depth-stencil state object. The default value is DepthStencilState.Default.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DepthStencilState DepthStencilState { get; set; }

Property Value

A DepthStencilState instance.

Expand image See Also

Reference

DepthStencilState Class
DepthStencilState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DisplayMode Property

GraphicsDevice.DisplayMode Property
See Also Example
CollapseAll image

Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DisplayMode DisplayMode { get; }

Property Value

Data describing the display mode of the adapter, as opposed to the display mode of the GraphicsDevice, which may be inactive if the GraphicsDevice does not own full-screen mode.

Expand image Remarks

For a list of all supported display modes for an adapter, see the SupportedDisplayModes property.

Expand image Example

This simple example checks for a supported display mode and sets the back buffer dimensions to match the resolution of the desired display mode.

C#
public class Game1 : Microsoft.Xna.Framework.Game
{
    GraphicsDeviceManager graphics;

    public Game1()
    {
        graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content";

        graphics.PreparingDeviceSettings +=
            new EventHandler<PreparingDeviceSettingsEventArgs>(
            graphics_PreparingDeviceSettings);
    }

    /// <summary>
    /// Modifies the display mode for the graphics device
    /// when it is reset or recreated.
    /// </summary>
    void graphics_PreparingDeviceSettings(object sender,
        PreparingDeviceSettingsEventArgs e)
    {
        foreach (Microsoft.Xna.Framework.Graphics.DisplayMode displayMode
            in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes)
        {
            if (displayMode.Width == 640 && displayMode.Height == 480)
            {
                e.GraphicsDeviceInformation.PresentationParameters.
                    BackBufferFormat = displayMode.Format;
                e.GraphicsDeviceInformation.PresentationParameters.
                    BackBufferHeight = displayMode.Height;
                e.GraphicsDeviceInformation.PresentationParameters.
                    BackBufferWidth = displayMode.Width;
            }
        }
    }

Expand image See Also

Concepts

Xbox 360 Programming Considerations

Reference

GraphicsAdapter.SupportedDisplayModes Property
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.GraphicsDeviceStatus Property

GraphicsDevice.GraphicsDeviceStatus Property

Retrieves the status of the device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public GraphicsDeviceStatus GraphicsDeviceStatus { get; }

Property Value

Status of the device.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.GraphicsProfile Property

GraphicsDevice.GraphicsProfile Property

Gets the graphics profile. The default value is GraphicsProfile.Reach.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public GraphicsProfile GraphicsProfile { get; }

Property Value

The graphics profile.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Indices Property

GraphicsDevice.Indices Property

Gets or sets index data. The default value is null.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public IndexBuffer Indices { get; set; }

Property Value

Index data.

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | Indices was called after this GraphicsDevice was disposed.

Expand image Example

The vertex stream and index data of the graphics device must be set before any call to DrawIndexedPrimitives. The following example sets the index data; it associates a user-created vertex buffer of type VertexPositionNormalTexture with vertex stream 0 (zero) of the graphics device.

C#
// Initialize the vertex buffer, allocating memory for each vertex.
vertexBuffer = new VertexBuffer(graphics.GraphicsDevice, vertexDeclaration,
    points, BufferUsage.None);

// Set the vertex buffer data to the array of vertices.
vertexBuffer.SetData<VertexPositionColor>(pointList);

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.IsDisposed Property

GraphicsDevice.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.MultiSampleMask Property

GraphicsDevice.MultiSampleMask Property

Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int MultiSampleMask { get; set; }

Property Value

A bitmask value controlling write enables for the samples. Each bit in this mask, starting at the least-significant bit, controls modification of one of the samples in a multisample render target. This render state has no effect when rendering to a single sample buffer.

Expand image Remarks

This render state enables use of a multisample buffer as an accumulation buffer, doing multipass rendering of geometry where each pass updates a subset of samples.

Given n multisamples and k-enabled samples, the resulting intensity of the rendered image should be k/n. Each component RGB of every pixel is factored by k/n.

Expand image See Also

Reference

BlendState Class
BlendState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.PresentationParameters Property

GraphicsDevice.PresentationParameters Property

Gets the presentation parameters associated with this graphics device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public PresentationParameters PresentationParameters { get; }

Property Value

The presentation parameters associated with this graphics device.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.RasterizerState Property

GraphicsDevice.RasterizerState Property

Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RasterizerState RasterizerState { get; set; }

Property Value

Rasterizer state.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.ReferenceStencil Property

GraphicsDevice.ReferenceStencil Property

Gets or sets a reference value for stencil testing. The default value is zero.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int ReferenceStencil { get; set; }

Property Value

The stencil reference value.

Expand image Remarks

The reference value is compared (using the comparison function specified by StencilFunction) to the pixel data in the stencil buffer using the equation:

      ReferenceStencil StencilFunction (stencil buffer entry)

This comparison applies only to the bits marked enabled by the stencil mask. If the comparison is true, the stencil test passes and the pass operation (specified by the DepthStencilState.StencilPass Property) is performed.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.SamplerStates Property

GraphicsDevice.SamplerStates Property

Retrieves a collection of SamplerState objects for the current GraphicsDevice.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public SamplerStateCollection SamplerStates { get; }

Property Value

The sample states of this GraphicsDevice.

Expand image Remarks

This method returns the last sampler state that was set for the GraphicsDevice, or the default GraphicsDevice sampler state, if not previously set. Programmable shaders reference textures using the sampler number, which is set as the index of a GraphicsDevice.Textures.

Expand image See Also

Reference

GraphicsDevice.Textures Property
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.ScissorRectangle Property

GraphicsDevice.ScissorRectangle Property

Gets or sets the rectangle used for scissor testing. By default, the size matches the render target size.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Rectangle ScissorRectangle { get; set; }

Property Value

If scissor testing is enabled, the rendering area within the render target is defined.

Expand image Remarks

The scissor rectangle is used as a rectangular clipping region. Use ScissorTestEnable to enable scissor testing.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Textures Property

GraphicsDevice.Textures Property
See Also Example
CollapseAll image

Returns the collection of textures that have been assigned to the texture stages of the device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public TextureCollection Textures { get; }

Property Value

The texture collection.

Expand image Remarks

The collection of texture stage on the device contains one or more textures (all of the same type and dimensions) that can be accessed by shaders.
Note
At draw time, a texture cannot be simultaneously set as a render target and a texture at a stage.

Expand image Example

This C# code demonstrates the setting two elements of the Textures collection to two user-created Texture2D objects named firstTexture and secondTexture.

C#
graphics.GraphicsDevice.Textures[0] = firstTexture;
graphics.GraphicsDevice.Textures[1] = secondTexture;

In the effect file, these textures can be accessed by declaring two sampler variables and setting them to the sampler register numbers that correspond to the index in the texture collection.

Effect File (.fx)
sampler firstSampler : register(s0);
sampler secondSampler : register(s1);

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.VertexSamplerStates Property

GraphicsDevice.VertexSamplerStates Property

Gets the collection of vertex sampler states.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public SamplerStateCollection VertexSamplerStates { get; }

Property Value

The collection of vertex sampler states.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.VertexTextures Property

GraphicsDevice.VertexTextures Property

Gets the collection of vertex textures that support texture lookup in the vertex shader using the texldl statement. The vertex engine contains four texture sampler stages.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public TextureCollection VertexTextures { get; }

Property Value

Collection of vertex textures.

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Viewport Property

GraphicsDevice.Viewport Property
See Also Example
CollapseAll image

Gets or sets a viewport identifying the portion of the render target to receive draw calls.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Viewport Viewport { get; set; }

Property Value

The viewport to set or get.

Expand image Remarks

Viewport can be used to draw on part of the screen. It should be set before any geometry is drawn so the viewport parameters will take effect.

To draw multiple views within a scene, repeat setting Viewport and draw a geometry sequence for each view.

Expand image Example

This code sample demonstrates how to use the Viewport property to display different scenes to different parts of the screen.

C#
Viewport defaultViewport;
Viewport leftViewport;
Viewport rightViewport;
Matrix projectionMatrix;
Matrix halfprojectionMatrix;
protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);

    defaultViewport = GraphicsDevice.Viewport;
    leftViewport = defaultViewport;
    rightViewport = defaultViewport;
    leftViewport.Width = leftViewport.Width / 2;
    rightViewport.Width = rightViewport.Width / 2;
    rightViewport.X = leftViewport.Width;
    //            rightViewport.X = leftViewport.Width + 1;

    Ring = Content.Load<Model>("redtorus");

    projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
        MathHelper.PiOver4, 4.0f / 3.0f, 1.0f, 10000f);
    halfprojectionMatrix = Matrix.CreatePerspectiveFieldOfView(
        MathHelper.PiOver4, 2.0f / 3.0f, 1.0f, 10000f);
}

protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Viewport = defaultViewport;
    GraphicsDevice.Clear(Color.CornflowerBlue);

    GraphicsDevice.Viewport = leftViewport;
    DrawScene(gameTime, Camera1.ViewMatrix, halfprojectionMatrix);
    GraphicsDevice.Viewport = rightViewport;
    DrawScene(gameTime, Camera2.ViewMatrix, halfprojectionMatrix);

    base.Draw(gameTime);

}

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice Events

GraphicsDevice Events

Expand image Public Events

 | Name | Description
Public Event | DeviceLost | Occurs when a GraphicsDevice is about to be lost (for example, immediately before a reset).
Public Event | DeviceReset | Occurs after a GraphicsDevice is reset, allowing an application to recreate all resources.
Public Event | DeviceResetting | Occurs when a GraphicsDevice is resetting, allowing the application to cancel the default handling of the reset.
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime.
Public Event | ResourceCreated | Occurs when a resource is created.
Public Event | ResourceDestroyed | Occurs when a resource is destroyed.

Expand image See Also

Reference

GraphicsDevice Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsDevice.DeviceLost Event

GraphicsDevice.DeviceLost Event
See Also Example
CollapseAll image

Occurs when a GraphicsDevice is about to be lost (for example, immediately before a reset).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceLost

Expand image Example

To add an event handler that listens for DeviceLost, use the following C# code.

      [C#]
      GraphicsDevice.DeviceLost += new System.EventHandler( this.GraphicsDeviceLostEventHandler );

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DeviceReset Event

GraphicsDevice.DeviceReset Event

Occurs after a GraphicsDevice is reset, allowing an application to recreate all resources.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceReset

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.DeviceResetting Event

GraphicsDevice.DeviceResetting Event
See Also Example
CollapseAll image

Occurs when a GraphicsDevice is resetting, allowing the application to cancel the default handling of the reset.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceResetting

Expand image Example

To add an event handler that listens for DeviceResetting, use the following C# code.

      [C#]
      GraphicsDevice.DeviceResetting += new System.CancelEventHandler( this.GraphicsDeviceResettingEventHandler );

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.Disposing Event

GraphicsDevice.Disposing Event
See Also Example
CollapseAll image

Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Disposing

Expand image Remarks

IsDisposed indicates whether an object has been disposed.

Expand image Example

To add an event handler that listens for Disposing, use the following C# code.

      [C#]
      obj.Disposing += new System.EventHandler( this.OnDisposing );

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.ResourceCreated Event

GraphicsDevice.ResourceCreated Event

Occurs when a resource is created.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<ResourceCreatedEventArgs> ResourceCreated

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDevice.ResourceDestroyed Event

GraphicsDevice.ResourceDestroyed Event

Occurs when a resource is destroyed.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<ResourceDestroyedEventArgs> ResourceDestroyed

Expand image See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsDeviceStatus Enumeration

GraphicsDeviceStatus Enumeration

Describes the status of the device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum GraphicsDeviceStatus

Expand image Members

Member name | Description
Lost | The device has been lost.
Normal | The device is normal.
NotReset | The device has not been reset.

Expand image See Also

Reference

GraphicsDevice.GraphicsDeviceStatus Property
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsProfile Enumeration

GraphicsProfile Enumeration

Identifies the set of supported devices for the game based on device capabilities.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum GraphicsProfile

Expand image Members

Member name | Description
HiDef | Use the largest available set of graphic features and capabilities to target devices, such as an Xbox 360 console and a Windows-based computer, that have more enhanced graphic capabilities.
Reach | Use a limited set of graphic features and capabilities, allowing the game to support the widest variety of devices, including all Windows-based computers and Windows Phone.

Expand image Remarks

Use the reach profile to create a game for all supported platforms.

Expand image See Also

Reference

Microsoft.Xna.Framework.Graphics Namespace
GraphicsAdapter.IsProfileSupported Method
GraphicsAdapter.QueryBackBufferFormat Method
GraphicsAdapter.QueryRenderTargetFormat Method

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsResource Class

GraphicsResource Class
See Also Members
CollapseAll image

Queries and prepares resources.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public abstract class GraphicsResource : IDisposable

Expand image See Also

Reference

GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsResource Members

GraphicsResource Members
See Also Events Methods Properties
CollapseAll image

The following tables list the members exposed by the GraphicsResource type.

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | Gets the GraphicsDevice associated with this GraphicsResource.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | Name | Gets the name of the resource.
Public Property | Tag | Gets the resource tags for this resource.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | Gets a string representation of the current instance.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime.

Expand image See Also

Reference

GraphicsResource Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsResource Methods

GraphicsResource Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | Gets a string representation of the current instance.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GraphicsResource Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsResource.Dispose Method

GraphicsResource.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
GraphicsResource.Dispose () | Immediately releases the unmanaged resources used by this object.
GraphicsResource.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace


GraphicsResource.Dispose Method ()

GraphicsResource.Dispose Method ()
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image Remarks

Call Dispose when you are finished using the GraphicsResource. The Dispose method leaves the GraphicsResource in an unusable state. After calling Dispose, you must release all references to the GraphicsResource so the garbage collector can reclaim the memory that the GraphicsResource was occupying.

Note
Always call Dispose before you release your last reference to the GraphicsResource. Otherwise, the resources it is using will not be freed until the garbage collector calls the GraphicsResource object's Finalize method.

Expand image See Also

Reference

GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsResource.Dispose Method (Boolean)

GraphicsResource.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image Remarks

This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.

When the disposing parameter is true, this method releases all resources held by any managed objects that this GraphicsResource references. This method invokes the Dispose method of each referenced object.

Note

Notes to Inheritors

Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects disposed of in an earlier call to Dispose.

Expand image See Also

Reference

GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsResource.Finalize Method

GraphicsResource.Finalize Method

Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image Remarks

This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by the garbage collector.

Expand image See Also

Reference

GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsResource.ToString Method

GraphicsResource.ToString Method

Gets a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

A string that represents the object.

Expand image See Also

Reference

GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsResource Properties

GraphicsResource Properties

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | Gets the GraphicsDevice associated with this GraphicsResource.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | Name | Gets the name of the resource.
Public Property | Tag | Gets the resource tags for this resource.

Expand image See Also

Reference

GraphicsResource Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsResource.GraphicsDevice Property

GraphicsResource.GraphicsDevice Property

Gets the GraphicsDevice associated with this GraphicsResource.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public GraphicsDevice GraphicsDevice { get; }

Property Value

The GraphicsDevice associated with this GraphicsResource.

Expand image See Also

Reference

GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsResource.IsDisposed Property

GraphicsResource.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsResource.Name Property

GraphicsResource.Name Property

Gets the name of the resource.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Name { get; set; }

Property Value

The name of the resource.

Expand image See Also

Reference

GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsResource.Tag Property

GraphicsResource.Tag Property

Gets the resource tags for this resource.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Object Tag { get; set; }

Property Value

The resource tags.

Expand image See Also

Reference

GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GraphicsResource Events

GraphicsResource Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime.

Expand image See Also

Reference

GraphicsResource Class
Microsoft.Xna.Framework.Graphics Namespace


GraphicsResource.Disposing Event

GraphicsResource.Disposing Event

Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Disposing

Expand image See Also

Reference

GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectFog Interface

IEffectFog Interface

Gets or sets fog parameters for the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public interface IEffectFog

Expand image See Also

Reference

IEffectFog Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectFog Members

IEffectFog Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the IEffectFog type.

Expand image Public Properties

 | Name | Description
Public Property | FogColor | Gets or sets the fog color.
Public Property | FogEnabled | Enables or disables fog.
Public Property | FogEnd | Gets or sets the fog ending distance.
Public Property | FogStart | Gets or sets the fog ending distance.

Expand image See Also

Reference

IEffectFog Interface
Microsoft.Xna.Framework.Graphics Namespace


IEffectFog Properties

IEffectFog Properties

Expand image Public Properties

 | Name | Description
Public Property | FogColor | Gets or sets the fog color.
Public Property | FogEnabled | Enables or disables fog.
Public Property | FogEnd | Gets or sets the fog ending distance.
Public Property | FogStart | Gets or sets the fog ending distance.

Expand image See Also

Reference

IEffectFog Interface
Microsoft.Xna.Framework.Graphics Namespace


IEffectFog.FogColor Property

IEffectFog.FogColor Property

Gets or sets the fog color.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 FogColor { get; set; }

Property Value

Three-component color.

Expand image See Also

Reference

IEffectFog Interface
IEffectFog Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectFog.FogEnabled Property

IEffectFog.FogEnabled Property

Enables or disables fog.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool FogEnabled { get; set; }

Property Value

True to enable fog, false otherwise.

Expand image See Also

Reference

IEffectFog Interface
IEffectFog Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectFog.FogEnd Property

IEffectFog.FogEnd Property

Gets or sets the fog ending distance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogEnd { get; set; }

Property Value

The distance from the camera to stop adding fog.

Expand image See Also

Reference

IEffectFog Interface
IEffectFog Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectFog.FogStart Property

IEffectFog.FogStart Property

Gets or sets the fog ending distance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogStart { get; set; }

Property Value

The distance from the camera to start adding fog.

Expand image See Also

Reference

IEffectFog Interface
IEffectFog Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectLights Interface

IEffectLights Interface

Gets or sets lighting parameters for the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public interface IEffectLights

Expand image See Also

Reference

IEffectLights Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectLights Members

IEffectLights Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the IEffectLights type.

Expand image Public Properties

 | Name | Description
Public Property | AmbientLightColor | Gets or sets the ambient light color for the current effect.
Public Property | DirectionalLight0 | Gets the first directional light for the current effect.
Public Property | DirectionalLight1 | Gets the second directional light for the current effect.
Public Property | DirectionalLight2 | Gets the third directional light for the current effect.
Public Property | LightingEnabled Property | Enables or disables lighting in an IEffectLights.

Expand image Public Methods

 | Name | Description
Public Method | EnableDefaultLighting | Enables default lighting for the current effect.

Expand image See Also

Reference

IEffectLights Interface
Microsoft.Xna.Framework.Graphics Namespace


IEffectLights Methods

IEffectLights Methods

Expand image Public Methods

 | Name | Description
Public Method | EnableDefaultLighting | Enables default lighting for the current effect.

Expand image See Also

Reference

IEffectLights Interface
Microsoft.Xna.Framework.Graphics Namespace


IEffectLights.EnableDefaultLighting Method

IEffectLights.EnableDefaultLighting Method

Enables default lighting for the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void EnableDefaultLighting ()

Expand image Remarks

A basic effect implements per-vertex lighting using three directional lights.

Expand image See Also

Reference

IEffectLights Interface
IEffectLights Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectLights Properties

IEffectLights Properties

Expand image Public Properties

 | Name | Description
Public Property | AmbientLightColor | Gets or sets the ambient light color for the current effect.
Public Property | DirectionalLight0 | Gets the first directional light for the current effect.
Public Property | DirectionalLight1 | Gets the second directional light for the current effect.
Public Property | DirectionalLight2 | Gets the third directional light for the current effect.
Public Property | LightingEnabled Property | Enables or disables lighting in an IEffectLights.

Expand image See Also

Reference

IEffectLights Interface
Microsoft.Xna.Framework.Graphics Namespace


IEffectLights.AmbientLightColor Property

IEffectLights.AmbientLightColor Property

Gets or sets the ambient light color for the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 AmbientLightColor { get; set; }

Property Value

Three-component color.

Expand image See Also

Reference

IEffectLights Interface
IEffectLights Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectLights.DirectionalLight0 Property

IEffectLights.DirectionalLight0 Property

Gets the first directional light for the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight0 { get; }

Property Value

The directional light.

Expand image See Also

Reference

IEffectLights Interface
IEffectLights Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectLights.DirectionalLight1 Property

IEffectLights.DirectionalLight1 Property

Gets the second directional light for the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight1 { get; }

Property Value

The directional light.

Expand image See Also

Reference

IEffectLights Interface
IEffectLights Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectLights.DirectionalLight2 Property

IEffectLights.DirectionalLight2 Property

Gets the third directional light for the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight2 { get; }

Property Value

The directional light.

Expand image See Also

Reference

IEffectLights Interface
IEffectLights Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LightingEnabled Property

LightingEnabled Property

Enables or disables lighting in an IEffectLights.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool LightingEnabled { get; set; }

Property Value

True to enable lighting; false otherwise.

Expand image See Also

Reference

IEffectLights Interface
IEffectLights Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectMatrices Interface

IEffectMatrices Interface

Gets or sets transformation matrix parameters for the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public interface IEffectMatrices

Expand image See Also

Reference

IEffectMatrices Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectMatrices Members

IEffectMatrices Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the IEffectMatrices type.

Expand image Public Properties

 | Name | Description
Public Property | Projection | Gets or sets the projection matrix in the current effect.
Public Property | View | Gets or sets the view matrix in the current effect.
Public Property | World | Gets or sets the world matrix in the current effect.

Expand image See Also

Reference

IEffectMatrices Interface
Microsoft.Xna.Framework.Graphics Namespace


IEffectMatrices Properties

IEffectMatrices Properties

Expand image Public Properties

 | Name | Description
Public Property | Projection | Gets or sets the projection matrix in the current effect.
Public Property | View | Gets or sets the view matrix in the current effect.
Public Property | World | Gets or sets the world matrix in the current effect.

Expand image See Also

Reference

IEffectMatrices Interface
Microsoft.Xna.Framework.Graphics Namespace


IEffectMatrices.Projection Property

IEffectMatrices.Projection Property

Gets or sets the projection matrix in the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix Projection { get; set; }

Property Value

The projection transformation matrix.

Expand image See Also

Reference

IEffectMatrices Interface
IEffectMatrices Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectMatrices.View Property

IEffectMatrices.View Property

Gets or sets the view matrix in the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix View { get; set; }

Property Value

The view transformation matrix.

Expand image See Also

Reference

IEffectMatrices Interface
IEffectMatrices Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IEffectMatrices.World Property

IEffectMatrices.World Property

Gets or sets the world matrix in the current effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix World { get; set; }

Property Value

The world transformation matrix.

Expand image See Also

Reference

IEffectMatrices Interface
IEffectMatrices Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGraphicsDeviceService Interface

IGraphicsDeviceService Interface

Defines a mechanism for retrieving GraphicsDevice objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public interface IGraphicsDeviceService

Expand image See Also

Reference

GraphicsDeviceManager
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGraphicsDeviceService Members

IGraphicsDeviceService Members
See Also Events Properties
CollapseAll image

The following tables list the members exposed by the IGraphicsDeviceService type.

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | Retrieves a graphcs device.

Expand image Public Events

 | Name | Description
Public Event | DeviceCreated | The event that occurs when a graphics device is created.
Public Event | DeviceDisposing | The event that occurs when a graphics device is disposing.
Public Event | DeviceReset | The event that occurs when a graphics device is reset.
Public Event | DeviceResetting | The event that occurs when a graphics device is in the process of resetting.

Expand image See Also

Reference

IGraphicsDeviceService Interface
Microsoft.Xna.Framework.Graphics Namespace


IGraphicsDeviceService Properties

IGraphicsDeviceService Properties

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | Retrieves a graphcs device.

Expand image See Also

Reference

IGraphicsDeviceService Interface
Microsoft.Xna.Framework.Graphics Namespace


IGraphicsDeviceService.GraphicsDevice Property

IGraphicsDeviceService.GraphicsDevice Property

Retrieves a graphcs device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public GraphicsDevice GraphicsDevice { get; }

Property Value

A graphics device.

Expand image See Also

Reference

IGraphicsDeviceService Interface
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGraphicsDeviceService Events

IGraphicsDeviceService Events

Expand image Public Events

 | Name | Description
Public Event | DeviceCreated | The event that occurs when a graphics device is created.
Public Event | DeviceDisposing | The event that occurs when a graphics device is disposing.
Public Event | DeviceReset | The event that occurs when a graphics device is reset.
Public Event | DeviceResetting | The event that occurs when a graphics device is in the process of resetting.

Expand image See Also

Reference

IGraphicsDeviceService Interface
Microsoft.Xna.Framework.Graphics Namespace


IGraphicsDeviceService.DeviceCreated Event

IGraphicsDeviceService.DeviceCreated Event

The event that occurs when a graphics device is created.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceCreated

Expand image See Also

Reference

IGraphicsDeviceService Interface
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGraphicsDeviceService.DeviceDisposing Event

IGraphicsDeviceService.DeviceDisposing Event

The event that occurs when a graphics device is disposing.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceDisposing

Expand image See Also

Reference

IGraphicsDeviceService Interface
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGraphicsDeviceService.DeviceReset Event

IGraphicsDeviceService.DeviceReset Event

The event that occurs when a graphics device is reset.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceReset

Expand image See Also

Reference

IGraphicsDeviceService Interface
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IGraphicsDeviceService.DeviceResetting Event

IGraphicsDeviceService.DeviceResetting Event

The event that occurs when a graphics device is in the process of resetting.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> DeviceResetting

Expand image See Also

Reference

IGraphicsDeviceService Interface
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer Class

IndexBuffer Class
See Also Members
CollapseAll image

Describes the rendering order of the vertices in a vertex buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class IndexBuffer : GraphicsResource

Expand image Example

The vertex stream and index data of the graphics device must be set before any call to DrawIndexedPrimitives. The following example sets the index data; it associates a user-created vertex buffer of type VertexPositionNormalTexture with vertex stream 0 (zero) of the graphics device.

C#
// Initialize the vertex buffer, allocating memory for each vertex.
vertexBuffer = new VertexBuffer(graphics.GraphicsDevice, vertexDeclaration,
    points, BufferUsage.None);

// Set the vertex buffer data to the array of vertices.
vertexBuffer.SetData<VertexPositionColor>(pointList);

Expand image See Also

Reference

IndexBuffer Members
Indices
DrawUserIndexedPrimitives
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer Members

IndexBuffer Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the IndexBuffer type.

Expand image Public Constructors

 | Name | Description
Public Method | IndexBuffer | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | BufferUsage | Gets the state of the related BufferUsage enumeration.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IndexCount | Gets the number of indices in this buffer.
Public Property | IndexElementSize | Gets a value indicating the size of this index element.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | Overloaded. Gets the index buffer into an array.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Copies array data to the index buffer.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

IndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


IndexBuffer Constructor

IndexBuffer Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
IndexBuffer (GraphicsDevice, IndexElementSize, Int32, BufferUsage) | Initializes a new instance of the IndexBuffer class.
IndexBuffer (GraphicsDevice, Type, Int32, BufferUsage) | Initializes a new instance of the IndexBuffer class.

Expand image See Also

Reference

GraphicsDeviceManager.DeviceReset Event
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


IndexBuffer Constructor (GraphicsDevice, IndexElementSize, Int32, BufferUsage)

IndexBuffer Constructor (GraphicsDevice, IndexElementSize, Int32, BufferUsage)
See Also
CollapseAll image

Initializes a new instance of the IndexBuffer class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public IndexBuffer (
         GraphicsDevice graphicsDevice,
         IndexElementSize indexElementSize,
         int indexCount,
         BufferUsage usage
)

Parameters

graphicsDevice
The GraphicsDevice object to associate with the index buffer.
indexElementSize
The size (in bits) of each index.
indexCount
The number of indices.
usage
Behavior options.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | graphicsDevice is null.
ArgumentOutOfRangeException

One of the following conditions is true:

  • elementSize is an invalid value. elementSize must be either IndexElementSize.SixteenBits or IndexElementSize.ThirtyTwoBits.
  • sizeInBytes is not a valid value. sizeInBytes must be greater than zero, and a multiple of elementSize.
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes.
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

GraphicsDeviceManager.DeviceReset Event
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer Constructor (GraphicsDevice, Type, Int32, BufferUsage)

IndexBuffer Constructor (GraphicsDevice, Type, Int32, BufferUsage)
See Also
CollapseAll image

Initializes a new instance of the IndexBuffer class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public IndexBuffer (
         GraphicsDevice graphicsDevice,
         Type indexType,
         int indexCount,
         BufferUsage usage
)

Parameters

graphicsDevice
The GraphicsDevice object to associate with the index buffer.
indexType
The index value type.
indexCount
The number of indices.
usage
Behavior options.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | graphicsDevice is null.
ArgumentOutOfRangeException | The elementCount parameter is invalid. Index buffers can only be created for indices which are sixteen or thirty-two bits in length.
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes.
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

GraphicsDeviceManager.DeviceReset Event
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer Methods

IndexBuffer Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | Overloaded. Gets the index buffer into an array.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Copies array data to the index buffer.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

IndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


IndexBuffer.Dispose Method

IndexBuffer.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
IndexBuffer.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image Remarks

Call Dispose when you are finished using the IndexBuffer. The Dispose method leaves the IndexBuffer in an unusable state. After calling Dispose, you must release all references to the IndexBuffer so the garbage collector can reclaim the memory that the IndexBuffer was occupying.

Note
Always call Dispose before you release your last reference to the IndexBuffer. Otherwise, the resources it is using will not be freed until the garbage collector calls the IndexBuffer object's Finalize method.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


IndexBuffer.Dispose Method (Boolean)

IndexBuffer.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image Remarks

This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.

When the disposing parameter is true, this method releases all resources held by any managed objects that this IndexBuffer references. This method invokes the Dispose method of each referenced object.

Note

Notes to Inheritors

Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects disposed of in an earlier call to Dispose.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer.GetData Method

IndexBuffer.GetData Method

Gets the index buffer into an array.

Expand image Overload List

Name | Description
IndexBuffer.GetData (Int32, T[], Int32, Int32) | Gets a copy of the index buffer data, specifying the start index, starting offset, number of elements, and size of the elements.
IndexBuffer.GetData (T[]) | Gets a copy of the index buffer data.
IndexBuffer.GetData (T[], Int32, Int32) | Gets a copy of the index buffer data, specifying the start index and number of elements.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


IndexBuffer.GetData Generic Method (Int32, T[], Int32, Int32)

IndexBuffer.GetData Generic Method (Int32, T[], Int32, Int32)
See Also
CollapseAll image

Gets a copy of the index buffer data, specifying the start index, starting offset, number of elements, and size of the elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         int offsetInBytes,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of elements in the array.

Parameters

offsetInBytes
Offset in bytes from the beginning of the buffer to the data.
data
Array of data.
startIndex
Index of the first element to get.
elementCount
Number of elements to get.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null.
InvalidOperationException | The array specified in the data parameter is not the correct size for the amount of data requested.
NotSupportedException | This IndexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData on a resource that was created with BufferUsage.WriteOnly is not supported.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer.GetData Generic Method (T[])

IndexBuffer.GetData Generic Method (T[])
See Also
CollapseAll image

Gets a copy of the index buffer data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         T[] data
) where T : ValueType

Type Parameters

T
The type of elements in the array.

Parameters

data
Array of data.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null.
InvalidOperationException | The array specified in the data parameter is not the correct size for the amount of data requested.
NotSupportedException | This IndexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData on a resource that was created with BufferUsage.WriteOnly is not supported.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer.GetData Generic Method (T[], Int32, Int32)

IndexBuffer.GetData Generic Method (T[], Int32, Int32)
See Also
CollapseAll image

Gets a copy of the index buffer data, specifying the start index and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of elements in the array.

Parameters

data
Array of data.
startIndex
Index of the first element to get.
elementCount
Number of elements to get.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null.
InvalidOperationException | The array specified in the data parameter is not the correct size for the amount of data requested.
NotSupportedException | This IndexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData on a resource that was created with BufferUsage.WriteOnly is not supported.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer.SetData Method

IndexBuffer.SetData Method

Copies array data to the index buffer.

Expand image Overload List

Name | Description
IndexBuffer.SetData (Int32, T[], Int32, Int32) | Sets index buffer data, specifying the offset, start index and number of elements.
IndexBuffer.SetData (T[]) | Sets index buffer data.
IndexBuffer.SetData (T[], Int32, Int32) | Sets index buffer data, specifying the start index and number of elements.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


IndexBuffer.SetData Generic Method (Int32, T[], Int32, Int32)

IndexBuffer.SetData Generic Method (Int32, T[], Int32, Int32)
See Also
CollapseAll image

Sets index buffer data, specifying the offset, start index and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         int offsetInBytes,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

offsetInBytes
Offset in bytes from the beginning of the buffer to the data.
data
Array of data.
startIndex
Index of the first element to set.
elementCount
Number of elements to set.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer.SetData Generic Method (T[])

IndexBuffer.SetData Generic Method (T[])
See Also
CollapseAll image

Sets index buffer data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         T[] data
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.

Expand image Remarks

Caution

Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to vertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes. To avoid this potential issue, use DrawUserPrimitives or DynamicIndexBuffer as the preferred alternative to SetData for dynamic vertex generation.

This is because, in cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of embedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirements. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render target dimensions.

When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not available for modification until the GPU is finished with presenting the entire frame.

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Concepts

Predicated Tiling

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer.SetData Generic Method (T[], Int32, Int32)

IndexBuffer.SetData Generic Method (T[], Int32, Int32)
See Also
CollapseAll image

Sets index buffer data, specifying the start index and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.
startIndex
Index of the first element to set.
elementCount
Number of elements to set.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer Properties

IndexBuffer Properties

Expand image Public Properties

 | Name | Description
Public Property | BufferUsage | Gets the state of the related BufferUsage enumeration.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IndexCount | Gets the number of indices in this buffer.
Public Property | IndexElementSize | Gets a value indicating the size of this index element.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image See Also

Reference

IndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


IndexBuffer.BufferUsage Property

IndexBuffer.BufferUsage Property

Gets the state of the related BufferUsage enumeration.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public BufferUsage BufferUsage { get; }

Property Value

Indicates how the application uses buffer contents.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer.IndexCount Property

IndexBuffer.IndexCount Property

Gets the number of indices in this buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int IndexCount { get; }

Property Value

The number of indices.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexBuffer.IndexElementSize Property

IndexBuffer.IndexElementSize Property

Gets a value indicating the size of this index element.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public IndexElementSize IndexElementSize { get; }

Property Value

The size of this index element.

Expand image See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IndexElementSize Enumeration

IndexElementSize Enumeration

Defines the size of an element of an index buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum IndexElementSize

Expand image Members

Member name | Description
SixteenBits | Sixteen bits.
ThirtyTwoBits | Thirty-two bits.

Expand image See Also

Reference

IndexBuffer Constructor
IndexBuffer.IndexElementSize Property
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IVertexType Interface

IVertexType Interface

Vertex type interface which is implemented by a custom vertex type structure.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public interface IVertexType

Expand image See Also

Reference

IVertexType Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IVertexType Members

IVertexType Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the IVertexType type.

Expand image Public Properties

 | Name | Description
Public Property | VertexDeclaration | Vertex declaration, which defines per-vertex data.

Expand image See Also

Reference

IVertexType Interface
Microsoft.Xna.Framework.Graphics Namespace


IVertexType Properties

IVertexType Properties

Expand image Public Properties

 | Name | Description
Public Property | VertexDeclaration | Vertex declaration, which defines per-vertex data.

Expand image See Also

Reference

IVertexType Interface
Microsoft.Xna.Framework.Graphics Namespace


IVertexType.VertexDeclaration Property

IVertexType.VertexDeclaration Property

Vertex declaration, which defines per-vertex data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexDeclaration VertexDeclaration { get; }

Property Value

Vertex declaration.

Expand image See Also

Reference

IVertexType Interface
IVertexType Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Model Class

Model Class
See Also Members
CollapseAll image

Represents a 3D model composed of multiple ModelMesh objects which may be moved independently.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class Model

Expand image See Also

Reference

Model Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Model Members

Model Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Model type.

Expand image Public Properties

 | Name | Description
Public Property | Bones | Gets a collection of ModelBone objects which describe how each mesh in the Meshes collection for this model relates to its parent mesh.
Public Property | Meshes | Gets a collection of ModelMesh objects which compose the model. Each ModelMesh in a model may be moved independently and may be composed of multiple materials identified as ModelMeshPart objects.
Public Property | Root | Gets the root bone for this model.
Public Property | Tag | Gets or sets an object identifying this model.

Expand image Public Methods

 | Name | Description
Public Method | CopyAbsoluteBoneTransformsTo | Copies a transform of each bone in a model relative to all parent bones of the bone into a given array.
Public Method | CopyBoneTransformsFrom | Copies an array of transforms into each bone in the model.
Public Method | CopyBoneTransformsTo | Copies each bone transform relative only to the parent bone of the model to a given array.
Public Method | Draw | Render a model after applying the matrix transformations.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Model Class
Microsoft.Xna.Framework.Graphics Namespace


Model Methods

Model Methods

Expand image Public Methods

 | Name | Description
Public Method | CopyAbsoluteBoneTransformsTo | Copies a transform of each bone in a model relative to all parent bones of the bone into a given array.
Public Method | CopyBoneTransformsFrom | Copies an array of transforms into each bone in the model.
Public Method | CopyBoneTransformsTo | Copies each bone transform relative only to the parent bone of the model to a given array.
Public Method | Draw | Render a model after applying the matrix transformations.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Model Class
Microsoft.Xna.Framework.Graphics Namespace


Model.CopyAbsoluteBoneTransformsTo Method

Model.CopyAbsoluteBoneTransformsTo Method

Copies a transform of each bone in a model relative to all parent bones of the bone into a given array.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void CopyAbsoluteBoneTransformsTo (
         Matrix[] destinationBoneTransforms
)

Parameters

destinationBoneTransforms
The array to receive bone transforms.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationBoneTransforms is null.
ArgumentOutOfRangeException | destinationBoneTransforms is not the same size as Bones

Expand image Remarks

In an absolute transform, each bone is transformed according to the position of all parent bones.

This is the same as iterating the Bones collection and applying the transformation matrix of every parent of a ModelBone to the Transform property of each ModelBone and copying the results into an array that can be indexed into by the bone index.

An array of transformation matrices for the meshes of any model can be obtained by calling CopyAbsoluteBoneTransformsTo or CopyBoneTransformsTo. The resulting array contains the transforms that describe how each ModelMesh is located relative to one another in the Model. The transformation matrix that should be applied to each ModelMesh can be obtained using the index of the CopyAbsoluteBoneTransformsTo to retrieve a transformation matrix from this collection.

Expand image See Also

Reference

Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Model.CopyBoneTransformsFrom Method

Model.CopyBoneTransformsFrom Method

Copies an array of transforms into each bone in the model.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void CopyBoneTransformsFrom (
         Matrix[] sourceBoneTransforms
)

Parameters

sourceBoneTransforms
An array containing new bone transforms.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | sourceBoneTransforms is null.
ArgumentOutOfRangeException | sourceBoneTransforms is not the same size as Bones

Expand image See Also

Reference

Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Model.CopyBoneTransformsTo Method

Model.CopyBoneTransformsTo Method

Copies each bone transform relative only to the parent bone of the model to a given array.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void CopyBoneTransformsTo (
         Matrix[] destinationBoneTransforms
)

Parameters

destinationBoneTransforms
The array to receive bone transforms.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | destinationBoneTransforms is null.
ArgumentOutOfRangeException | destinationBoneTransforms is not the same size as Bones

Expand image Remarks

This is the same as iterating the Bones collection and copying the Transform property into an array that can be indexed into by the bone index.

An array of transformation matrices for the meshes of any model can be obtained by calling CopyAbsoluteBoneTransformsTo or CopyBoneTransformsTo. The resulting array contains the transforms that describe how each ModelMesh is located relative to one another in the Model. The transformation matrix that should be applied to each ModelMesh can be obtained using the index of the CopyBoneTransformsTo to retrieve a transformation matrix from this collection.

Expand image See Also

Reference

Model.CopyAbsoluteBoneTransformsTo Method
Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Model.Draw Method

Model.Draw Method

Render a model after applying the matrix transformations.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Draw (
         Matrix world,
         Matrix view,
         Matrix projection
)

Parameters

world
A world transformation matrix.
view
A view transformation matrix.
projection
A projection transformation matrix.

Expand image See Also

Reference

Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Model Properties

Model Properties

Expand image Public Properties

 | Name | Description
Public Property | Bones | Gets a collection of ModelBone objects which describe how each mesh in the Meshes collection for this model relates to its parent mesh.
Public Property | Meshes | Gets a collection of ModelMesh objects which compose the model. Each ModelMesh in a model may be moved independently and may be composed of multiple materials identified as ModelMeshPart objects.
Public Property | Root | Gets the root bone for this model.
Public Property | Tag | Gets or sets an object identifying this model.

Expand image See Also

Reference

Model Class
Microsoft.Xna.Framework.Graphics Namespace


Model.Bones Property

Model.Bones Property

Gets a collection of ModelBone objects which describe how each mesh in the Meshes collection for this model relates to its parent mesh.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelBoneCollection Bones { get; }

Property Value

A collection of ModelBone objects used by this model.

Expand image Remarks

Caution
Please note that the transforms contained in this collection of bones does not describe the cumulative relationship of each mesh relative to all of its parent meshes in the collection, just the immediate parent of the mesh. For this information, please see CopyAbsoluteBoneTransformsTo.

The transforms of each ModelBone in Bones can also be obtained using the CopyBoneTransformsTo method.

Expand image See Also

Reference

Model.CopyAbsoluteBoneTransformsTo Method
Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Model.Meshes Property

Model.Meshes Property

Gets a collection of ModelMesh objects which compose the model. Each ModelMesh in a model may be moved independently and may be composed of multiple materials identified as ModelMeshPart objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelMeshCollection Meshes { get; }

Property Value

A collection of ModelMesh objects used by this model.

Expand image See Also

Reference

Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Model.Root Property

Model.Root Property

Gets the root bone for this model.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelBone Root { get; }

Property Value

The root bone for this model.

Expand image See Also

Reference

Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Model.Tag Property

Model.Tag Property

Gets or sets an object identifying this model.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Object Tag { get; set; }

Property Value

An object identifying this model.

Expand image See Also

Reference

Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBone Class

ModelBone Class
See Also Members
CollapseAll image

Represents bone data for a model.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class ModelBone

Expand image See Also

Concepts

What Is a Model Bone?

Reference

ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBone Members

ModelBone Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the ModelBone type.

Expand image Public Properties

 | Name | Description
Public Property | Children | Gets a collection of bones that are children of this bone.
Public Property | Index | Gets the index of this bone in the Bones collection.
Public Property | Name | Gets the name of this bone.
Public Property | Parent | Gets the parent of this bone.
Public Property | Transform | Gets or sets the matrix used to transform this bone relative to its parent bone.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelBone Class
Microsoft.Xna.Framework.Graphics Namespace


ModelBone Methods

ModelBone Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelBone Class
Microsoft.Xna.Framework.Graphics Namespace


ModelBone Properties

ModelBone Properties

Expand image Public Properties

 | Name | Description
Public Property | Children | Gets a collection of bones that are children of this bone.
Public Property | Index | Gets the index of this bone in the Bones collection.
Public Property | Name | Gets the name of this bone.
Public Property | Parent | Gets the parent of this bone.
Public Property | Transform | Gets or sets the matrix used to transform this bone relative to its parent bone.

Expand image See Also

Reference

ModelBone Class
Microsoft.Xna.Framework.Graphics Namespace


ModelBone.Children Property

ModelBone.Children Property

Gets a collection of bones that are children of this bone.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelBoneCollection Children { get; }

Property Value

A collection of bones that are children of this bone.

Expand image See Also

Reference

ModelBone Class
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBone.Index Property

ModelBone.Index Property

Gets the index of this bone in the Bones collection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Index { get; }

Property Value

The index of this bone in the Bones collection.

Expand image See Also

Reference

ModelBone Class
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBone.Name Property

ModelBone.Name Property

Gets the name of this bone.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this bone.

Expand image See Also

Reference

ModelBone Class
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBone.Parent Property

ModelBone.Parent Property

Gets the parent of this bone.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelBone Parent { get; }

Property Value

The parent of this bone.

Expand image See Also

Reference

ModelBone Class
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBone.Transform Property

ModelBone.Transform Property

Gets or sets the matrix used to transform this bone relative to its parent bone.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix Transform { get; set; }

Property Value

The matrix used to transform this bone relative only to its parent bone.

Expand image Remarks

Caution
Please note that the transform described by Transform does not describe the cumulative relationship of each mesh relative to all of its parent meshes in a Model, just the immediate parent of the mesh. For this information, please see CopyAbsoluteBoneTransformsTo.

Expand image See Also

Reference

Model.CopyAbsoluteBoneTransformsTo Method
ModelBone Class
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBoneCollection Class

ModelBoneCollection Class
See Also Members
CollapseAll image

Represents a set of bones associated with a model.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class ModelBoneCollection : ReadOnlyCollection<ModelBone>

Expand image See Also

Reference

ModelBoneCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBoneCollection Members

ModelBoneCollection Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the ModelBoneCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | Overloaded. Retrieves a ModelBone from the collection.

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns a ModelBoneCollection.Enumerator that can iterate through a ModelBoneCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | Finds a bone with a given name if it exists in the collection.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelBoneCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelBoneCollection Methods

ModelBoneCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns a ModelBoneCollection.Enumerator that can iterate through a ModelBoneCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | Finds a bone with a given name if it exists in the collection.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelBoneCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelBoneCollection.GetEnumerator Method

ModelBoneCollection.GetEnumerator Method

Returns a ModelBoneCollection.Enumerator that can iterate through a ModelBoneCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Enumerator GetEnumerator ()

Return Value

The ModelBoneCollection.Enumerator of the bone collection.

Expand image See Also

Reference

ModelBoneCollection Class
ModelBoneCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBoneCollection.TryGetValue Method

ModelBoneCollection.TryGetValue Method

Finds a bone with a given name if it exists in the collection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool TryGetValue (
         string boneName,
         out ModelBone value
)

Parameters

boneName
The name of the bone to find.
value
[OutAttribute] The bone named boneName, if found.

Return Value

true if the named bone is found, otherwise false.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | boneName is null.

Expand image See Also

Reference

ModelBoneCollection Class
ModelBoneCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBoneCollection Properties

ModelBoneCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | Overloaded. Retrieves a ModelBone from the collection.

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

ModelBoneCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelBoneCollection.Item Property

ModelBoneCollection.Item Property

Retrieves a ModelBone from the collection.

Expand image Overload List

Name | Description
ModelBoneCollection.Item (String) | Retrieves a ModelBone from the collection, given the name of the bone.

Expand image See Also

Reference

ModelBoneCollection Class
ModelBoneCollection Members
Microsoft.Xna.Framework.Graphics Namespace


ModelBoneCollection.Item Property (String)

ModelBoneCollection.Item Property (String)
See Also
CollapseAll image

Retrieves a ModelBone from the collection, given the name of the bone.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelBone this [
         string boneName
] { get; }

Property Value

The ModelBone identified by boneName.

Expand image Exceptions

Exception type | Condition
KeyNotFoundException | boneName was not found in this ModelBoneCollection.

Expand image See Also

Reference

ModelBoneCollection Class
ModelBoneCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBoneCollection.Enumerator Structure

ModelBoneCollection.Enumerator Structure

Provides the ability to iterate through the bones in an ModelBoneCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public struct ModelBoneCollection.Enumerator : IEnumerator<ModelBone>, IDisposable, IEnumerator

Expand image See Also

Reference

ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBoneCollection.Enumerator Members

ModelBoneCollection.Enumerator Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the ModelBoneCollection.Enumerator type.

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the ModelBoneCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the ModelBoneCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the ModelBoneCollection as a Object.
Explicit Interface Implementation | System#Collections#IEnumerator#Reset | Sets the enumerator to its initial position, which is before the first element in the ModelBoneCollection.

Expand image See Also

Reference

ModelBoneCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelBoneCollection.Enumerator Methods

ModelBoneCollection.Enumerator Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the ModelBoneCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the ModelBoneCollection as a Object.
Explicit Interface Implementation | System#Collections#IEnumerator#Reset | Sets the enumerator to its initial position, which is before the first element in the ModelBoneCollection.

Expand image See Also

Reference

ModelBoneCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelBoneCollection.Enumerator.Dispose Method

ModelBoneCollection.Enumerator.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

ModelBoneCollection.Enumerator Structure
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBoneCollection.Enumerator.MoveNext Method

ModelBoneCollection.Enumerator.MoveNext Method

Advances the enumerator to the next element of the ModelBoneCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool MoveNext ()

Return Value

true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The collection was modified after the enumerator was created.

Expand image Remarks

After an enumerator is created or after a call to System#Collections#IEnumerator#Reset, an enumerator is positioned before the first element of the collection, and the first call to MoveNext moves the enumerator over the first element of the collection.

After the end of the collection is passed, subsequent calls to MoveNext return false until System#Collections#IEnumerator#Reset is called.

An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or System#Collections#IEnumerator#Reset throws an InvalidOperationException.

Expand image See Also

Reference

ModelBoneCollection.Enumerator Structure
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System#Collections#IEnumerator#Reset Method

System#Collections#IEnumerator#Reset Method

Sets the enumerator to its initial position, which is before the first element in the ModelBoneCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private void System#Collections#IEnumerator#Reset ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The collection was modified after the enumerator was created.

Expand image Remarks

An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or the System#Collections#IEnumerator#Reset throws an InvalidOperationException.

Note
Notes to Implementers: All calls to System#Collections#IEnumerator#Reset must result in the same state for the enumerator. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This invalidates the enumerator if the collection has been modified since the enumerator was created, which is consistent with MoveNext and Current.

Expand image See Also

Reference

ModelBoneCollection.Enumerator Structure
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBoneCollection.Enumerator Properties

ModelBoneCollection.Enumerator Properties

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the ModelBoneCollection.

Expand image See Also

Reference

ModelBoneCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelBoneCollection.Enumerator.Current Property

ModelBoneCollection.Enumerator.Current Property

Gets the current element in the ModelBoneCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelBone Current { get; }

Property Value

The current element in the ModelBoneCollection.

Expand image See Also

Reference

ModelBoneCollection.Enumerator Structure
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelBoneCollection.Enumerator.System.Collections.IEnumerator.Current Property

ModelBoneCollection.Enumerator.System.Collections.IEnumerator.Current Property
See Also
CollapseAll image

Gets the current element in the ModelBoneCollection as a Object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private Object System.Collections.IEnumerator.Current { get; }

Property Value

The current element in the ModelBoneCollection as an Object.

Expand image See Also

Reference

ModelBoneCollection.Enumerator Structure
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelEffectCollection Class

ModelEffectCollection Class
See Also Members
CollapseAll image

Represents a collection of effects associated with a model.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class ModelEffectCollection : ReadOnlyCollection<Effect>

Expand image See Also

Reference

ModelEffectCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelEffectCollection Members

ModelEffectCollection Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the ModelEffectCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns a ModelEffectCollection.Enumerator that can iterate through a ModelEffectCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelEffectCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelEffectCollection Methods

ModelEffectCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns a ModelEffectCollection.Enumerator that can iterate through a ModelEffectCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelEffectCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelEffectCollection.GetEnumerator Method

ModelEffectCollection.GetEnumerator Method

Returns a ModelEffectCollection.Enumerator that can iterate through a ModelEffectCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Enumerator GetEnumerator ()

Return Value

The ModelEffectCollection.Enumerator of the effect collection.

Expand image See Also

Reference

ModelEffectCollection Class
ModelEffectCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelEffectCollection Properties

ModelEffectCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

ModelEffectCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelEffectCollection.Enumerator Structure

ModelEffectCollection.Enumerator Structure

Provides the ability to iterate through the bones in an ModelEffectCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public struct ModelEffectCollection.Enumerator : IEnumerator<Effect>, IDisposable, IEnumerator

Expand image See Also

Reference

ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelEffectCollection.Enumerator Members

ModelEffectCollection.Enumerator Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the ModelEffectCollection.Enumerator type.

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the ModelEffectCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the ModelEffectCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the ModelEffectCollection as a Object.
Explicit Interface Implementation | System#Collections#IEnumerator#Reset | Sets the enumerator to its initial position, which is before the first element in the ModelEffectCollection.

Expand image See Also

Reference

ModelEffectCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelEffectCollection.Enumerator Methods

ModelEffectCollection.Enumerator Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the ModelEffectCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the ModelEffectCollection as a Object.
Explicit Interface Implementation | System#Collections#IEnumerator#Reset | Sets the enumerator to its initial position, which is before the first element in the ModelEffectCollection.

Expand image See Also

Reference

ModelEffectCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelEffectCollection.Enumerator.Dispose Method

ModelEffectCollection.Enumerator.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

ModelEffectCollection.Enumerator Structure
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelEffectCollection.Enumerator.MoveNext Method

ModelEffectCollection.Enumerator.MoveNext Method

Advances the enumerator to the next element of the ModelEffectCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool MoveNext ()

Return Value

true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The collection was modified after the enumerator was created.

Expand image Remarks

After an enumerator is created or after a call to System#Collections#IEnumerator#Reset, an enumerator is positioned before the first element of the collection, and the first call to MoveNext moves the enumerator over the first element of the collection.

After the end of the collection is passed, subsequent calls to MoveNext return false until System#Collections#IEnumerator#Reset is called.

An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or System#Collections#IEnumerator#Reset throws an InvalidOperationException.

Expand image See Also

Reference

ModelEffectCollection.Enumerator Structure
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System#Collections#IEnumerator#Reset Method

System#Collections#IEnumerator#Reset Method

Sets the enumerator to its initial position, which is before the first element in the ModelEffectCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private void System#Collections#IEnumerator#Reset ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The collection was modified after the enumerator was created.

Expand image Remarks

An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or the System#Collections#IEnumerator#Reset throws an InvalidOperationException.

Note
Notes to Implementers: All calls to System#Collections#IEnumerator#Reset must result in the same state for the enumerator. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This invalidates the enumerator if the collection has been modified since the enumerator was created, which is consistent with MoveNext and Current.

Expand image See Also

Reference

ModelEffectCollection.Enumerator Structure
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelEffectCollection.Enumerator Properties

ModelEffectCollection.Enumerator Properties

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the ModelEffectCollection.

Expand image See Also

Reference

ModelEffectCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelEffectCollection.Enumerator.Current Property

ModelEffectCollection.Enumerator.Current Property

Gets the current element in the ModelEffectCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Effect Current { get; }

Property Value

The current element in the ModelEffectCollection.

Expand image See Also

Reference

ModelEffectCollection.Enumerator Structure
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelEffectCollection.Enumerator.System.Collections.IEnumerator.Current Property

ModelEffectCollection.Enumerator.System.Collections.IEnumerator.Current Property
See Also
CollapseAll image

Gets the current element in the ModelEffectCollection as a Object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private Object System.Collections.IEnumerator.Current { get; }

Property Value

The current element in the ModelEffectCollection as a Object.

Expand image See Also

Reference

ModelEffectCollection.Enumerator Structure
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMesh Class

ModelMesh Class
See Also Members
CollapseAll image

Represents a mesh that is part of a Model.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class ModelMesh

Expand image See Also

Reference

ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMesh Members

ModelMesh Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the ModelMesh type.

Expand image Public Properties

 | Name | Description
Public Property | BoundingSphere | Gets the BoundingSphere that contains this mesh.
Public Property | Effects | Gets a collection of effects associated with this mesh.
Public Property | MeshParts | Gets the ModelMeshPart objects that make up this mesh. Each part of a mesh is composed of a set of primitives that share the same material.
Public Property | Name | Gets the name of this mesh.
Public Property | ParentBone | Gets the parent bone for this mesh. The parent bone of a mesh contains a transformation matrix that describes how the mesh is located relative to any parent meshes in a model.
Public Property | Tag | Gets or sets an object identifying this mesh.

Expand image Public Methods

 | Name | Description
Public Method | Draw | Draws all of the ModelMeshPart objects in this mesh, using their current Effect settings.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMesh Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMesh Methods

ModelMesh Methods

Expand image Public Methods

 | Name | Description
Public Method | Draw | Draws all of the ModelMeshPart objects in this mesh, using their current Effect settings.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMesh Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMesh.Draw Method

ModelMesh.Draw Method

Draws all of the ModelMeshPart objects in this mesh, using their current Effect settings.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Draw ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Effect is a null.

Expand image See Also

Reference

ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMesh Properties

ModelMesh Properties

Expand image Public Properties

 | Name | Description
Public Property | BoundingSphere | Gets the BoundingSphere that contains this mesh.
Public Property | Effects | Gets a collection of effects associated with this mesh.
Public Property | MeshParts | Gets the ModelMeshPart objects that make up this mesh. Each part of a mesh is composed of a set of primitives that share the same material.
Public Property | Name | Gets the name of this mesh.
Public Property | ParentBone | Gets the parent bone for this mesh. The parent bone of a mesh contains a transformation matrix that describes how the mesh is located relative to any parent meshes in a model.
Public Property | Tag | Gets or sets an object identifying this mesh.

Expand image See Also

Reference

ModelMesh Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMesh.BoundingSphere Property

ModelMesh.BoundingSphere Property

Gets the BoundingSphere that contains this mesh.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public BoundingSphere BoundingSphere { get; }

Property Value

The BoundingSphere that contains this mesh.

Expand image See Also

Reference

ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMesh.Effects Property

ModelMesh.Effects Property

Gets a collection of effects associated with this mesh.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelEffectCollection Effects { get; }

Property Value

A collection of effects associated with this mesh.

Expand image Remarks

ModelMesh.Effects is a shortcut for iterating over the MeshParts property of the ModelMesh and looking up the ModelMeshPart.Effect property of each ModelMeshPart.

ModelMesh.Effects is a collection of all the Effect properties of the for the MeshParts of this ModelMesh. Each ModelMeshPart has a single Effect which is a reference to one of the Effects of the parent ModelMesh property. By updating all the effects of the ModelMesh all of the effects of each ModelMeshPart are updated as well.

Expand image See Also

Reference

ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMesh.MeshParts Property

ModelMesh.MeshParts Property

Gets the ModelMeshPart objects that make up this mesh. Each part of a mesh is composed of a set of primitives that share the same material.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelMeshPartCollection MeshParts { get; }

Property Value

The ModelMeshPart objects that make up this mesh.

Expand image Remarks

It is not necessary to use this class directly. In advanced rendering scenarios, it is possible to draw using MeshParts properties in combination with the vertex and index buffers on ModelMesh. However, in most cases, ModelMesh.Draw will be sufficient.

Expand image See Also

Reference

ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMesh.Name Property

ModelMesh.Name Property

Gets the name of this mesh.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this mesh.

Expand image See Also

Reference

ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMesh.ParentBone Property

ModelMesh.ParentBone Property

Gets the parent bone for this mesh. The parent bone of a mesh contains a transformation matrix that describes how the mesh is located relative to any parent meshes in a model.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelBone ParentBone { get; }

Property Value

The parent bone for this mesh.

Expand image Remarks

An array of transformation matrices for the meshes of any model can be obtained by calling CopyAbsoluteBoneTransformsTo or CopyBoneTransformsTo. The resulting array contains the transforms that describe how each ModelMesh is located relative to one another in the Model. The transformation matrix that should be applied to each ModelMesh can be obtained using the index of the ParentBone to retrieve a transformation matrix from this collection.

Expand image See Also

Reference

ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMesh.Tag Property

ModelMesh.Tag Property

Gets or sets an object identifying this mesh.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Object Tag { get; set; }

Property Value

An object identifying this mesh.

Expand image See Also

Reference

ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshCollection Class

ModelMeshCollection Class
See Also Members
CollapseAll image

Represents a collection of ModelMesh objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class ModelMeshCollection : ReadOnlyCollection<ModelMesh>

Expand image See Also

Reference

ModelMeshCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshCollection Members

ModelMeshCollection Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the ModelMeshCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | Overloaded. Retrieves a ModelMesh from the collection.

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns a ModelMeshCollection.Enumerator that can iterate through a ModelMeshCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | Finds a mesh with a given name if it exists in the collection.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshCollection Methods

ModelMeshCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns a ModelMeshCollection.Enumerator that can iterate through a ModelMeshCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | Finds a mesh with a given name if it exists in the collection.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshCollection.GetEnumerator Method

ModelMeshCollection.GetEnumerator Method

Returns a ModelMeshCollection.Enumerator that can iterate through a ModelMeshCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Enumerator GetEnumerator ()

Return Value

The ModelMeshCollection.Enumerator of the mesh collection.

Expand image See Also

Reference

ModelMeshCollection Class
ModelMeshCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshCollection.TryGetValue Method

ModelMeshCollection.TryGetValue Method

Finds a mesh with a given name if it exists in the collection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool TryGetValue (
         string meshName,
         out ModelMesh value
)

Parameters

meshName
The name of the mesh to find.
value
[OutAttribute] The mesh named meshName, if found.

Return Value

true if the named mesh is found; false otherwise.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | meshName is null.

Expand image See Also

Reference

ModelMeshCollection Class
ModelMeshCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshCollection Properties

ModelMeshCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | Overloaded. Retrieves a ModelMesh from the collection.

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

ModelMeshCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshCollection.Item Property

ModelMeshCollection.Item Property

Retrieves a ModelMesh from the collection.

Expand image Overload List

Name | Description
ModelMeshCollection.Item (String) | Retrieves a ModelMesh from the collection, given the name of the mesh.

Expand image See Also

Reference

ModelMeshCollection Class
ModelMeshCollection Members
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshCollection.Item Property (String)

ModelMeshCollection.Item Property (String)
See Also
CollapseAll image

Retrieves a ModelMesh from the collection, given the name of the mesh.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelMesh this [
         string meshName
] { get; }

Property Value

The ModelMesh identified by meshName.

Expand image Exceptions

Exception type | Condition
KeyNotFoundException | meshName was not found in this ModelMeshCollection.

Expand image See Also

Reference

ModelMeshCollection Class
ModelMeshCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshCollection.Enumerator Structure

ModelMeshCollection.Enumerator Structure

Provides the ability to iterate through the bones in an ModelMeshCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public struct ModelMeshCollection.Enumerator : IEnumerator<ModelMesh>, IDisposable, IEnumerator

Expand image See Also

Reference

ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshCollection.Enumerator Members

ModelMeshCollection.Enumerator Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the ModelMeshCollection.Enumerator type.

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the ModelMeshCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the ModelMeshCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the ModelMeshCollection as a Object.
Explicit Interface Implementation | System#Collections#IEnumerator#Reset | Sets the enumerator to its initial position, which is before the first element in the ModelMeshCollection.

Expand image See Also

Reference

ModelMeshCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshCollection.Enumerator Methods

ModelMeshCollection.Enumerator Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the ModelMeshCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the ModelMeshCollection as a Object.
Explicit Interface Implementation | System#Collections#IEnumerator#Reset | Sets the enumerator to its initial position, which is before the first element in the ModelMeshCollection.

Expand image See Also

Reference

ModelMeshCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshCollection.Enumerator.Dispose Method

ModelMeshCollection.Enumerator.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

ModelMeshCollection.Enumerator Structure
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshCollection.Enumerator.MoveNext Method

ModelMeshCollection.Enumerator.MoveNext Method

Advances the enumerator to the next element of the ModelMeshCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool MoveNext ()

Return Value

true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The collection was modified after the enumerator was created.

Expand image Remarks

After an enumerator is created or after a call to System#Collections#IEnumerator#Reset, an enumerator is positioned before the first element of the collection, and the first call to MoveNext moves the enumerator over the first element of the collection.

After the end of the collection is passed, subsequent calls to MoveNext return false until System#Collections#IEnumerator#Reset is called.

An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or System#Collections#IEnumerator#Reset throws an InvalidOperationException.

Expand image See Also

Reference

ModelMeshCollection.Enumerator Structure
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System#Collections#IEnumerator#Reset Method

System#Collections#IEnumerator#Reset Method

Sets the enumerator to its initial position, which is before the first element in the ModelMeshCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private void System#Collections#IEnumerator#Reset ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The collection was modified after the enumerator was created.

Expand image Remarks

An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or the System#Collections#IEnumerator#Reset throws an InvalidOperationException.

Note
Notes to Implementers: All calls to System#Collections#IEnumerator#Reset must result in the same state for the enumerator. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This invalidates the enumerator if the collection has been modified since the enumerator was created, which is consistent with MoveNext and Current.

Expand image See Also

Reference

ModelMeshCollection.Enumerator Structure
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshCollection.Enumerator Properties

ModelMeshCollection.Enumerator Properties

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the ModelMeshCollection.

Expand image See Also

Reference

ModelMeshCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshCollection.Enumerator.Current Property

ModelMeshCollection.Enumerator.Current Property

Gets the current element in the ModelMeshCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelMesh Current { get; }

Property Value

The current element in the ModelMeshCollection.

Expand image See Also

Reference

ModelMeshCollection.Enumerator Structure
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshCollection.Enumerator.System.Collections.IEnumerator.Current Property

ModelMeshCollection.Enumerator.System.Collections.IEnumerator.Current Property
See Also
CollapseAll image

Gets the current element in the ModelMeshCollection as a Object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private Object System.Collections.IEnumerator.Current { get; }

Property Value

The current element in the ModelMeshCollection.

Expand image See Also

Reference

ModelMeshCollection.Enumerator Structure
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPart Class

ModelMeshPart Class
See Also Members
CollapseAll image

Represents a batch of geometry information to submit to the graphics device during rendering. Each ModelMeshPart is a subdivision of a ModelMesh object. The ModelMesh class is split into multiple ModelMeshPart objects, typically based on material information.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class ModelMeshPart

Expand image Remarks

It is not necessary to use this class directly. In advanced rendering scenarios, it is possible to draw using ModelMeshPart properties in combination with the vertex and index buffers on ModelMesh. However, in most cases, ModelMesh.Draw will be sufficient.

Expand image See Also

Reference

ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPart Members

ModelMeshPart Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the ModelMeshPart type.

Expand image Public Properties

 | Name | Description
Public Property | Effect | Gets or sets the material Effect for this mesh part.
Public Property | IndexBuffer | Gets the index buffer for this mesh part.
Public Property | NumVertices | Gets the number of vertices used during a draw call.
Public Property | PrimitiveCount | Gets the number of primitives to render.
Public Property | StartIndex | Gets the location in the index array at which to start reading vertices.
Public Property | Tag | Gets or sets an object identifying this model mesh part.
Public Property | VertexBuffer | Gets the vertex buffer for this mesh part.
Public Property | VertexOffset | Gets the offset (in vertices) from the top of vertex buffer.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshPart Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshPart Properties

ModelMeshPart Properties

Expand image Public Properties

 | Name | Description
Public Property | Effect | Gets or sets the material Effect for this mesh part.
Public Property | IndexBuffer | Gets the index buffer for this mesh part.
Public Property | NumVertices | Gets the number of vertices used during a draw call.
Public Property | PrimitiveCount | Gets the number of primitives to render.
Public Property | StartIndex | Gets the location in the index array at which to start reading vertices.
Public Property | Tag | Gets or sets an object identifying this model mesh part.
Public Property | VertexBuffer | Gets the vertex buffer for this mesh part.
Public Property | VertexOffset | Gets the offset (in vertices) from the top of vertex buffer.

Expand image See Also

Reference

ModelMeshPart Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshPart.Effect Property

ModelMeshPart.Effect Property
See Also Example
CollapseAll image

Gets or sets the material Effect for this mesh part.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Effect Effect { get; set; }

Property Value

The material effect for this mesh part.

Expand image Remarks

ModelMesh.Effects is a shortcut for iterating over the MeshParts property of the ModelMesh and looking up the ModelMeshPart.Effect property of each ModelMeshPart.

ModelMesh.Effects is a collection of all the Effect properties of the for the MeshParts of this ModelMesh. Each ModelMeshPart has a single Effect which is a reference to one of the Effects of the parent ModelMesh property. By updating all the effects of the ModelMesh all of the effects of each ModelMeshPart are updated as well.

Expand image Example

The Effect property can be used to assign a custom Effect to a model loaded with BasicEffect.

C#
public static void RemapModel(Model model, Effect effect)
{
    foreach (ModelMesh mesh in model.Meshes)
    {
        foreach (ModelMeshPart part in mesh.MeshParts)
        {
            part.Effect = effect;
        }
    }
}

Expand image See Also

Reference

ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPart.IndexBuffer Property

ModelMeshPart.IndexBuffer Property

Gets the index buffer for this mesh part.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public IndexBuffer IndexBuffer { get; }

Property Value

The index buffer.

Expand image See Also

Reference

ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPart.NumVertices Property

ModelMeshPart.NumVertices Property

Gets the number of vertices used during a draw call.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int NumVertices { get; }

Property Value

The number of vertices used during the call.

Expand image See Also

Reference

ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPart.PrimitiveCount Property

ModelMeshPart.PrimitiveCount Property

Gets the number of primitives to render.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int PrimitiveCount { get; }

Property Value

The number of primitives to render. The number of vertices used is a function of primitiveCount and primitiveType.

Expand image See Also

Reference

ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPart.StartIndex Property

ModelMeshPart.StartIndex Property

Gets the location in the index array at which to start reading vertices.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int StartIndex { get; }

Property Value

Location in the index array at which to start reading vertices.

Expand image See Also

Reference

ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPart.Tag Property

ModelMeshPart.Tag Property

Gets or sets an object identifying this model mesh part.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Object Tag { get; set; }

Property Value

An object identifying this model mesh part.

Expand image See Also

Reference

ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPart.VertexBuffer Property

ModelMeshPart.VertexBuffer Property

Gets the vertex buffer for this mesh part.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexBuffer VertexBuffer { get; }

Property Value

The vertex buffer.

Expand image See Also

Reference

ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPart.VertexOffset Property

ModelMeshPart.VertexOffset Property

Gets the offset (in vertices) from the top of vertex buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int VertexOffset { get; }

Property Value

The offset.

Expand image See Also

Reference

ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPartCollection Class

ModelMeshPartCollection Class
See Also Members
CollapseAll image

Represents a collection of ModelMeshPart objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class ModelMeshPartCollection : ReadOnlyCollection<ModelMeshPart>

Expand image See Also

Reference

ModelMeshPartCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPartCollection Members

ModelMeshPartCollection Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the ModelMeshPartCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns a ModelMeshPartCollection.Enumerator that can iterate through a ModelMeshPartCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshPartCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshPartCollection Methods

ModelMeshPartCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns a ModelMeshPartCollection.Enumerator that can iterate through a ModelMeshPartCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshPartCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshPartCollection.GetEnumerator Method

ModelMeshPartCollection.GetEnumerator Method

Returns a ModelMeshPartCollection.Enumerator that can iterate through a ModelMeshPartCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Enumerator GetEnumerator ()

Return Value

The ModelMeshPartCollection.Enumerator of the ModelMeshPart collection.

Expand image See Also

Reference

ModelMeshPartCollection Class
ModelMeshPartCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPartCollection Properties

ModelMeshPartCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

ModelMeshPartCollection Class
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshPartCollection.Enumerator Structure

ModelMeshPartCollection.Enumerator Structure

Provides the ability to iterate through the bones in an ModelMeshPartCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public struct ModelMeshPartCollection.Enumerator : IEnumerator<ModelMeshPart>, IDisposable, IEnumerator

Expand image See Also

Reference

ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPartCollection.Enumerator Members

ModelMeshPartCollection.Enumerator Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the ModelMeshPartCollection.Enumerator type.

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the ModelMeshPartCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the ModelMeshPartCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the ModelMeshPartCollection as a Object.
Explicit Interface Implementation | System#Collections#IEnumerator#Reset | Sets the enumerator to its initial position, which is before the first element in the ModelMeshPartCollection.

Expand image See Also

Reference

ModelMeshPartCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshPartCollection.Enumerator Methods

ModelMeshPartCollection.Enumerator Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the ModelMeshPartCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the ModelMeshPartCollection as a Object.
Explicit Interface Implementation | System#Collections#IEnumerator#Reset | Sets the enumerator to its initial position, which is before the first element in the ModelMeshPartCollection.

Expand image See Also

Reference

ModelMeshPartCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshPartCollection.Enumerator.Dispose Method

ModelMeshPartCollection.Enumerator.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

ModelMeshPartCollection.Enumerator Structure
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPartCollection.Enumerator.MoveNext Method

ModelMeshPartCollection.Enumerator.MoveNext Method

Advances the enumerator to the next element of the ModelMeshPartCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool MoveNext ()

Return Value

true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The collection was modified after the enumerator was created.

Expand image Remarks

After an enumerator is created or after a call to System#Collections#IEnumerator#Reset, an enumerator is positioned before the first element of the collection, and the first call to MoveNext moves the enumerator over the first element of the collection.

After the end of the collection is passed, subsequent calls to MoveNext return false until System#Collections#IEnumerator#Reset is called.

An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or System#Collections#IEnumerator#Reset throws an InvalidOperationException.

Expand image See Also

Reference

ModelMeshPartCollection.Enumerator Structure
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System#Collections#IEnumerator#Reset Method

System#Collections#IEnumerator#Reset Method

Sets the enumerator to its initial position, which is before the first element in the ModelMeshPartCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private void System#Collections#IEnumerator#Reset ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The collection was modified after the enumerator was created.

Expand image Remarks

An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or the System#Collections#IEnumerator#Reset throws an InvalidOperationException.

Note
Notes to Implementers: All calls to System#Collections#IEnumerator#Reset must result in the same state for the enumerator. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This invalidates the enumerator if the collection has been modified since the enumerator was created, which is consistent with MoveNext and Current.

Expand image See Also

Reference

ModelMeshPartCollection.Enumerator Structure
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPartCollection.Enumerator Properties

ModelMeshPartCollection.Enumerator Properties

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the ModelMeshPartCollection.

Expand image See Also

Reference

ModelMeshPartCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace


ModelMeshPartCollection.Enumerator.Current Property

ModelMeshPartCollection.Enumerator.Current Property

Gets the current element in the ModelMeshPartCollection.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ModelMeshPart Current { get; }

Property Value

The current element in the ModelMeshPartCollection.

Expand image See Also

Reference

ModelMeshPartCollection.Enumerator Structure
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ModelMeshPartCollection.Enumerator.System.Collections.IEnumerator.Current Property

ModelMeshPartCollection.Enumerator.System.Collections.IEnumerator.Current Property
See Also
CollapseAll image

Gets the current element in the ModelMeshPartCollection as a Object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private Object System.Collections.IEnumerator.Current { get; }

Property Value

The current element in the ModelBoneCollection as an Object.

Expand image See Also

Reference

ModelMeshPartCollection.Enumerator Structure
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoSuitableGraphicsDeviceException Class

NoSuitableGraphicsDeviceException Class
See Also Members
CollapseAll image

Thrown when no available graphics device fits the given device preferences.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class NoSuitableGraphicsDeviceException : Exception

Expand image See Also

Reference

NoSuitableGraphicsDeviceException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoSuitableGraphicsDeviceException Members

NoSuitableGraphicsDeviceException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the NoSuitableGraphicsDeviceException type.

Expand image Public Constructors

 | Name | Description
Public Method | NoSuitableGraphicsDeviceException | Overloaded. Create a new instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NoSuitableGraphicsDeviceException Class
Microsoft.Xna.Framework.Graphics Namespace


NoSuitableGraphicsDeviceException Constructor

NoSuitableGraphicsDeviceException Constructor

Create a new instance of this object.

Expand image Overload List

Name | Description
NoSuitableGraphicsDeviceException () | Create a new instance of this object.
NoSuitableGraphicsDeviceException (String) | Create a new instance of this object.
NoSuitableGraphicsDeviceException (String, Exception) | Create a new instance of this object.

Expand image See Also

Reference

NoSuitableGraphicsDeviceException Class
NoSuitableGraphicsDeviceException Members
Microsoft.Xna.Framework.Graphics Namespace


NoSuitableGraphicsDeviceException Constructor ()

NoSuitableGraphicsDeviceException Constructor ()
See Also
CollapseAll image

Create a new instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public NoSuitableGraphicsDeviceException ()

Expand image See Also

Reference

NoSuitableGraphicsDeviceException Class
NoSuitableGraphicsDeviceException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoSuitableGraphicsDeviceException Constructor (String)

NoSuitableGraphicsDeviceException Constructor (String)
See Also
CollapseAll image

Create a new instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public NoSuitableGraphicsDeviceException (
         string message
)

Parameters

message
A message that describes the error.

Expand image See Also

Reference

NoSuitableGraphicsDeviceException Class
NoSuitableGraphicsDeviceException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NoSuitableGraphicsDeviceException Constructor (String, Exception)

NoSuitableGraphicsDeviceException Constructor (String, Exception)
See Also
CollapseAll image

Create a new instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public NoSuitableGraphicsDeviceException (
         string message,
         Exception inner
)

Parameters

message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Expand image See Also

Reference

NoSuitableGraphicsDeviceException Class
NoSuitableGraphicsDeviceException Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


OcclusionQuery Class

OcclusionQuery Class
See Also Members
CollapseAll image

Used to perform an occlusion query against the latest drawn objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class OcclusionQuery : GraphicsResource

Expand image Remarks

An occlusion query is a technique that determines how many pixels were actually drawn during a set of draw calls. This is useful for certain rendering techniques and rendering optimizations.

An example of using this query follows:

      OcclusionQuery query = new OcclusionQuery(device);

      query.Begin();
      // Drawing simple objects, bounding areas, etc.
      query.End();

      // Do additional work here to provide enough time for the GPU to complete query execution.

      // Draw additional models
      if (query.IsComplete == true && query.PixelCount > 0)
      {
      // A non-zero pixel count means some of the low res model is visible
      // so let's draw the real version of it
      }

The number of non-occluded pixels (indicated by PixelCount) can differ based on the platform.

For Xbox 360 games, PixelCount represents the number of pixels modified by drawing. This includes GraphicsDevice.Clear calls and any drawing associated with sprite batches.

For Windows games, PixelCount represents the number of pixels that passed the depth and stencil tests. This does not include sprite batch drawing (because the depth test is turned off) or calls to GraphicsDevice.Clear.

To achieve consistent results across all platforms, use occlusion queries only when the depth buffer is enabled. In addition, avoid calling Clear or changing the assigned render target inside an occlusion query begin/end block.

Expand image See Also

Reference

OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


OcclusionQuery Members

OcclusionQuery Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the OcclusionQuery type.

Expand image Public Constructors

 | Name | Description
Public Method | OcclusionQuery | Initializes a new instance of OcclusionQuery with the specified device.

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsComplete | Gets a value that indicates if the occlusion query has completed.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | PixelCount | Gets the number of visible pixels.
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Public Methods

 | Name | Description
Public Method | Begin | Begins application of the query.
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | End | Ends the application of the query.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

OcclusionQuery Class
Microsoft.Xna.Framework.Graphics Namespace


OcclusionQuery Constructor

OcclusionQuery Constructor

Initializes a new instance of OcclusionQuery with the specified device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public OcclusionQuery (
         GraphicsDevice graphicsDevice
)

Parameters

graphicsDevice
The graphics device to associate with this query.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | graphicsDevice is null.
NotSupportedException | The profile does not support occlusion queries.
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


OcclusionQuery Methods

OcclusionQuery Methods

Expand image Public Methods

 | Name | Description
Public Method | Begin | Begins application of the query.
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | End | Ends the application of the query.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

OcclusionQuery Class
Microsoft.Xna.Framework.Graphics Namespace


OcclusionQuery.Begin Method

OcclusionQuery.Begin Method

Begins application of the query.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Begin ()

Expand image Exceptions

Exception type Condition
InvalidOperationException
  • Begin cannot be called again until End is called successfully.
  • Begin may not be called on this query object again before IsComplete is checked.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


OcclusionQuery.Dispose Method

OcclusionQuery.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
OcclusionQuery.Dispose (Boolean) | Releases the unmanaged resources used by Dispose and optionally releases the managed resources.

Expand image See Also

Reference

OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace


OcclusionQuery.Dispose Method (Boolean)

OcclusionQuery.Dispose Method (Boolean)
See Also
CollapseAll image

Releases the unmanaged resources used by Dispose and optionally releases the managed resources.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


OcclusionQuery.End Method

OcclusionQuery.End Method

Ends the application of the query.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void End ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Begin must be called successfully before End can be called.

Expand image See Also

Reference

OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


OcclusionQuery Properties

OcclusionQuery Properties

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsComplete | Gets a value that indicates if the occlusion query has completed.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | PixelCount | Gets the number of visible pixels.
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image See Also

Reference

OcclusionQuery Class
Microsoft.Xna.Framework.Graphics Namespace


OcclusionQuery.IsComplete Property

OcclusionQuery.IsComplete Property

Gets a value that indicates if the occlusion query has completed.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsComplete { get; }

Property Value

true if the query completed; otherwise false.

Expand image Remarks

If predicated tiling has been triggered for an Xbox 360 game, calls to IsComplete from within the tiling bracket always fail. Access this data by switching to a different render target or end the frame. This condition does not apply to games targeting the Windows platform.

Expand image See Also

Reference

OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


OcclusionQuery.PixelCount Property

OcclusionQuery.PixelCount Property

Gets the number of visible pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int PixelCount { get; }

Property Value

Number of visible pixels. Zero indicates full occlusion, which means the pixels are not visible from the current camera position.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The query data is not yet available. Use the IsComplete property to determine if the data is available before attempting to retrieve it.

Expand image Remarks

The number of non-occluded pixels (indicated by PixelCount) can differ based on the platform.

For Xbox 360 games, PixelCount represents the number of pixels modified by drawing. This includes GraphicsDevice.Clear calls and any drawing associated with sprite batches.

For Windows games, PixelCount represents the number of pixels that passed the depth and stencil tests. This does not include sprite batch drawing (because the depth test is turned off) or calls to GraphicsDevice.Clear.

To achieve consistent results across all platforms, use occlusion queries only when the depth buffer is enabled. In addition, avoid calling Clear or changing the assigned render target inside an occlusion query begin/end block.

Expand image See Also

Reference

OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters Class

PresentationParameters Class
See Also Members
CollapseAll image

Contains presentation parameters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SerializableAttribute]
public class PresentationParameters

Expand image See Also

Reference

PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters Members

PresentationParameters Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the PresentationParameters type.

Expand image Public Constructors

 | Name | Description
Public Method | PresentationParameters | Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | BackBufferFormat | Gets or sets the format of the back buffer.
Public Property | BackBufferHeight | Gets or sets a value indicating the height of the new swap chain's back buffer.
Public Property | BackBufferWidth | Gets or sets a value indicating the width of the new swap chain's back buffer.
Public Property | Bounds | Gets the size of this resource.
Public Property | DepthStencilFormat | Gets or sets the depth stencil data format.
Public Property | DeviceWindowHandle | Gets or sets the handle to the device window.
Public Property | DisplayOrientation | Gets or sets the orientation of the display. The default value is DisplayOrientation.Default, which means orientation is determined automatically from your BackBufferWidth and BackBufferHeight.
Public Property | IsFullScreen | Gets or sets a value indicating whether the application is in full screen mode.
Public Property | MultiSampleCount | Gets or sets a value indicating the number of sample locations during multisampling.
Public Property | PresentationInterval | Gets or sets the maximum rate at which the swap chain's back buffers can be presented to the front buffer.
Public Property | RenderTargetUsage | Gets or sets render target usage flags.

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a copy of this PresentationParameters object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PresentationParameters Class
Microsoft.Xna.Framework.Graphics Namespace


PresentationParameters Constructor

PresentationParameters Constructor

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public PresentationParameters ()

Expand image See Also

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters Methods

PresentationParameters Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a copy of this PresentationParameters object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PresentationParameters Class
Microsoft.Xna.Framework.Graphics Namespace


PresentationParameters.Clone Method

PresentationParameters.Clone Method

Creates a copy of this PresentationParameters object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public PresentationParameters Clone ()

Return Value

A copy of this PresentationParameters object.

Expand image See Also

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters Properties

PresentationParameters Properties

Expand image Public Properties

 | Name | Description
Public Property | BackBufferFormat | Gets or sets the format of the back buffer.
Public Property | BackBufferHeight | Gets or sets a value indicating the height of the new swap chain's back buffer.
Public Property | BackBufferWidth | Gets or sets a value indicating the width of the new swap chain's back buffer.
Public Property | Bounds | Gets the size of this resource.
Public Property | DepthStencilFormat | Gets or sets the depth stencil data format.
Public Property | DeviceWindowHandle | Gets or sets the handle to the device window.
Public Property | DisplayOrientation | Gets or sets the orientation of the display. The default value is DisplayOrientation.Default, which means orientation is determined automatically from your BackBufferWidth and BackBufferHeight.
Public Property | IsFullScreen | Gets or sets a value indicating whether the application is in full screen mode.
Public Property | MultiSampleCount | Gets or sets a value indicating the number of sample locations during multisampling.
Public Property | PresentationInterval | Gets or sets the maximum rate at which the swap chain's back buffers can be presented to the front buffer.
Public Property | RenderTargetUsage | Gets or sets render target usage flags.

Expand image See Also

Reference

PresentationParameters Class
Microsoft.Xna.Framework.Graphics Namespace


PresentationParameters.BackBufferFormat Property

PresentationParameters.BackBufferFormat Property

Gets or sets the format of the back buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public SurfaceFormat BackBufferFormat { get; set; }

Property Value

The format of the back buffer.

Expand image Remarks

For windowed applications, the back-buffer format no longer needs to match the display-mode format because color conversion can now be done by the hardware (if the hardware supports color conversion). The set of possible back-buffer formats is constrained, but the runtime will allow any valid back-buffer format to be presented to any desktop format. (There is the additional requirement that the device be operable in the desktop mode; devices typically do not operate in 8-bits-per-pixel modes.)

Full screen applications cannot do color conversion.

Caution

In cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of embedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirements. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render target dimensions. The format of the back buffer chosen with the BackBufferFormat property directly affects the size of the back buffer and may trigger predicated tiling.

Expand image See Also

Concepts

Predicated Tiling

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters.BackBufferHeight Property

PresentationParameters.BackBufferHeight Property

Gets or sets a value indicating the height of the new swap chain's back buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int BackBufferHeight { get; set; }

Property Value

The height of the back buffer, in pixels.

Expand image Remarks

If IsFullScreen is true, BackBufferHeight and BackBufferWidth must equal the width and height of one of the enumerated display modes found through SupportedDisplayModes. If IsFullScreen is false and either of these values is zero, the corresponding dimension of the client area of the DeviceWindowHandle (or the focus window, if DeviceWindowHandle is Zero) is taken.

Expand image See Also

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters.BackBufferWidth Property

PresentationParameters.BackBufferWidth Property

Gets or sets a value indicating the width of the new swap chain's back buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int BackBufferWidth { get; set; }

Property Value

The width of the back buffer, in pixels.

Expand image Remarks

If IsFullScreen is true, BackBufferHeight and BackBufferWidth must equal the width and height of one of the enumerated display modes found through SupportedDisplayModes. If IsFullScreen is false and either of these values is zero, the corresponding dimension of the client area of the DeviceWindowHandle (or the focus window, if DeviceWindowHandle is Zero) is taken.

Expand image See Also

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters.Bounds Property

PresentationParameters.Bounds Property

Gets the size of this resource.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Rectangle Bounds { get; }

Property Value

A bounding-box rectangle.

Expand image See Also

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters.DepthStencilFormat Property

PresentationParameters.DepthStencilFormat Property

Gets or sets the depth stencil data format.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DepthFormat DepthStencilFormat { get; set; }

Property Value

The data format.

Expand image See Also

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters.DeviceWindowHandle Property

PresentationParameters.DeviceWindowHandle Property

Gets or sets the handle to the device window.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public IntPtr DeviceWindowHandle { get; set; }

Property Value

The handle to the device window.

Expand image Remarks

The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during Present.

For a full screen application, this is a handle to the top window (which is the focus window). For applications that use multiple full screen devices (such as a multimonitor system), exactly one device can use the focus window as the device window. All other devices must have unique device windows.

For a windowed-mode application, this handle will be the default target window for Present. If this handle is Zero, the focus window will be taken.

Note that the runtime does not attempt to reflect user changes in window size. The back buffer is not implicitly reset when this window is reset. However, the Present method does automatically track window position changes.

Expand image See Also

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters.DisplayOrientation Property

PresentationParameters.DisplayOrientation Property

Gets or sets the orientation of the display. The default value is DisplayOrientation.Default, which means orientation is determined automatically from your BackBufferWidth and BackBufferHeight.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DisplayOrientation DisplayOrientation { get; set; }

Property Value

The orientation of the display.

Expand image Remarks

Windows Phone Specific Information
Orientation settings apply only to Windows Phone-based games.

Expand image See Also

Overview

Automatic Rotation and Scaling (Windows Phone)

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters.IsFullScreen Property

PresentationParameters.IsFullScreen Property

Gets or sets a value indicating whether the application is in full screen mode.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsFullScreen { get; set; }

Property Value

true if the application is running full screen; false if the application is running in a window.

Expand image See Also

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters.MultiSampleCount Property

PresentationParameters.MultiSampleCount Property

Gets or sets a value indicating the number of sample locations during multisampling.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int MultiSampleCount { get; set; }

Property Value

The number of sample locations.

Expand image See Also

Reference

PresentationParameters Class
PresentationParameters Members
PreparingDeviceSettings
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters.PresentationInterval Property

PresentationParameters.PresentationInterval Property

Gets or sets the maximum rate at which the swap chain's back buffers can be presented to the front buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public PresentInterval PresentationInterval { get; set; }

Property Value

The maximum rate at which the swap chain's back buffers can be presented to the front buffer.

Expand image See Also

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentationParameters.RenderTargetUsage Property

PresentationParameters.RenderTargetUsage Property

Gets or sets render target usage flags.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTargetUsage RenderTargetUsage { get; set; }

Property Value

Usage flags for the render target.

Expand image See Also

Reference

PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PresentInterval Enumeration

PresentInterval Enumeration

Defines flags that describe the relationship between the adapter refresh rate and the rate at which Present operations are completed.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum PresentInterval

Expand image Members

Member name | Description
Default | Equivalent to setting One.
One | The driver waits for the vertical retrace period (the runtime will beam trace to prevent tearing). Present operations are not affected more frequently than the screen refresh rate; the runtime completes one Present operation per adapter refresh period, at most. This option is always available for both windowed and full-screen swap chains.
Two | The driver waits for the vertical retrace period. Present operations are not affected more frequently than every second screen refresh.
Immediate | The runtime updates the window client area immediately, and might do so more than once during the adapter refresh period. Present operations might be affected immediately. This option is always available for both windowed and full-screen swap chains.

Expand image See Also

Reference

PresentationParameters.PresentationInterval Property
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PrimitiveType Enumeration

PrimitiveType Enumeration

Defines how vertex data is ordered.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum PrimitiveType

Expand image Members

Member name | Description
TriangleList | The data is ordered as a sequence of triangles; each triangle is described by three new vertices. Back-face culling is affected by the current winding-order render state.
TriangleStrip | The data is ordered as a sequence of triangles; each triangle is described by two new vertices and one vertex from the previous triangle. The back-face culling flag is flipped automatically on even-numbered triangles.
LineList | The data is ordered as a sequence of line segments; each line segment is described by two new vertices. The count may be any positive integer.
LineStrip | The data is ordered as a sequence of line segments; each line segment is described by one new vertex and the last vertex from the previous line seqment. The count may be any positive integer.

Expand image Remarks

A strip is often more efficient than a list because fewer vertices are duplicated.

Expand image See Also

Reference

GraphicsDevice.DrawIndexedPrimitives Method
GraphicsDevice.DrawPrimitives Method
GraphicsDevice.DrawUserIndexedPrimitives Method
GraphicsDevice.DrawUserPrimitives Method
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState Class

RasterizerState Class
See Also Members
CollapseAll image

Contains rasterizer state, which determines how to convert vector data (shapes) into raster data (pixels).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class RasterizerState : GraphicsResource

Expand image See Also

Reference

RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState Members

RasterizerState Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the RasterizerState type.

Expand image Public Constructors

 | Name | Description
Public Method | RasterizerState | Initializes a new instance of the rasterizer class.

Expand image Public Fields

Name | Description
CullClockwise | A built-in state object with settings for culling primitives with clockwise winding order.
CullCounterClockwise | A built-in state object with settings for culling primitives with counter-clockwise winding order.
CullNone | A built-in state object with settings for not culling any primitives.

Expand image Public Properties

 | Name | Description
Public Property | CullMode | Specifies the conditions for culling or removing triangles. The default value is CullMode.CounterClockwise.
Public Property | DepthBias | Sets or retrieves the depth bias for polygons, which is the amount of bias to apply to the depth of a primitive to alleviate depth testing problems for primitives of similar depth. The default value is 0.
Public Property | FillMode | The fill mode, which defines how a triangle is filled during rendering. The default is FillMode.Solid.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | MultiSampleAntiAlias | Enables or disables multisample antialiasing. The default is true.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | ScissorTestEnable | Enables or disables scissor testing. The default is false.
Public Property | SlopeScaleDepthBias | Gets or sets a bias value that takes into account the slope of a polygon. This bias value is applied to coplanar primitives to reduce aliasing and other rendering artifacts caused by z-fighting. The default is 0.
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

RasterizerState Class
Microsoft.Xna.Framework.Graphics Namespace


RasterizerState Fields

RasterizerState Fields

Expand image Public Fields

Name | Description
CullClockwise | A built-in state object with settings for culling primitives with clockwise winding order.
CullCounterClockwise | A built-in state object with settings for culling primitives with counter-clockwise winding order.
CullNone | A built-in state object with settings for not culling any primitives.

Expand image See Also

Reference

RasterizerState Class
Microsoft.Xna.Framework.Graphics Namespace


RasterizerState.CullClockwise Field

RasterizerState.CullClockwise Field

A built-in state object with settings for culling primitives with clockwise winding order.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly RasterizerState CullClockwise

Expand image Remarks

This built-in state object has the following settings:

CullMode = CullMode.CullClockwiseFace,

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState.CullCounterClockwise Field

RasterizerState.CullCounterClockwise Field

A built-in state object with settings for culling primitives with counter-clockwise winding order.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly RasterizerState CullCounterClockwise

Expand image Remarks

This built-in state object has the following settings:

CullMode = CullMode.CullCounterClockwiseFace,

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState.CullNone Field

RasterizerState.CullNone Field

A built-in state object with settings for not culling any primitives.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly RasterizerState CullNone

Expand image Remarks

This built-in state object has the following settings:

CullMode = CullMode.None,

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState Constructor

RasterizerState Constructor

Initializes a new instance of the rasterizer class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RasterizerState ()

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState Methods

RasterizerState Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

RasterizerState Class
Microsoft.Xna.Framework.Graphics Namespace


RasterizerState.Dispose Method

RasterizerState.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
RasterizerState.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace


RasterizerState.Dispose Method (Boolean)

RasterizerState.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState Properties

RasterizerState Properties

Expand image Public Properties

 | Name | Description
Public Property | CullMode | Specifies the conditions for culling or removing triangles. The default value is CullMode.CounterClockwise.
Public Property | DepthBias | Sets or retrieves the depth bias for polygons, which is the amount of bias to apply to the depth of a primitive to alleviate depth testing problems for primitives of similar depth. The default value is 0.
Public Property | FillMode | The fill mode, which defines how a triangle is filled during rendering. The default is FillMode.Solid.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | MultiSampleAntiAlias | Enables or disables multisample antialiasing. The default is true.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | ScissorTestEnable | Enables or disables scissor testing. The default is false.
Public Property | SlopeScaleDepthBias | Gets or sets a bias value that takes into account the slope of a polygon. This bias value is applied to coplanar primitives to reduce aliasing and other rendering artifacts caused by z-fighting. The default is 0.
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image See Also

Reference

RasterizerState Class
Microsoft.Xna.Framework.Graphics Namespace


RasterizerState.CullMode Property

RasterizerState.CullMode Property

Specifies the conditions for culling or removing triangles. The default value is CullMode.CounterClockwise.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public CullMode CullMode { get; set; }

Property Value

The culling mode to set or get.

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState.DepthBias Property

RasterizerState.DepthBias Property

Sets or retrieves the depth bias for polygons, which is the amount of bias to apply to the depth of a primitive to alleviate depth testing problems for primitives of similar depth. The default value is 0.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float DepthBias { get; set; }

Property Value

The amount of bias to apply to the depth of a primitive. The value ranges from 0 to 16 (inclusive).

Expand image Remarks

A polygon with a larger z-bias value appears in front of a polygon with a smaller value. For example, a polygon with a value of 1 is is appears drawn in front of a polygon with a value of 0.

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState.FillMode Property

RasterizerState.FillMode Property

The fill mode, which defines how a triangle is filled during rendering. The default is FillMode.Solid.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public FillMode FillMode { get; set; }

Property Value

Any value in the FillMode enumeration.

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState.MultiSampleAntiAlias Property

RasterizerState.MultiSampleAntiAlias Property

Enables or disables multisample antialiasing. The default is true.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool MultiSampleAntiAlias { get; set; }

Property Value

true to enable multisample antialiasing; false otherwise.

Expand image Remarks

When multisample antialiasing is enabled, full-scene antialiasing is performed by calculating sampling locations at different sample positions for each multiple sample. When disabled, each multiple sample is written with the same sample value (sampled at a pixel center) which allows non-antialiased rendering to a multisample buffer. This property has no effect when rendering to a buffer that does not support multisampling.

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState.ScissorTestEnable Property

RasterizerState.ScissorTestEnable Property

Enables or disables scissor testing. The default is false.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool ScissorTestEnable { get; set; }

Property Value

true to enable scissor testing; false otherwise.

Expand image Remarks

Scissor testing can improve drawing performance by only drawing triangles (or parts of triangles) that are contained within a ScissorRectangle.

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState.SlopeScaleDepthBias Property

RasterizerState.SlopeScaleDepthBias Property

Gets or sets a bias value that takes into account the slope of a polygon. This bias value is applied to coplanar primitives to reduce aliasing and other rendering artifacts caused by z-fighting. The default is 0.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float SlopeScaleDepthBias { get; set; }

Property Value

The sloped scale bias value.

Expand image Remarks

An application can help ensure that coplanar polygons are rendered properly by adding a bias to the z-values that the system uses when rendering sets of coplanar polygons. The following formula shows how to calculate the bias to be applied to coplanar primitives.

bias = (m × SlopeScaleDepthBias) + DepthBias

Where m is the maximum depth slope of the triangle being rendered, defined as:

m = max( abs(delta z / delta x), abs(delta z / delta y) )

Expand image See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RasterizerState Events

RasterizerState Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

RasterizerState Class
Microsoft.Xna.Framework.Graphics Namespace


RenderTarget2D Class

RenderTarget2D Class
See Also Members
CollapseAll image

Contains a 2D texture that can be used as a render target.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class RenderTarget2D : Texture2D

Expand image See Also

Reference

RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTarget2D Members

RenderTarget2D Members
See Also Constructors Events Properties
CollapseAll image

The following tables list the members exposed by the RenderTarget2D type.

Expand image Public Constructors

 | Name | Description
Public Method | RenderTarget2D | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | Bounds | (Inherited from Texture2D.)
Public Property | DepthStencilFormat | Gets the data format for the depth stencil data.
Public Property | Format | (Inherited from Texture.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | Height | (Inherited from Texture2D.)
Public Property | IsContentLost | Determines if the index buffer data has been lost due to a lost device event.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | (Inherited from Texture.)
Public Property | MultiSampleCount | Gets the number of sample locations during multisampling.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | RenderTargetUsage | Gets or sets the render target usage.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Width | (Inherited from Texture2D.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | (Overloaded. Inherited from Texture2D.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SaveAsJpeg | (Inherited from Texture2D.)
Public Method | SaveAsPng | (Inherited from Texture2D.)
Public Method | SetData | (Overloaded. Inherited from Texture2D.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | ContentLost | Occurs when resources are lost due to a lost device event.
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

RenderTarget2D Class
Microsoft.Xna.Framework.Graphics Namespace


RenderTarget2D Constructor

RenderTarget2D Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
RenderTarget2D (GraphicsDevice, Int32, Int32) | Creates an instance of this object.
RenderTarget2D (GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat, DepthFormat) | Creates an instance of this object.
RenderTarget2D (GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat, DepthFormat, Int32, RenderTargetUsage) | Creates an instance of this object.

Expand image See Also

Reference

RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace


RenderTarget2D Constructor (GraphicsDevice, Int32, Int32)

RenderTarget2D Constructor (GraphicsDevice, Int32, Int32)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTarget2D (
         GraphicsDevice graphicsDevice,
         int width,
         int height
)

Parameters

graphicsDevice
The graphics device to associate with this render target resource.
width
Width, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferWidth to get the current screen width.
height
Height, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferHeight to get the current screen height.

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTarget2D Constructor (GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat, DepthFormat)

RenderTarget2D Constructor (GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat, DepthFormat)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTarget2D (
         GraphicsDevice graphicsDevice,
         int width,
         int height,
         bool mipMap,
         SurfaceFormat preferredFormat,
         DepthFormat preferredDepthFormat
)

Parameters

graphicsDevice
The graphics device to associate with this render target resource.
width
Width, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferWidth to get the current screen width.
height
Height, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferHeight to get the current screen height.
mipMap
[MarshalAsAttribute(U1)] True to enable a full mipmap chain to be generated, false otherwise.
preferredFormat
Preferred format for the surface data. This is the format preferred by the application, which may or may not be available from the hardware.
preferredDepthFormat
Preferred format for the depth buffer. This is the format preferred by the application, which may or may not be available from the hardware.

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTarget2D Constructor (GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat, DepthFormat, Int32, RenderTargetUsage)

RenderTarget2D Constructor (GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat, DepthFormat, Int32, RenderTargetUsage)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTarget2D (
         GraphicsDevice graphicsDevice,
         int width,
         int height,
         bool mipMap,
         SurfaceFormat preferredFormat,
         DepthFormat preferredDepthFormat,
         int preferredMultiSampleCount,
         RenderTargetUsage usage
)

Parameters

graphicsDevice
The graphics device to associate with this render target resource.
width
Width, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferWidth to get the current screen width.
height
Height, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferHeight to get the current screen height.
mipMap
[MarshalAsAttribute(U1)] True to enable a full mipmap chain to be generated, false otherwise.
preferredFormat
Preferred format for the surface data. This is the format preferred by the application, which may or may not be available from the hardware.
preferredDepthFormat
Preferred format for the depth buffer. This is the format preferred by the application, which may or may not be available from the hardware.
preferredMultiSampleCount
The preferred number of multisample locations.
usage
Behavior options.

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTarget2D Methods

RenderTarget2D Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | (Overloaded. Inherited from Texture2D.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SaveAsJpeg | (Inherited from Texture2D.)
Public Method | SaveAsPng | (Inherited from Texture2D.)
Public Method | SetData | (Overloaded. Inherited from Texture2D.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

RenderTarget2D Class
Microsoft.Xna.Framework.Graphics Namespace


RenderTarget2D Properties

RenderTarget2D Properties

Expand image Public Properties

 | Name | Description
Public Property | Bounds | (Inherited from Texture2D.)
Public Property | DepthStencilFormat | Gets the data format for the depth stencil data.
Public Property | Format | (Inherited from Texture.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | Height | (Inherited from Texture2D.)
Public Property | IsContentLost | Determines if the index buffer data has been lost due to a lost device event.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | (Inherited from Texture.)
Public Property | MultiSampleCount | Gets the number of sample locations during multisampling.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | RenderTargetUsage | Gets or sets the render target usage.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Width | (Inherited from Texture2D.)

Expand image See Also

Reference

RenderTarget2D Class
Microsoft.Xna.Framework.Graphics Namespace


RenderTarget2D.DepthStencilFormat Property

RenderTarget2D.DepthStencilFormat Property

Gets the data format for the depth stencil data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DepthFormat DepthStencilFormat { get; }

Property Value

The data format of the depth data.

Expand image See Also

Reference

RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTarget2D.IsContentLost Property

RenderTarget2D.IsContentLost Property

Determines if the index buffer data has been lost due to a lost device event.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsContentLost { get; }

Property Value

True if the content was lost; false otherwise.

Expand image See Also

Reference

RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTarget2D.MultiSampleCount Property

RenderTarget2D.MultiSampleCount Property

Gets the number of sample locations during multisampling.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int MultiSampleCount { get; }

Property Value

The number of sample locations

Expand image See Also

Reference

RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTarget2D.RenderTargetUsage Property

RenderTarget2D.RenderTargetUsage Property

Gets or sets the render target usage.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTargetUsage RenderTargetUsage { get; }

Property Value

The usage which detemines how data is used.

Expand image See Also

Reference

RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTarget2D Events

RenderTarget2D Events

Expand image Public Events

 | Name | Description
Public Event | ContentLost | Occurs when resources are lost due to a lost device event.
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

RenderTarget2D Class
Microsoft.Xna.Framework.Graphics Namespace


RenderTarget2D.ContentLost Event

RenderTarget2D.ContentLost Event

Occurs when resources are lost due to a lost device event.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public virtual event EventHandler<EventArgs> ContentLost

Expand image See Also

Reference

RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetBinding Structure

RenderTargetBinding Structure

Binds an array of render targets.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public struct RenderTargetBinding

Expand image See Also

Reference

RenderTargetBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetBinding Members

RenderTargetBinding Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the RenderTargetBinding type.

Expand image Public Constructors

 | Name | Description
Public Method | RenderTargetBinding | Overloaded. Creates an instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | CubeMapFace | Gets one face of a cubemap.
Public Property | RenderTarget | Gets a 2D texture.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

RenderTargetBinding Structure
Microsoft.Xna.Framework.Graphics Namespace


RenderTargetBinding Constructor

RenderTargetBinding Constructor

Creates an instance of this class.

Expand image Overload List

Name | Description
RenderTargetBinding (RenderTarget2D) | Creates an instance of this object.
RenderTargetBinding (RenderTargetCube, CubeMapFace) | Creates an instance of this object.

Expand image See Also

Reference

RenderTargetBinding Structure
RenderTargetBinding Members
Microsoft.Xna.Framework.Graphics Namespace


RenderTargetBinding Constructor (RenderTarget2D)

RenderTargetBinding Constructor (RenderTarget2D)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTargetBinding (
         RenderTarget2D renderTarget
)

Parameters

renderTarget
Identifies a 2D render target.

Expand image See Also

Reference

RenderTargetBinding Structure
RenderTargetBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetBinding Constructor (RenderTargetCube, CubeMapFace)

RenderTargetBinding Constructor (RenderTargetCube, CubeMapFace)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTargetBinding (
         RenderTargetCube renderTarget,
         CubeMapFace cubeMapFace
)

Parameters

renderTarget
Identifies a cubemap render target.
cubeMapFace
Cubemap face.

Expand image See Also

Reference

RenderTargetBinding Structure
RenderTargetBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetBinding Methods

RenderTargetBinding Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

RenderTargetBinding Structure
Microsoft.Xna.Framework.Graphics Namespace


RenderTargetBinding Properties

RenderTargetBinding Properties

Expand image Public Properties

 | Name | Description
Public Property | CubeMapFace | Gets one face of a cubemap.
Public Property | RenderTarget | Gets a 2D texture.

Expand image See Also

Reference

RenderTargetBinding Structure
Microsoft.Xna.Framework.Graphics Namespace


RenderTargetBinding.CubeMapFace Property

RenderTargetBinding.CubeMapFace Property

Gets one face of a cubemap.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public CubeMapFace CubeMapFace { get; }

Property Value

A cubemap face.

Expand image See Also

Reference

RenderTargetBinding Structure
RenderTargetBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetBinding.RenderTarget Property

RenderTargetBinding.RenderTarget Property

Gets a 2D texture.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture RenderTarget { get; }

Property Value

A texture.

Expand image See Also

Reference

RenderTargetBinding Structure
RenderTargetBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetCube Class

RenderTargetCube Class
See Also Members
CollapseAll image

Represents a cubic texture resource that will be written to at the end of a render pass.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class RenderTargetCube : TextureCube

Expand image See Also

Reference

SetRenderTarget
GraphicsDeviceManager.DeviceReset Event
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetCube Members

RenderTargetCube Members
See Also Constructors Events Properties
CollapseAll image

The following tables list the members exposed by the RenderTargetCube type.

Expand image Public Constructors

 | Name | Description
Public Method | RenderTargetCube | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | DepthStencilFormat | Gets the depth format of this rendertarget.
Public Property | Format | (Inherited from Texture.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsContentLost | Determines if the data has been lost due to a lost device event.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | (Inherited from Texture.)
Public Property | MultiSampleCount | Gets the number of multisample locations.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | RenderTargetUsage | Gets the usage mode of this rendertarget.
Public Property | Size | (Inherited from TextureCube.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | (Overloaded. Inherited from TextureCube.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | (Overloaded. Inherited from TextureCube.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | ContentLost | Occurs when a resource is lost due to a device being lost.
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

RenderTargetCube Class
Microsoft.Xna.Framework.Graphics Namespace


RenderTargetCube Constructor

RenderTargetCube Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
RenderTargetCube (GraphicsDevice, Int32, Boolean, SurfaceFormat, DepthFormat) | Creates an instance of this object.
RenderTargetCube (GraphicsDevice, Int32, Boolean, SurfaceFormat, DepthFormat, Int32, RenderTargetUsage) | Creates an instance of this object.

Expand image See Also

Reference

RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace


RenderTargetCube Constructor (GraphicsDevice, Int32, Boolean, SurfaceFormat, DepthFormat)

RenderTargetCube Constructor (GraphicsDevice, Int32, Boolean, SurfaceFormat, DepthFormat)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTargetCube (
         GraphicsDevice graphicsDevice,
         int size,
         bool mipMap,
         SurfaceFormat preferredFormat,
         DepthFormat preferredDepthFormat
)

Parameters

graphicsDevice
The graphics device to associate with this render target resource.
size
The width and height of this cube texture resource, in pixels.
mipMap
[MarshalAsAttribute(U1)] True to generate a full mipmap chain, false otherwise.
preferredFormat
Preferred format of the surface data.
preferredDepthFormat
Preferred format of the depth data.

Expand image See Also

Reference

RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetCube Constructor (GraphicsDevice, Int32, Boolean, SurfaceFormat, DepthFormat, Int32, RenderTargetUsage)

RenderTargetCube Constructor (GraphicsDevice, Int32, Boolean, SurfaceFormat, DepthFormat, Int32, RenderTargetUsage)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTargetCube (
         GraphicsDevice graphicsDevice,
         int size,
         bool mipMap,
         SurfaceFormat preferredFormat,
         DepthFormat preferredDepthFormat,
         int preferredMultiSampleCount,
         RenderTargetUsage usage
)

Parameters

graphicsDevice
The graphics device to associate with this render target resource.
size
The width and height of this cube texture resource, in pixels.
mipMap
[MarshalAsAttribute(U1)] True to generate a full mipmap chain, false otherwise.
preferredFormat
Preferred format of the surface data.
preferredDepthFormat
Preferred format of the depth data.
preferredMultiSampleCount
Preferred number of sample locations during multisampling.
usage
Options identifying the behaviors of this texture resource.

Expand image See Also

Reference

RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetCube Methods

RenderTargetCube Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | (Overloaded. Inherited from TextureCube.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | (Overloaded. Inherited from TextureCube.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

RenderTargetCube Class
Microsoft.Xna.Framework.Graphics Namespace


RenderTargetCube Properties

RenderTargetCube Properties

Expand image Public Properties

 | Name | Description
Public Property | DepthStencilFormat | Gets the depth format of this rendertarget.
Public Property | Format | (Inherited from Texture.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsContentLost | Determines if the data has been lost due to a lost device event.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | (Inherited from Texture.)
Public Property | MultiSampleCount | Gets the number of multisample locations.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | RenderTargetUsage | Gets the usage mode of this rendertarget.
Public Property | Size | (Inherited from TextureCube.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image See Also

Reference

RenderTargetCube Class
Microsoft.Xna.Framework.Graphics Namespace


RenderTargetCube.DepthStencilFormat Property

RenderTargetCube.DepthStencilFormat Property

Gets the depth format of this rendertarget.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DepthFormat DepthStencilFormat { get; }

Property Value

The data format for the depth data.

Expand image See Also

Reference

RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetCube.IsContentLost Property

RenderTargetCube.IsContentLost Property

Determines if the data has been lost due to a lost device event.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool IsContentLost { get; }

Property Value

True if the data was lost; false otherwise.

Expand image See Also

Reference

RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetCube.MultiSampleCount Property

RenderTargetCube.MultiSampleCount Property

Gets the number of multisample locations.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int MultiSampleCount { get; }

Property Value

The number of multisample locations.

Expand image See Also

Reference

RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetCube.RenderTargetUsage Property

RenderTargetCube.RenderTargetUsage Property

Gets the usage mode of this rendertarget.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public RenderTargetUsage RenderTargetUsage { get; }

Property Value

The usage which determines how rendertarget data is used.

Expand image See Also

Reference

RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetCube Events

RenderTargetCube Events

Expand image Public Events

 | Name | Description
Public Event | ContentLost | Occurs when a resource is lost due to a device being lost.
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

RenderTargetCube Class
Microsoft.Xna.Framework.Graphics Namespace


RenderTargetCube.ContentLost Event

RenderTargetCube.ContentLost Event

Occurs when a resource is lost due to a device being lost.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public virtual event EventHandler<EventArgs> ContentLost

Expand image See Also

Reference

RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


RenderTargetUsage Enumeration

RenderTargetUsage Enumeration

Determines how render target data is used once a new render target is set.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum RenderTargetUsage

Expand image Members

Member name | Description
DiscardContents | Always clears the render target data.
PlatformContents | Either clears or keeps the data, depending on the current platform. On Xbox 360, the render target will discard contents. On PC, the render target will discard if multisampling is enabled, and preserve the contents if not.
PreserveContents | Always keeps the render target data.

Expand image See Also

Reference

Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ResourceCreatedEventArgs Class

ResourceCreatedEventArgs Class
See Also Members
CollapseAll image

Contains event data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class ResourceCreatedEventArgs : EventArgs

Expand image See Also

Reference

ResourceCreatedEventArgs Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ResourceCreatedEventArgs Members

ResourceCreatedEventArgs Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the ResourceCreatedEventArgs type.

Expand image Public Properties

 | Name | Description
Public Property | Resource | The object raising the event.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ResourceCreatedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace


ResourceCreatedEventArgs Methods

ResourceCreatedEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ResourceCreatedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace


ResourceCreatedEventArgs Properties

ResourceCreatedEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | Resource | The object raising the event.

Expand image See Also

Reference

ResourceCreatedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace


ResourceCreatedEventArgs.Resource Property

ResourceCreatedEventArgs.Resource Property

The object raising the event.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Object Resource { get; }

Property Value

The object raising the event.

Expand image See Also

Reference

ResourceCreatedEventArgs Class
ResourceCreatedEventArgs Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ResourceDestroyedEventArgs Class

ResourceDestroyedEventArgs Class
See Also Members
CollapseAll image

Arguments for a ResourceDestroyed event.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class ResourceDestroyedEventArgs : EventArgs

Expand image See Also

Reference

ResourceDestroyedEventArgs Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ResourceDestroyedEventArgs Members

ResourceDestroyedEventArgs Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the ResourceDestroyedEventArgs type.

Expand image Public Properties

 | Name | Description
Public Property | Name | Gets the name of the destroyed resource.
Public Property | Tag | Gets the resource manager tag of the destroyed resource.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ResourceDestroyedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace


ResourceDestroyedEventArgs Methods

ResourceDestroyedEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ResourceDestroyedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace


ResourceDestroyedEventArgs Properties

ResourceDestroyedEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | Name | Gets the name of the destroyed resource.
Public Property | Tag | Gets the resource manager tag of the destroyed resource.

Expand image See Also

Reference

ResourceDestroyedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace


ResourceDestroyedEventArgs.Name Property

ResourceDestroyedEventArgs.Name Property

Gets the name of the destroyed resource.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of the destroyed resource.

Expand image See Also

Reference

ResourceDestroyedEventArgs Class
ResourceDestroyedEventArgs Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ResourceDestroyedEventArgs.Tag Property

ResourceDestroyedEventArgs.Tag Property

Gets the resource manager tag of the destroyed resource.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Object Tag { get; }

Property Value

The resource manager tag of the destroyed resource.

Expand image See Also

Reference

ResourceDestroyedEventArgs Class
ResourceDestroyedEventArgs Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState Class

SamplerState Class
See Also Members
CollapseAll image

Contains sampler state, which determines how to sample texture data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class SamplerState : GraphicsResource

Expand image See Also

Reference

SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState Members

SamplerState Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the SamplerState type.

Expand image Public Constructors

 | Name | Description
Public Method | SamplerState | Initializes a new instance of the sampler state class.

Expand image Public Fields

Name | Description
AnisotropicClamp | Contains default state for anisotropic filtering and texture coordinate clamping.
AnisotropicWrap | Contains default state for anisotropic filtering and texture coordinate wrapping.
LinearClamp | Contains default state for linear filtering and texture coordinate clamping.
LinearWrap | Contains default state for linear filtering and texture coordinate wrapping.
PointClamp | Contains default state for point filtering and texture coordinate clamping.
PointWrap | Contains default state for point filtering and texture coordinate wrapping.

Expand image Public Properties

 | Name | Description
Public Property | AddressU | Gets or sets the texture-address mode for the u-coordinate.
Public Property | AddressV | Gets or sets the texture-address mode for the v-coordinate.
Public Property | AddressW | Gets or sets the texture-address mode for the w-coordinate.
Public Property | Filter | Gets or sets the type of filtering during sampling.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | MaxAnisotropy | Gets or sets the maximum anisotropy. The default value is 0.
Public Property | MaxMipLevel | Gets or sets the level of detail (LOD) index of the largest map to use.
Public Property | MipMapLevelOfDetailBias | Gets or sets the mipmap LOD bias. The default value is 0.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

SamplerState Class
Microsoft.Xna.Framework.Graphics Namespace


SamplerState Fields

SamplerState Fields

Built-in state objects with default sampler state.

Expand image Public Fields

Name | Description
AnisotropicClamp | Contains default state for anisotropic filtering and texture coordinate clamping.
AnisotropicWrap | Contains default state for anisotropic filtering and texture coordinate wrapping.
LinearClamp | Contains default state for linear filtering and texture coordinate clamping.
LinearWrap | Contains default state for linear filtering and texture coordinate wrapping.
PointClamp | Contains default state for point filtering and texture coordinate clamping.
PointWrap | Contains default state for point filtering and texture coordinate wrapping.

Expand image See Also

Reference

SamplerState Class
Microsoft.Xna.Framework.Graphics Namespace


SamplerState.AnisotropicClamp Field

SamplerState.AnisotropicClamp Field

Contains default state for anisotropic filtering and texture coordinate clamping.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly SamplerState AnisotropicClamp

Expand image Remarks

Thisbuilt-in state object has the following settings:

Filter = TextureFilter.Anisotropic,

AddressU = TextureAddressMode.Clamp,
AddressV = TextureAddressMode.Clamp,
AddressW = TextureAddressMode.Clamp,

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.AnisotropicWrap Field

SamplerState.AnisotropicWrap Field

Contains default state for anisotropic filtering and texture coordinate wrapping.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly SamplerState AnisotropicWrap

Expand image Remarks

This built-in state object has the following settings:

Filter = TextureFilter.Anisotropic,

AddressU = TextureAddressMode.Wrap,
AddressV = TextureAddressMode.Wrap,
AddressW = TextureAddressMode.Wrap,

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.LinearClamp Field

SamplerState.LinearClamp Field

Contains default state for linear filtering and texture coordinate clamping.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly SamplerState LinearClamp

Expand image Remarks

This built-in state object has the following settings:

Filter = TextureFilter.Linear,

AddressU = TextureAddressMode.Clamp,
AddressV = TextureAddressMode.Clamp,
AddressW = TextureAddressMode.Clamp,

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.LinearWrap Field

SamplerState.LinearWrap Field

Contains default state for linear filtering and texture coordinate wrapping.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly SamplerState LinearWrap

Expand image Remarks

This built-in state object has the following settings:

Filter = TextureFilter.Linear,

AddressU = TextureAddressMode.Wrap,
AddressV = TextureAddressMode.Wrap,
AddressW = TextureAddressMode.Wrap,

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.PointClamp Field

SamplerState.PointClamp Field

Contains default state for point filtering and texture coordinate clamping.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly SamplerState PointClamp

Expand image Remarks

This built-in state object has the following settings:

Filter = TextureFilter.Point,

AddressU = TextureAddressMode.Clamp,
AddressV = TextureAddressMode.Clamp,
AddressW = TextureAddressMode.Clamp,

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.PointWrap Field

SamplerState.PointWrap Field

Contains default state for point filtering and texture coordinate wrapping.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly SamplerState PointWrap

Expand image Remarks

This built-in state object has the following settings:

Filter = TextureFilter.Point,

AddressU = TextureAddressMode.Wrap,
AddressV = TextureAddressMode.Wrap,
AddressW = TextureAddressMode.Wrap,

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState Constructor

SamplerState Constructor

Initializes a new instance of the sampler state class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public SamplerState ()

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState Methods

SamplerState Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SamplerState Class
Microsoft.Xna.Framework.Graphics Namespace


SamplerState.Dispose Method

SamplerState.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
SamplerState.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace


SamplerState.Dispose Method (Boolean)

SamplerState.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState Properties

SamplerState Properties

Expand image Public Properties

 | Name | Description
Public Property | AddressU | Gets or sets the texture-address mode for the u-coordinate.
Public Property | AddressV | Gets or sets the texture-address mode for the v-coordinate.
Public Property | AddressW | Gets or sets the texture-address mode for the w-coordinate.
Public Property | Filter | Gets or sets the type of filtering during sampling.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | MaxAnisotropy | Gets or sets the maximum anisotropy. The default value is 0.
Public Property | MaxMipLevel | Gets or sets the level of detail (LOD) index of the largest map to use.
Public Property | MipMapLevelOfDetailBias | Gets or sets the mipmap LOD bias. The default value is 0.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image See Also

Reference

SamplerState Class
Microsoft.Xna.Framework.Graphics Namespace


SamplerState.AddressU Property

SamplerState.AddressU Property

Gets or sets the texture-address mode for the u-coordinate.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public TextureAddressMode AddressU { get; set; }

Property Value

Texture-address mode.

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.AddressV Property

SamplerState.AddressV Property

Gets or sets the texture-address mode for the v-coordinate.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public TextureAddressMode AddressV { get; set; }

Property Value

Texture-address mode.

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.AddressW Property

SamplerState.AddressW Property

Gets or sets the texture-address mode for the w-coordinate.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public TextureAddressMode AddressW { get; set; }

Property Value

Texture-address mode.

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.Filter Property

SamplerState.Filter Property

Gets or sets the type of filtering during sampling.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public TextureFilter Filter { get; set; }

Property Value

The texture filter.

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.MaxAnisotropy Property

SamplerState.MaxAnisotropy Property

Gets or sets the maximum anisotropy. The default value is 0.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int MaxAnisotropy { get; set; }

Property Value

The maximum anisotropy value.

Expand image Remarks

Use anisotropic filtering to reduce blur and aliasing effects when texturing a surface that will be viewed at an extreme viewing angle.

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.MaxMipLevel Property

SamplerState.MaxMipLevel Property

Gets or sets the level of detail (LOD) index of the largest map to use.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int MaxMipLevel { get; set; }

Property Value

The maximum LOD, which ranges from 0 to n-1, where n is the index of the largest map.

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState.MipMapLevelOfDetailBias Property

SamplerState.MipMapLevelOfDetailBias Property

Gets or sets the mipmap LOD bias. The default value is 0.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float MipMapLevelOfDetailBias { get; set; }

Property Value

The mipmap LOD bias, which ranges from -1.0 to +1.0.

Expand image Remarks

Mipmap LOD bias offsets the mipmap level from which a texture is sampled (the result is computed using trilinear texturing between the nearest two levels). A negative bias indicates a larger mipmap level; a positive bias indicates a smaller mipmap level.

Expand image See Also

Reference

SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerState Events

SamplerState Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

SamplerState Class
Microsoft.Xna.Framework.Graphics Namespace


SamplerStateCollection Class

SamplerStateCollection Class
See Also Members
CollapseAll image

Collection of SamplerState objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class SamplerStateCollection

Expand image See Also

Reference

SamplerStateCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SamplerStateCollection Members

SamplerStateCollection Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the SamplerStateCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Item | Gets a specific SamplerState object using an index value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SamplerStateCollection Class
Microsoft.Xna.Framework.Graphics Namespace


SamplerStateCollection Methods

SamplerStateCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SamplerStateCollection Class
Microsoft.Xna.Framework.Graphics Namespace


SamplerStateCollection Properties

SamplerStateCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Item | Gets a specific SamplerState object using an index value.

Expand image See Also

Reference

SamplerStateCollection Class
Microsoft.Xna.Framework.Graphics Namespace


SamplerStateCollection.Item Property

SamplerStateCollection.Item Property

Gets a specific SamplerState object using an index value.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public SamplerState this [
         int index
] { get; set; }

Property Value

The SamplerState object at the requested index.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The index for this vertex stream is invalid.

Expand image See Also

Reference

SamplerStateCollection Class
SamplerStateCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SetDataOptions Enumeration

SetDataOptions Enumeration

Describes whether existing vertex or index buffer data will be overwritten or discarded during a SetData operation.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum SetDataOptions

Expand image Members

Member name | Description
Discard | The SetData operation will discard the entire buffer. A pointer to a new memory area is returned so that the direct memory access (DMA) and rendering from the previous area do not stall.
None | Portions of existing data in the buffer may be overwritten during this operation.
NoOverwrite | The SetData operation will not overwrite existing data in the vertex and index buffers. Specifying this option allows the driver to return immediately from a SetData operation and continue rendering.

Expand image Remarks

Dynamic geometry may be rendered on the Xbox 360 by using DrawUserPrimitives.

Expand image See Also

Reference

IndexBuffer.SetData Method
Texture2D.SetData Method
Texture3D.SetData Method
TextureCube.SetData Method
VertexBuffer.SetData Method
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect Class

SkinnedEffect Class
See Also Members
CollapseAll image

Contains a configurable effect for rendering skinned character models.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class SkinnedEffect : Effect, IEffectMatrices, IEffectLights, IEffectFog

Expand image See Also

Reference

SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect Members

SkinnedEffect Members
See Also Constructors Fields Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the SkinnedEffect type.

Expand image Public Constructors

 | Name | Description
Public Method | SkinnedEffect | Overloaded. Creates a SkinnedEffect.

Expand image Public Fields

 | Name | Description
Public Field | MaxBones | The maximum number of bones.

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).
Public Property | AmbientLightColor | Gets or sets the ambient color for a light, the range of color values is from 0 to 1.
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | DiffuseColor | Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.
Public Property | DirectionalLight0 | Gets the first directional light.
Public Property | DirectionalLight1 | Gets the second directional light.
Public Property | DirectionalLight2 | Gets the third directional light.
Public Property | EmissiveColor | Gets or sets the emissive color for a material, the range of color values is from 0 to 1.
Public Property | FogColor | Gets or sets the fog color, the range of color values is from 0 to 1.
Public Property | FogEnabled | Gets or sets the fog enable flag.
Public Property | FogEnd | Gets or sets the maximum z value for fog, which ranges from 0 to 1.
Public Property | FogStart | Gets or sets the minimum z value for fog, which ranges from 0 to 1.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | PreferPerPixelLighting | Gets or sets the per-pixel prefer lighting flag.
Public Property | Projection | Gets or sets the projection matrix.
Public Property | SpecularColor | Gets or sets the specular color for a material, the range of color values is from 0 to 1.
Public Property | SpecularPower | Gets or sets the material specular power.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)
Public Property | Texture | Gets or sets the current texture.
Public Property | View | Gets or sets the view matrix.
Public Property | WeightsPerVertex | Gets or sets the number of per-vertex skinning weights to evaluate, which is either 1, 2, or 4.
Public Property | World | Gets or sets the world matrix.

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a clone of the current SkinnedEffect instance.
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | EnableDefaultLighting | Sets up standard key, fill, and back lighting for a SkinnedEffect.
Public Method | Equals | (Inherited from Object.)
Public Method | GetBoneTransforms | Gets the bone transform matrices for a SkinnedEffect.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetBoneTransforms | Sets an array of bone transform matrices for a SkinnedEffect.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Computes derived parameter values immediately before applying the effect.

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | LightingEnabled Property | Enables lighting in an SkinnedEffect.

Expand image See Also

Reference

SkinnedEffect Class
Microsoft.Xna.Framework.Graphics Namespace


SkinnedEffect Fields

SkinnedEffect Fields

Expand image Public Fields

 | Name | Description
Public Field | MaxBones | The maximum number of bones.

Expand image See Also

Reference

SkinnedEffect Class
Microsoft.Xna.Framework.Graphics Namespace


SkinnedEffect.MaxBones Field

SkinnedEffect.MaxBones Field

The maximum number of bones.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public const int MaxBones

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect Constructor

SkinnedEffect Constructor

Creates a SkinnedEffect.

Expand image Overload List

Name | Description
SkinnedEffect (GraphicsDevice) | Creates a SkinnedEffect with default parameter settings.
SkinnedEffect (SkinnedEffect) | Creates a SkinnedEffect by cloning parameter settings from an existing instance.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace


SkinnedEffect Constructor (GraphicsDevice)

SkinnedEffect Constructor (GraphicsDevice)
See Also
CollapseAll image

Creates a SkinnedEffect with default parameter settings.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public SkinnedEffect (
         GraphicsDevice device
)

Parameters

device
The graphics device.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect Constructor (SkinnedEffect)

SkinnedEffect Constructor (SkinnedEffect)
See Also
CollapseAll image

Creates a SkinnedEffect by cloning parameter settings from an existing instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected SkinnedEffect (
         SkinnedEffect cloneSource
)

Parameters

cloneSource
An existing instance.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect Methods

SkinnedEffect Methods

Expand image Public Methods

 | Name | Description
Public Method | Clone | Creates a clone of the current SkinnedEffect instance.
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | EnableDefaultLighting | Sets up standard key, fill, and back lighting for a SkinnedEffect.
Public Method | Equals | (Inherited from Object.)
Public Method | GetBoneTransforms | Gets the bone transform matrices for a SkinnedEffect.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetBoneTransforms | Sets an array of bone transform matrices for a SkinnedEffect.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from Effect.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | OnApply | Computes derived parameter values immediately before applying the effect.

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | LightingEnabled Property | Enables lighting in an SkinnedEffect.

Expand image See Also

Reference

SkinnedEffect Class
Microsoft.Xna.Framework.Graphics Namespace


SkinnedEffect.Clone Method

SkinnedEffect.Clone Method

Creates a clone of the current SkinnedEffect instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override Effect Clone ()

Return Value

The cloned object from the current instance.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.EnableDefaultLighting Method

SkinnedEffect.EnableDefaultLighting Method

Sets up standard key, fill, and back lighting for a SkinnedEffect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void EnableDefaultLighting ()

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.GetBoneTransforms Method

SkinnedEffect.GetBoneTransforms Method

Gets the bone transform matrices for a SkinnedEffect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix[] GetBoneTransforms (
         int count
)

Parameters

count
The number of matrices.

Return Value

An array of matrices which contain bone transforms.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.OnApply Method

SkinnedEffect.OnApply Method

Computes derived parameter values immediately before applying the effect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected internal override void OnApply ()

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.SetBoneTransforms Method

SkinnedEffect.SetBoneTransforms Method

Sets an array of bone transform matrices for a SkinnedEffect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetBoneTransforms (
         Matrix[] boneTransforms
)

Parameters

boneTransforms
An array of bone transformation matrices; the maximum number of bones (matrices) allowed is 72.

Expand image Exceptions

Exception type | Condition
ArgumentException | The number of matrices in boneTransforms exceeds the maximum number allowed.
ArgumentNullException | The boneTransforms parameter is null.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect Properties

SkinnedEffect Properties

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).
Public Property | AmbientLightColor | Gets or sets the ambient color for a light, the range of color values is from 0 to 1.
Public Property | CurrentTechnique | (Inherited from Effect.)
Public Property | DiffuseColor | Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.
Public Property | DirectionalLight0 | Gets the first directional light.
Public Property | DirectionalLight1 | Gets the second directional light.
Public Property | DirectionalLight2 | Gets the third directional light.
Public Property | EmissiveColor | Gets or sets the emissive color for a material, the range of color values is from 0 to 1.
Public Property | FogColor | Gets or sets the fog color, the range of color values is from 0 to 1.
Public Property | FogEnabled | Gets or sets the fog enable flag.
Public Property | FogEnd | Gets or sets the maximum z value for fog, which ranges from 0 to 1.
Public Property | FogStart | Gets or sets the minimum z value for fog, which ranges from 0 to 1.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Parameters | (Inherited from Effect.)
Public Property | PreferPerPixelLighting | Gets or sets the per-pixel prefer lighting flag.
Public Property | Projection | Gets or sets the projection matrix.
Public Property | SpecularColor | Gets or sets the specular color for a material, the range of color values is from 0 to 1.
Public Property | SpecularPower | Gets or sets the material specular power.
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Techniques | (Inherited from Effect.)
Public Property | Texture | Gets or sets the current texture.
Public Property | View | Gets or sets the view matrix.
Public Property | WeightsPerVertex | Gets or sets the number of per-vertex skinning weights to evaluate, which is either 1, 2, or 4.
Public Property | World | Gets or sets the world matrix.

Expand image See Also

Reference

SkinnedEffect Class
Microsoft.Xna.Framework.Graphics Namespace


SkinnedEffect.Alpha Property

SkinnedEffect.Alpha Property

Gets or sets the material alpha which determines its transparency. Range is between 1 (fully opaque) and 0 (fully transparent).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float Alpha { get; set; }

Property Value

The material alpha value.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.AmbientLightColor Property

SkinnedEffect.AmbientLightColor Property

Gets or sets the ambient color for a light, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 AmbientLightColor { get; set; }

Property Value

The ambient color.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.DiffuseColor Property

SkinnedEffect.DiffuseColor Property

Gets or sets the diffuse color for a material, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 DiffuseColor { get; set; }

Property Value

The diffuse color.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.DirectionalLight0 Property

SkinnedEffect.DirectionalLight0 Property

Gets the first directional light.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight0 { get; }

Property Value

The first light.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.DirectionalLight1 Property

SkinnedEffect.DirectionalLight1 Property

Gets the second directional light.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight1 { get; }

Property Value

The second light.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.DirectionalLight2 Property

SkinnedEffect.DirectionalLight2 Property

Gets the third directional light.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public DirectionalLight DirectionalLight2 { get; }

Property Value

The third light.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.EmissiveColor Property

SkinnedEffect.EmissiveColor Property

Gets or sets the emissive color for a material, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 EmissiveColor { get; set; }

Property Value

The emissive color.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.FogColor Property

SkinnedEffect.FogColor Property

Gets or sets the fog color, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 FogColor { get; set; }

Property Value

The fog color.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.FogEnabled Property

SkinnedEffect.FogEnabled Property

Gets or sets the fog enable flag.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool FogEnabled { get; set; }

Property Value

True to enable fog; false otherwise.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.FogEnd Property

SkinnedEffect.FogEnd Property

Gets or sets the maximum z value for fog, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogEnd { get; set; }

Property Value

The distance to stop adding fog.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.FogStart Property

SkinnedEffect.FogStart Property

Gets or sets the minimum z value for fog, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float FogStart { get; set; }

Property Value

The distance to begin adding fog.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


LightingEnabled Property

LightingEnabled Property

Enables lighting in an SkinnedEffect.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private bool Microsoft.Xna.Framework.Graphics.IEffectLights.LightingEnabled { get; set; }

Property Value

True to enable lighting; false otherwise.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.PreferPerPixelLighting Property

SkinnedEffect.PreferPerPixelLighting Property

Gets or sets the per-pixel prefer lighting flag.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public bool PreferPerPixelLighting { get; set; }

Property Value

True to prefer per-pixel lighting; false otherwise.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.Projection Property

SkinnedEffect.Projection Property

Gets or sets the projection matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix Projection { get; set; }

Property Value

A matrix that contains a projection transform.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.SpecularColor Property

SkinnedEffect.SpecularColor Property

Gets or sets the specular color for a material, the range of color values is from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 SpecularColor { get; set; }

Property Value

The specular color.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.SpecularPower Property

SkinnedEffect.SpecularPower Property

Gets or sets the material specular power.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float SpecularPower { get; set; }

Property Value

The specular power.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.Texture Property

SkinnedEffect.Texture Property

Gets or sets the current texture.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture2D Texture { get; set; }

Property Value

The current texture.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.View Property

SkinnedEffect.View Property

Gets or sets the view matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix View { get; set; }

Property Value

A matrix that contains a view transform.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.WeightsPerVertex Property

SkinnedEffect.WeightsPerVertex Property

Gets or sets the number of per-vertex skinning weights to evaluate, which is either 1, 2, or 4.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int WeightsPerVertex { get; set; }

Property Value

The number of per-vertex skinning weights.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect.World Property

SkinnedEffect.World Property

Gets or sets the world matrix.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Matrix World { get; set; }

Property Value

A matrix that contains a world transform.

Expand image See Also

Reference

SkinnedEffect Class
SkinnedEffect Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SkinnedEffect Events

SkinnedEffect Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

SkinnedEffect Class
Microsoft.Xna.Framework.Graphics Namespace


SpriteBatch Class

SpriteBatch Class
See Also Members
CollapseAll image

Enables a group of sprites to be drawn using the same settings.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class SpriteBatch : GraphicsResource

Expand image Remarks

Use a sprite to draw a 2D bitmap directly to the screen.

Expand image See Also

Reference

SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch Members

SpriteBatch Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the SpriteBatch type.

Expand image Public Constructors

 | Name | Description
Public Method | SpriteBatch | Initializes a new instance of the class, which enables a group of sprites to be drawn using the same settings.

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Public Methods

 | Name | Description
Public Method | Begin | Overloaded. Begins a sprite batch operation.
Public Method | Dispose | Overloaded. Releases unmanaged resources used by this object.
Public Method | Draw | Overloaded. Adds a sprite to a batch of sprites to be rendered.
Public Method | DrawString | Overloaded. Adds a string to a batch of sprites to be rendered.
Public Method | End | Flushes the sprite batch and restores the device state to how it was before Begin was called.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

SpriteBatch Class
Microsoft.Xna.Framework.Graphics Namespace


SpriteBatch Constructor

SpriteBatch Constructor

Initializes a new instance of the class, which enables a group of sprites to be drawn using the same settings.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public SpriteBatch (
         GraphicsDevice graphicsDevice
)

Parameters

graphicsDevice
The graphics device where sprites will be drawn.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | graphicsDevice is null.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch Methods

SpriteBatch Methods

Expand image Public Methods

 | Name | Description
Public Method | Begin | Overloaded. Begins a sprite batch operation.
Public Method | Dispose | Overloaded. Releases unmanaged resources used by this object.
Public Method | Draw | Overloaded. Adds a sprite to a batch of sprites to be rendered.
Public Method | DrawString | Overloaded. Adds a string to a batch of sprites to be rendered.
Public Method | End | Flushes the sprite batch and restores the device state to how it was before Begin was called.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SpriteBatch Class
Microsoft.Xna.Framework.Graphics Namespace


SpriteBatch.Begin Method

SpriteBatch.Begin Method

Begins a sprite batch operation.

Expand image Overload List

Name | Description
SpriteBatch.Begin () | Begins a sprite batch operation using deferred sort and default state objects (BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise).
SpriteBatch.Begin (SpriteSortMode, BlendState) | Begins a sprite batch operation using the specified sort and blend state object and default state objects (DepthStencilState.None, SamplerState.LinearClamp, RasterizerState.CullCounterClockwise). If you pass a null blend state, the default is BlendState.AlphaBlend.
SpriteBatch.Begin (SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState) | Begins a sprite batch operation using the specified sort, blend, sampler, depth stencil and rasterizer state objects. Passing null for any of the state objects selects the default default state objects (BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise).
SpriteBatch.Begin (SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect) | Begins a sprite batch operation using the specified sort, blend, sampler, depth stencil and rasterizer state objects, plus a custom effect. Passing null for any of the state objects selects the default default state objects (BlendState.AlphaBlend, DepthStencilState.None, RasterizerState.CullCounterClockwise, SamplerState.LinearClamp). Passing a null effect selects the default SpriteBatch Class shader.
SpriteBatch.Begin (SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix) | Begins a sprite batch operation using the specified sort, blend, sampler, depth stencil, rasterizer state objects, plus a custom effect and a 2D transformation matrix. Passing null for any of the state objects selects the default default state objects (BlendState.AlphaBlend, DepthStencilState.None, RasterizerState.CullCounterClockwise, SamplerState.LinearClamp). Passing a null effect selects the default SpriteBatch Class shader.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace


SpriteBatch.Begin Method ()

SpriteBatch.Begin Method ()
See Also
CollapseAll image

Begins a sprite batch operation using deferred sort and default state objects (BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Begin ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Begin has been called before calling End after the last call to Begin. Begin cannot be called again until End has been successfully called.

Expand image Remarks

This method must be called before any calls to Draw. When all the sprites have been drawn, call End.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Begin Method (SpriteSortMode, BlendState)

SpriteBatch.Begin Method (SpriteSortMode, BlendState)
See Also
CollapseAll image

Begins a sprite batch operation using the specified sort and blend state object and default state objects (DepthStencilState.None, SamplerState.LinearClamp, RasterizerState.CullCounterClockwise). If you pass a null blend state, the default is BlendState.AlphaBlend.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Begin (
         SpriteSortMode sortMode,
         BlendState blendState
)

Parameters

sortMode
Sprite drawing order.
blendState
Blending options.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Begin has been called before calling End after the last call to Begin. Begin cannot be called again until End has been successfully called.

Expand image Remarks

This method must be called before any calls to Draw. When all the sprites have been drawn, call End.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Begin Method (SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState)

SpriteBatch.Begin Method (SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState)
See Also
CollapseAll image

Begins a sprite batch operation using the specified sort, blend, sampler, depth stencil and rasterizer state objects. Passing null for any of the state objects selects the default default state objects (BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise).

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Begin (
         SpriteSortMode sortMode,
         BlendState blendState,
         SamplerState samplerState,
         DepthStencilState depthStencilState,
         RasterizerState rasterizerState
)

Parameters

sortMode
Sprite drawing order.
blendState
Blending options.
samplerState
Texture sampling options.
depthStencilState
Depth and stencil options.
rasterizerState
Rasterization options.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Begin has been called before calling End after the last call to Begin. Begin cannot be called again until End has been successfully called.

Expand image Remarks

This method must be called before any calls to Draw. When all the sprites have been drawn, call End.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Begin Method (SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect)

SpriteBatch.Begin Method (SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect)
See Also
CollapseAll image

Begins a sprite batch operation using the specified sort, blend, sampler, depth stencil and rasterizer state objects, plus a custom effect. Passing null for any of the state objects selects the default default state objects (BlendState.AlphaBlend, DepthStencilState.None, RasterizerState.CullCounterClockwise, SamplerState.LinearClamp). Passing a null effect selects the default SpriteBatch Class shader.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Begin (
         SpriteSortMode sortMode,
         BlendState blendState,
         SamplerState samplerState,
         DepthStencilState depthStencilState,
         RasterizerState rasterizerState,
         Effect effect
)

Parameters

sortMode
Sprite drawing order.
blendState
Blending options.
samplerState
Texture sampling options.
depthStencilState
Depth and stencil options.
rasterizerState
Rasterization options.
effect
Effect state options.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Begin has been called before calling End after the last call to Begin. Begin cannot be called again until End has been successfully called.

Expand image Remarks

This method must be called before any calls to Draw. When all the sprites have been drawn, call End.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Begin Method (SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix)

SpriteBatch.Begin Method (SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix)
See Also
CollapseAll image

Begins a sprite batch operation using the specified sort, blend, sampler, depth stencil, rasterizer state objects, plus a custom effect and a 2D transformation matrix. Passing null for any of the state objects selects the default default state objects (BlendState.AlphaBlend, DepthStencilState.None, RasterizerState.CullCounterClockwise, SamplerState.LinearClamp). Passing a null effect selects the default SpriteBatch Class shader.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Begin (
         SpriteSortMode sortMode,
         BlendState blendState,
         SamplerState samplerState,
         DepthStencilState depthStencilState,
         RasterizerState rasterizerState,
         Effect effect,
         Matrix transformMatrix
)

Parameters

sortMode
Sprite drawing order.
blendState
Blending options.
samplerState
Texture sampling options.
depthStencilState
Depth and stencil options.
rasterizerState
Rasterization options.
effect
Effect state options.
transformMatrix
Transformation matrix for scale, rotate, translate options.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | Begin has been called before calling End after the last call to Begin. Begin cannot be called again until End has been successfully called.

Expand image Remarks

This method must be called before any calls to Draw. When all the sprites have been drawn, call End.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Dispose Method

SpriteBatch.Dispose Method

Releases unmanaged resources used by this object.

Expand image Overload List

Name | Description
SpriteBatch.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace


SpriteBatch.Dispose Method (Boolean)

SpriteBatch.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool disposing
)

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Draw Method

SpriteBatch.Draw Method

Adds a sprite to a batch of sprites to be rendered.

Expand image Overload List

Name | Description
SpriteBatch.Draw (Texture2D, Rectangle, Color) | Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, and color.
SpriteBatch.Draw (Texture2D, Rectangle, Nullable<Rectangle>, Color) | Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, and color.
SpriteBatch.Draw (Texture2D, Rectangle, Nullable<Rectangle>, Color, Single, Vector2, SpriteEffects, Single) | Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, color, rotation, origin, effects and layer.
SpriteBatch.Draw (Texture2D, Vector2, Color) | Adds a sprite to a batch of sprites for rendering using the specified texture, position and color.
SpriteBatch.Draw (Texture2D, Vector2, Nullable<Rectangle>, Color) | Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, and color.
SpriteBatch.Draw (Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Single, SpriteEffects, Single) | Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer.
SpriteBatch.Draw (Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Vector2, SpriteEffects, Single) | Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects and layer.

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace


SpriteBatch.Draw Method (Texture2D, Rectangle, Color)

SpriteBatch.Draw Method (Texture2D, Rectangle, Color)
See Also
CollapseAll image

Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, and color.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Draw (
         Texture2D texture,
         Rectangle destinationRectangle,
         Color color
)

Parameters

texture
A texture.
destinationRectangle
A rectangle that specifies (in screen coordinates) the destination for drawing the sprite.
color
The color to tint a sprite. Use Color.White for full color with no tinting.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | texture is null.
InvalidOperationException | Draw was called, but Begin has not yet been called. Begin must be called successfully before you can call Draw.

Expand image Remarks

Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Draw Method (Texture2D, Rectangle, Nullable<Rectangle>, Color)

SpriteBatch.Draw Method (Texture2D, Rectangle, Nullable<Rectangle>, Color)
See Also
CollapseAll image

Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, and color.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Draw (
         Texture2D texture,
         Rectangle destinationRectangle,
         Nullable<Rectangle> sourceRectangle,
         Color color
)

Parameters

texture
A texture.
destinationRectangle
A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. If this rectangle is not the same size as the source rectangle, the sprite will be scaled to fit.
sourceRectangle
A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture.
color
The color to tint a sprite. Use Color.White for full color with no tinting.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | texture is null.
InvalidOperationException | Draw was called, but Begin has not yet been called. Begin must be called successfully before you can call Draw.

Expand image Remarks

Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Draw Method (Texture2D, Rectangle, Nullable<Rectangle>, Color, Single, Vector2, SpriteEffects, Single)

SpriteBatch.Draw Method (Texture2D, Rectangle, Nullable<Rectangle>, Color, Single, Vector2, SpriteEffects, Single)
See Also
CollapseAll image

Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, color, rotation, origin, effects and layer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Draw (
         Texture2D texture,
         Rectangle destinationRectangle,
         Nullable<Rectangle> sourceRectangle,
         Color color,
         float rotation,
         Vector2 origin,
         SpriteEffects effects,
         float layerDepth
)

Parameters

texture
A texture.
destinationRectangle
A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. If this rectangle is not the same size as the source rectangle, the sprite will be scaled to fit.
sourceRectangle
A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture.
color
The color to tint a sprite. Use Color.White for full color with no tinting.
rotation
Specifies the angle (in radians) to rotate the sprite about its center.
origin
The sprite origin; the default is (0,0) which represents the upper-left corner.
effects
Effects to apply.
layerDepth
The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | texture is null.
InvalidOperationException | Draw was called, but Begin has not yet been called. Begin must be called successfully before you can call Draw.

Expand image Remarks

Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Draw Method (Texture2D, Vector2, Color)

SpriteBatch.Draw Method (Texture2D, Vector2, Color)
See Also
CollapseAll image

Adds a sprite to a batch of sprites for rendering using the specified texture, position and color.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Draw (
         Texture2D texture,
         Vector2 position,
         Color color
)

Parameters

texture
A texture.
position
The location (in screen coordinates) to draw the sprite.
color
The color to tint a sprite. Use Color.White for full color with no tinting.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | texture is null.
InvalidOperationException | Draw was called, but Begin has not yet been called. Begin must be called successfully before you can call Draw.

Expand image Remarks

Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Draw Method (Texture2D, Vector2, Nullable<Rectangle>, Color)

SpriteBatch.Draw Method (Texture2D, Vector2, Nullable<Rectangle>, Color)
See Also
CollapseAll image

Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, and color.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Draw (
         Texture2D texture,
         Vector2 position,
         Nullable<Rectangle> sourceRectangle,
         Color color
)

Parameters

texture
A texture.
position
The location (in screen coordinates) to draw the sprite.
sourceRectangle
A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture.
color
The color to tint a sprite. Use Color.White for full color with no tinting.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | texture is null.
InvalidOperationException | Draw was called, but Begin has not yet been called. Begin must be called successfully before you can call Draw.

Expand image Remarks

Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Draw Method (Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Single, SpriteEffects, Single)

SpriteBatch.Draw Method (Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Single, SpriteEffects, Single)
See Also
CollapseAll image

Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Draw (
         Texture2D texture,
         Vector2 position,
         Nullable<Rectangle> sourceRectangle,
         Color color,
         float rotation,
         Vector2 origin,
         float scale,
         SpriteEffects effects,
         float layerDepth
)

Parameters

texture
A texture.
position
The location (in screen coordinates) to draw the sprite.
sourceRectangle
A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture.
color
The color to tint a sprite. Use Color.White for full color with no tinting.
rotation
Specifies the angle (in radians) to rotate the sprite about its center.
origin
The sprite origin; the default is (0,0) which represents the upper-left corner.
scale
Scale factor.
effects
Effects to apply.
layerDepth
The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | texture is null.
InvalidOperationException | Draw was called, but Begin has not yet been called. Begin must be called successfully before you can call Draw.

Expand image Remarks

Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.Draw Method (Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Vector2, SpriteEffects, Single)

SpriteBatch.Draw Method (Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Vector2, SpriteEffects, Single)
See Also
CollapseAll image

Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects and layer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void Draw (
         Texture2D texture,
         Vector2 position,
         Nullable<Rectangle> sourceRectangle,
         Color color,
         float rotation,
         Vector2 origin,
         Vector2 scale,
         SpriteEffects effects,
         float layerDepth
)

Parameters

texture
A texture.
position
The location (in screen coordinates) to draw the sprite.
sourceRectangle
A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture.
color
The color to tint a sprite. Use Color.White for full color with no tinting.
rotation
Specifies the angle (in radians) to rotate the sprite about its center.
origin
The sprite origin; the default is (0,0) which represents the upper-left corner.
scale
Scale factor.
effects
Effects to apply.
layerDepth
The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | texture is null.
InvalidOperationException | Draw was called, but Begin has not yet been called. Begin must be called successfully before you can call Draw.

Expand image Remarks

Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.

Expand image See Also

Tasks

Drawing a Sprite

Concepts

What Is a Sprite?

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.DrawString Method

SpriteBatch.DrawString Method

Adds a string to a batch of sprites to be rendered.

Expand image Overload List

Name | Description
SpriteBatch.DrawString (SpriteFont, String, Vector2, Color) | Adds a string to a batch of sprites for rendering using the specified font, text, position, and color.
SpriteBatch.DrawString (SpriteFont, String, Vector2, Color, Single, Vector2, Single, SpriteEffects, Single) | Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.
SpriteBatch.DrawString (SpriteFont, String, Vector2, Color, Single, Vector2, Vector2, SpriteEffects, Single) | Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.
SpriteBatch.DrawString (SpriteFont, StringBuilder, Vector2, Color) | Adds a string to a batch of sprites for rendering using the specified font, text, position, and color.
SpriteBatch.DrawString (SpriteFont, StringBuilder, Vector2, Color, Single, Vector2, Single, SpriteEffects, Single) | Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.
SpriteBatch.DrawString (SpriteFont, StringBuilder, Vector2, Color, Single, Vector2, Vector2, SpriteEffects, Single) | Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace


SpriteBatch.DrawString Method (SpriteFont, String, Vector2, Color)

SpriteBatch.DrawString Method (SpriteFont, String, Vector2, Color)
See Also
CollapseAll image

Adds a string to a batch of sprites for rendering using the specified font, text, position, and color.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawString (
         SpriteFont spriteFont,
         string text,
         Vector2 position,
         Color color
)

Parameters

spriteFont
A font for diplaying text.
text
A text string.
position
The location (in screen coordinates) to draw the sprite.
color
The color to tint a sprite. Use Color.White for full color with no tinting.

Expand image Exceptions

Exception type | Condition
ArgumentNullException

One or more of the following is true:

  • spriteFont is null
  • text is null
InvalidOperationException | DrawString was called, but Begin has not yet been called. Begin must be called successfully before you can call DrawString.

Expand image Remarks

SpriteFont objects are loaded from the Content Manager. See the SpriteFont class for more information.

Before any calls to DrawString, you must call Begin. Once all calls to DrawString are complete, call End.

Use a newline character (\n) to draw more than one line of text.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.DrawString Method (SpriteFont, String, Vector2, Color, Single, Vector2, Single, SpriteEffects, Single)

SpriteBatch.DrawString Method (SpriteFont, String, Vector2, Color, Single, Vector2, Single, SpriteEffects, Single)
See Also
CollapseAll image

Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawString (
         SpriteFont spriteFont,
         string text,
         Vector2 position,
         Color color,
         float rotation,
         Vector2 origin,
         float scale,
         SpriteEffects effects,
         float layerDepth
)

Parameters

spriteFont
A font for diplaying text.
text
A text string.
position
The location (in screen coordinates) to draw the sprite.
color
The color to tint a sprite. Use Color.White for full color with no tinting.
rotation
Specifies the angle (in radians) to rotate the sprite about its center.
origin
The sprite origin; the default is (0,0) which represents the upper-left corner.
scale
Scale factor.
effects
Effects to apply.
layerDepth
The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing.

Expand image Exceptions

Exception type | Condition
ArgumentNullException

One or more of the following is true:

  • spriteFont is null
  • text is null
InvalidOperationException | DrawString was called, but Begin has not yet been called. Begin must be called successfully before you can call DrawString.

Expand image Remarks

SpriteFont objects are loaded from the Content Manager. See the SpriteFont class for more information.

Before any calls to DrawString, you must call Begin. Once all calls to DrawString are complete, call End.

Use a newline character (\n) to draw more than one line of text.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.DrawString Method (SpriteFont, String, Vector2, Color, Single, Vector2, Vector2, SpriteEffects, Single)

SpriteBatch.DrawString Method (SpriteFont, String, Vector2, Color, Single, Vector2, Vector2, SpriteEffects, Single)
See Also
CollapseAll image

Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawString (
         SpriteFont spriteFont,
         string text,
         Vector2 position,
         Color color,
         float rotation,
         Vector2 origin,
         Vector2 scale,
         SpriteEffects effects,
         float layerDepth
)

Parameters

spriteFont
A font for diplaying text.
text
A text string.
position
The location (in screen coordinates) to draw the sprite.
color
The color to tint a sprite. Use Color.White for full color with no tinting.
rotation
Specifies the angle (in radians) to rotate the sprite about its center.
origin
The sprite origin; the default is (0,0) which represents the upper-left corner.
scale
Scale factor.
effects
Effects to apply.
layerDepth
The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing.

Expand image Exceptions

Exception type | Condition
ArgumentNullException

One or more of the following is true:

  • spriteFont is null
  • text is null
InvalidOperationException | DrawString was called, but Begin has not yet been called. Begin must be called successfully before you can call DrawString.

Expand image Remarks

SpriteFont objects are loaded from the Content Manager. See the SpriteFont class for more information.

Before any calls to DrawString, you must call Begin. Once all calls to DrawString are complete, call End.

Use a newline character (\n) to draw more than one line of text.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.DrawString Method (SpriteFont, StringBuilder, Vector2, Color)

SpriteBatch.DrawString Method (SpriteFont, StringBuilder, Vector2, Color)
See Also
CollapseAll image

Adds a string to a batch of sprites for rendering using the specified font, text, position, and color.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawString (
         SpriteFont spriteFont,
         StringBuilder text,
         Vector2 position,
         Color color
)

Parameters

spriteFont
A font for diplaying text.
text
Text string.
position
The location (in screen coordinates) to draw the sprite.
color
The color to tint a sprite. Use Color.White for full color with no tinting.

Expand image Exceptions

Exception type | Condition
ArgumentNullException

One or more of the following is true:

  • spriteFont is null
  • text is null
InvalidOperationException | DrawString was called, but Begin has not yet been called. Begin must be called successfully before you can call DrawString.

Expand image Remarks

SpriteFont objects are loaded from the Content Manager. See the SpriteFont class for more information.

Before any calls to DrawString, you must call Begin. Once all calls to DrawString are complete, call End.

Use a newline character (\n) to draw more than one line of text.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.DrawString Method (SpriteFont, StringBuilder, Vector2, Color, Single, Vector2, Single, SpriteEffects, Single)

SpriteBatch.DrawString Method (SpriteFont, StringBuilder, Vector2, Color, Single, Vector2, Single, SpriteEffects, Single)
See Also
CollapseAll image

Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawString (
         SpriteFont spriteFont,
         StringBuilder text,
         Vector2 position,
         Color color,
         float rotation,
         Vector2 origin,
         float scale,
         SpriteEffects effects,
         float layerDepth
)

Parameters

spriteFont
A font for diplaying text.
text
Text string.
position
The location (in screen coordinates) to draw the sprite.
color
The color to tint a sprite. Use Color.White for full color with no tinting.
rotation
Specifies the angle (in radians) to rotate the sprite about its center.
origin
The sprite origin; the default is (0,0) which represents the upper-left corner.
scale
Scale factor.
effects
Effects to apply.
layerDepth
The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing.

Expand image Exceptions

Exception type | Condition
ArgumentNullException

One or more of the following is true:

  • spriteFont is null
  • text is null
InvalidOperationException | DrawString was called, but Begin has not yet been called. Begin must be called successfully before you can call DrawString.

Expand image Remarks

SpriteFont objects are loaded from the Content Manager. See the SpriteFont class for more information.

Before any calls to DrawString, you must call Begin. Once all calls to DrawString are complete, call End.

Use a newline character (\n) to draw more than one line of text.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.DrawString Method (SpriteFont, StringBuilder, Vector2, Color, Single, Vector2, Vector2, SpriteEffects, Single)

SpriteBatch.DrawString Method (SpriteFont, StringBuilder, Vector2, Color, Single, Vector2, Vector2, SpriteEffects, Single)
See Also
CollapseAll image

Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void DrawString (
         SpriteFont spriteFont,
         StringBuilder text,
         Vector2 position,
         Color color,
         float rotation,
         Vector2 origin,
         Vector2 scale,
         SpriteEffects effects,
         float layerDepth
)

Parameters

spriteFont
A font for diplaying text.
text
Text string.
position
The location (in screen coordinates) to draw the sprite.
color
The color to tint a sprite. Use Color.White for full color with no tinting.
rotation
Specifies the angle (in radians) to rotate the sprite about its center.
origin
The sprite origin; the default is (0,0) which represents the upper-left corner.
scale
Scale factor.
effects
Effects to apply.
layerDepth
The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing.

Expand image Exceptions

Exception type | Condition
ArgumentNullException

One or more of the following is true:

  • spriteFont is null
  • text is null
InvalidOperationException | DrawString was called, but Begin has not yet been called. Begin must be called successfully before you can call DrawString.

Expand image Remarks

SpriteFont objects are loaded from the Content Manager. See the SpriteFont class for more information.

Before any calls to DrawString, you must call Begin. Once all calls to DrawString are complete, call End.

Use a newline character (\n) to draw more than one line of text.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteBatch.End Method

SpriteBatch.End Method

Flushes the sprite batch and restores the device state to how it was before Begin was called.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void End ()

Expand image Exceptions

Exception type | Condition
InvalidOperationException | End was called, but Begin has not yet been called. You must call Begin successfully before you can call End.

Expand image See Also

Reference

SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteEffects Enumeration

SpriteEffects Enumeration

Defines sprite mirroring options.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[FlagsAttribute]
public enum SpriteEffects

Expand image Members

Member name | Description
FlipHorizontally | Rotate 180 degrees about the Y axis before rendering.
FlipVertically | Rotate 180 degrees about the X axis before rendering.
None | No rotations specified.

Expand image See Also

Reference

SpriteBatch.Draw Method

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteFont Class

SpriteFont Class
See Also Members
CollapseAll image

Represents a font texture.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class SpriteFont

Expand image Remarks

To load a SpriteFont, click Sprite Font on the Add New Item menu. This adds an XML file to your project describing how to build a texture map for your font. At build time, XNA Game Studio creates a texture with the image of the characters of the font you specify, with the specified font point size.

At run time, load the font using ContentManager.Load, and pass it to SpriteBatch.DrawString when drawing text.

Note
As with most types of software, font files are licensed rather than sold. Font licenses vary from vendor to vendor, but most don't allow redistribution of the fonts, and that includes redistribution of reproductions such as bitmaps containing the rasterized character set. This is even true of many of the licenses covering fonts that Microsoft supplies with applications and Windows. Be careful, therefore, to ensure that you have the required license rights to redistribute any font you include as a bitmap containing the rasterized character set in your game!

Expand image See Also

Reference

SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteFont Members

SpriteFont Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the SpriteFont type.

Expand image Public Properties

 | Name | Description
Public Property | Characters | Gets a collection of all the characters that are included in the font.
Public Property | DefaultCharacter | Gets or sets the default character for the font.
Public Property | LineSpacing | Gets or sets the vertical distance (in pixels) between the base lines of two consecutive lines of text. Line spacing includes the blank space between lines as well as the height of the characters.
Public Property | Spacing | Gets or sets the spacing of the font characters.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | MeasureString | Overloaded. Returns the width and height of a string.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SpriteFont Class
Microsoft.Xna.Framework.Graphics Namespace


SpriteFont Methods

SpriteFont Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | MeasureString | Overloaded. Returns the width and height of a string.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SpriteFont Class
Microsoft.Xna.Framework.Graphics Namespace


SpriteFont.MeasureString Method

SpriteFont.MeasureString Method

Returns the width and height of a string.

Expand image Overload List

Name | Description
SpriteFont.MeasureString (String) | Returns the width and height of a string as a Vector2.
SpriteFont.MeasureString (StringBuilder) | Returns the width and height of a string as a Vector2.

Expand image See Also

Reference

SpriteFont Class
SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace


SpriteFont.MeasureString Method (String)

SpriteFont.MeasureString Method (String)
See Also
CollapseAll image

Returns the width and height of a string as a Vector2.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector2 MeasureString (
         string text
)

Parameters

text
The string to measure.

Return Value

The width and height, in pixels, of text, when it is rendered.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | text cannot be null.
ArgumentException | There is a character in text that was not imported by the SpriteFont. You must include all the characters in the character regions in the sprite font file. For more information see How to: Extend the Font Description Processor to Support Additional Characters.

Expand image See Also

Reference

SpriteFont Class
SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteFont.MeasureString Method (StringBuilder)

SpriteFont.MeasureString Method (StringBuilder)
See Also
CollapseAll image

Returns the width and height of a string as a Vector2.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector2 MeasureString (
         StringBuilder text
)

Parameters

text
The string to measure.

Return Value

The width and height, in pixels, of text, when it is rendered.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | text cannot be null.
ArgumentException | There is a character in text that was not imported by the SpriteFont. You must include all the characters in the character regions in the sprite font file. For more information, see How to: Extend the Font Description Processor to Support Additional Characters.

Expand image Remarks

Use a StringBuilder argument in place of a String argument to measure dynamically formatted text.

Expand image See Also

Reference

SpriteFont Class
SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteFont Properties

SpriteFont Properties

Expand image Public Properties

 | Name | Description
Public Property | Characters | Gets a collection of all the characters that are included in the font.
Public Property | DefaultCharacter | Gets or sets the default character for the font.
Public Property | LineSpacing | Gets or sets the vertical distance (in pixels) between the base lines of two consecutive lines of text. Line spacing includes the blank space between lines as well as the height of the characters.
Public Property | Spacing | Gets or sets the spacing of the font characters.

Expand image See Also

Reference

SpriteFont Class
Microsoft.Xna.Framework.Graphics Namespace


SpriteFont.Characters Property

SpriteFont.Characters Property

Gets a collection of all the characters that are included in the font.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public ReadOnlyCollection<char> Characters { get; }

Property Value

The collection of all characters included in this font.

Expand image See Also

Reference

SpriteFont Class
SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteFont.DefaultCharacter Property

SpriteFont.DefaultCharacter Property

Gets or sets the default character for the font.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Nullable<char> DefaultCharacter { get; set; }

Property Value

The default character for this font.

Expand image Remarks

If set to anything other than null, this character will be automatically substituted any time an attempt is made to draw or measure characters that are not in the font.

If set to null, missing characters will produce an exception.

Expand image See Also

Reference

SpriteFont Class
SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteFont.LineSpacing Property

SpriteFont.LineSpacing Property

Gets or sets the vertical distance (in pixels) between the base lines of two consecutive lines of text. Line spacing includes the blank space between lines as well as the height of the characters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int LineSpacing { get; set; }

Property Value

The vertical distance between the base lines of two consecutive lines of text, in pixels.

Expand image See Also

Reference

SpriteFont Class
SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteFont.Spacing Property

SpriteFont.Spacing Property

Gets or sets the spacing of the font characters.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float Spacing { get; set; }

Property Value

The spacing, in pixels, of the font characters.

Expand image See Also

Reference

SpriteFont Class
SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SpriteSortMode Enumeration

SpriteSortMode Enumeration

Defines sprite sort-rendering options.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum SpriteSortMode

Expand image Members

Member name | Description
BackToFront | Same as Deferred mode, except sprites are sorted by depth in back-to-front order prior to drawing. This procedure is recommended when drawing transparent sprites of varying depths.
Deferred | Sprites are not drawn until End is called. End will apply graphics device settings and draw all the sprites in one batch, in the same order calls to Draw were received. This mode allows Draw calls to two or more instances of SpriteBatch without introducing conflicting graphics device settings. SpriteBatch defaults to Deferred mode.
FrontToBack | Same as Deferred mode, except sprites are sorted by depth in front-to-back order prior to drawing. This procedure is recommended when drawing opaque sprites of varying depths.
Immediate | Begin will apply new graphics device settings, and sprites will be drawn within each Draw call. In Immediate mode there can only be one active SpriteBatch instance without introducing conflicting device settings.
Texture | Same as Deferred mode, except sprites are sorted by texture prior to drawing. This can improve performance when drawing non-overlapping sprites of uniform depth.

Expand image See Also

Reference

SpriteBatch.Begin Method
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


StencilOperation Enumeration

StencilOperation Enumeration

Defines stencil buffer operations.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum StencilOperation

Expand image Members

Member name | Description
Decrement | Decrements the stencil-buffer entry, wrapping to the maximum value if the new value is less than 0.
DecrementSaturation | Decrements the stencil-buffer entry, clamping to 0.
Increment | Increments the stencil-buffer entry, wrapping to 0 if the new value exceeds the maximum value.
IncrementSaturation | Increments the stencil-buffer entry, clamping to the maximum value.
Invert | Inverts the bits in the stencil-buffer entry.
Keep | Does not update the stencil-buffer entry. This is the default value.
Replace | Replaces the stencil-buffer entry with a reference value.
Zero | Sets the stencil-buffer entry to 0.

Expand image Remarks

Stencil-buffer entries are integer values that range from 0 to 2n − 1, where n is the bit depth of the stencil buffer.

Expand image See Also

Reference

DepthStencilState.StencilPass Property
DepthStencilState.StencilFail Property
DepthStencilState.StencilDepthBufferFail Property
DepthStencilState.CounterClockwiseStencilPass Property
DepthStencilState.CounterClockwiseStencilFail Property
DepthStencilState.CounterClockwiseStencilDepthBufferFail Property
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SurfaceFormat Enumeration

SurfaceFormat Enumeration

Defines various types of surface formats.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum SurfaceFormat

Expand image Members

Member name | Description
Color | (Unsigned format) 32-bit ARGB pixel format with alpha, using 8 bits per channel.
Bgr565 | (Unsigned format) 16-bit BGR pixel format with 5 bits for blue, 6 bits for green, and 5 bits for red.
Bgra5551 | (Unsigned format) 16-bit BGRA pixel format where 5 bits are reserved for each color and 1 bit is reserved for alpha.
Bgra4444 | (Unsigned format) 16-bit BGRA pixel format with 4 bits for each channel.
Dxt1 | DXT1 compression texture format. The runtime will not allow an application to create a surface using a DXTn format unless the surface dimensions are multiples of 4. This applies to offscreen-plain surfaces, render targets, 2D textures, cube textures, and volume textures.
Dxt3 | DXT3 compression texture format. The runtime will not allow an application to create a surface using a DXTn format unless the surface dimensions are multiples of 4. This applies to offscreen-plain surfaces, render targets, 2D textures, cube textures, and volume textures.
Dxt5 | DXT5 compression texture format. The runtime will not allow an application to create a surface using a DXTn format unless the surface dimensions are multiples of 4. This applies to offscreen-plain surfaces, render targets, 2D textures, cube textures, and volume textures.
NormalizedByte2 | (Signed format) 16-bit bump-map format using 8 bits each for u and v data.
NormalizedByte4 | (Signed format) 32-bit bump-map format using 8 bits for each channel.
Rgba1010102 | (Unsigned format) 32-bit RGBA pixel format using 10 bits for each color and 2 bits for alpha.
Rg32 | (Unsigned format) 32-bit pixel format using 16 bits each for red and green.
Rgba64 | (Unsigned format) 64-bit RGBA pixel format using 16 bits for each component.
Alpha8 | (Unsigned format) 8-bit alpha only.
Single | (IEEE format) 32-bit float format using 32 bits for the red channel.
Vector2 | (IEEE format) 64-bit float format using 32 bits for the red channel and 32 bits for the green channel.
Vector4 | (IEEE format) 128-bit float format using 32 bits for each channel (alpha, blue, green, red).
HalfSingle | (Floating-point format) 16-bit float format using 16 bits for the red channel.
HalfVector2 | (Floating-point format) 32-bit float format using 16 bits for the red channel and 16 bits for the green channel.
HalfVector4 | (Floating-point format) 64-bit float format using 16 bits for each channel (alpha, blue, green, red).
HdrBlendable | (Floating-point format) for high dynamic range data.

Expand image Remarks

In the XNA Framework, all two-dimensional (2D) images are represented by a range of memory called a surface. Within a surface, each element holds a color value representing a small section of the image, called a pixel. An image's detail level is defined by the number of pixels needed to represent the image and the number of bits needed for the image's color spectrum. For example, an image that is 800 pixels wide by 600 pixels high with 32 bits of color for each pixel (written as 800 x 600 x 32) is more detailed than an image that is 640 pixels wide by 480 pixels tall with 16 bits of color for each pixel (written as 640 x 480 x 16). Likewise, the more detailed image requires a larger surface to store the data. For an 800 x 600 x 32 image, the surface's array dimensions are 800 x 600, and each element holds a 32-bit value to represent its color.

All formats are listed from left to right, most-significant bit to least-significant bit. For example, ARGB formats are ordered from the most-significant bit channel A (alpha), to the least-significant bit channel B (blue). When traversing surface data, the data is stored in memory from least-significant bit to most-significant bit, which means that the channel order in memory is from least-significant bit (blue) to most-significant bit (alpha).

The default value for formats that contain undefined channels (Rg32, Alpha8, and so on) is 1. The only exception is the Alpha8 format, which is initialized to 000 for the three color channels.

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture Class

Texture Class
See Also Members
CollapseAll image

Represents a texture resource.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public abstract class Texture : GraphicsResource

Expand image See Also

Reference

Texture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture Members

Texture Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the Texture type.

Expand image Public Properties

 | Name | Description
Public Property | Format | Gets the format of the texture data.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | Gets the number of texture levels in a multilevel texture.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from GraphicsResource.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

Texture Class
Microsoft.Xna.Framework.Graphics Namespace


Texture Methods

Texture Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from GraphicsResource.)
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Texture Class
Microsoft.Xna.Framework.Graphics Namespace


Texture Properties

Texture Properties

Expand image Public Properties

 | Name | Description
Public Property | Format | Gets the format of the texture data.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | Gets the number of texture levels in a multilevel texture.
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image See Also

Reference

Texture Class
Microsoft.Xna.Framework.Graphics Namespace


Texture.Format Property

Texture.Format Property

Gets the format of the texture data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public SurfaceFormat Format { get; }

Property Value

The data format.

Expand image See Also

Reference

Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture.LevelCount Property

Texture.LevelCount Property

Gets the number of texture levels in a multilevel texture.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int LevelCount { get; }

Property Value

The number of texture levels in the multilevel texture.

Expand image See Also

Reference

Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D Class

Texture2D Class
See Also Members
CollapseAll image

Represents a 2D grid of texels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class Texture2D : Texture

Expand image Remarks

A texel represents the smallest unit of a texture that can be read from or written to by the GPU. A texel is composed of 1 to 4 components. Specifically, a texel may be any one of the available texture formats represented in the SurfaceFormat enumeration.

A Texture2D resource contains a 2D grid of texels. Each texel is addressable by a u, v vector. Since it is a texture resource, it may contain mipmap levels. Figure 1 shows a fully populated 2D texture resource.

Figure 1. Texture2D Resource Architecture

This texture resource contains a 5 x 3 texture with three mipmap levels.

Expand image See Also

Reference

Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D Members

Texture2D Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the Texture2D type.

Expand image Public Constructors

 | Name | Description
Public Method | Texture2D | Overloaded. Creates an uninitialized Texture2D resource of the specified dimensions. To initialize a Texture2D from an existing file, see the static method ContentManager.Load.

Expand image Public Properties

 | Name | Description
Public Property | Bounds | Gets the size of this resource.
Public Property | Format | (Inherited from Texture.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | Height | Gets the height of this texture resource, in pixels.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | (Inherited from Texture.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Width | Gets the width of this texture resource, in pixels.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
 | FromStream | Overloaded. Methods for loading an image.
Public Method | GetData | Overloaded. Copies texture data into an array.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SaveAsJpeg | Saves texture data as a .jpg.
Public Method | SaveAsPng | Saves texture data as a .png.
Public Method | SetData | Overloaded. Sets data to the texture.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

Texture2D Class
Microsoft.Xna.Framework.Graphics Namespace


Texture2D Constructor

Texture2D Constructor

Creates an uninitialized Texture2D resource of the specified dimensions. To initialize a Texture2D from an existing file, see the static method ContentManager.Load.

Expand image Overload List

Name | Description
Texture2D (GraphicsDevice, Int32, Int32) | Creates a new instance of this object.
Texture2D (GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat) | Creates a new instance of this object.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace


Texture2D Constructor (GraphicsDevice, Int32, Int32)

Texture2D Constructor (GraphicsDevice, Int32, Int32)
See Also
CollapseAll image

Creates a new instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture2D (
         GraphicsDevice graphicsDevice,
         int width,
         int height
)

Parameters

graphicsDevice
The device.
width
Texture width.
height
Texture height.

Expand image Exceptions

Exception type Condition
NotSupportedException One or more of the following is true:
  • The profile does not support the requested format.
  • The profile supports a maximum texture size of 2048.
  • The profile supports a maximum texture aspect ratio of 2048.
  • The profile requires mipmapped texture size to be a power of two. To use a non power of two size, remove the mipmaps.
  • The profile requires DXT compressed texture size to be a power of two. To use a non power of two size, disable DXT compression.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D Constructor (GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat)

Texture2D Constructor (GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat)
See Also
CollapseAll image

Creates a new instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture2D (
         GraphicsDevice graphicsDevice,
         int width,
         int height,
         bool mipMap,
         SurfaceFormat format
)

Parameters

graphicsDevice
The device.
width
Texture width.
height
Texture height.
mipMap
[MarshalAsAttribute(U1)] True to generate a full mipmap chain; false otherwise.
format
Texture data format.

Expand image Exceptions

Exception type Condition
NotSupportedException One or more of the following is true:
  • The profile does not support the requested format.
  • The profile supports a maximum texture size of 2048.
  • The profile supports a maximum texture aspect ratio of 2048.
  • The profile requires mipmapped texture size to be a power of two. To use a non power of two size, remove the mipmaps.
  • The profile requires DXT compressed texture size to be a power of two. To use a non power of two size, disable DXT compression.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D Methods

Texture2D Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
 | FromStream | Overloaded. Methods for loading an image.
Public Method | GetData | Overloaded. Copies texture data into an array.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SaveAsJpeg | Saves texture data as a .jpg.
Public Method | SaveAsPng | Saves texture data as a .png.
Public Method | SetData | Overloaded. Sets data to the texture.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Texture2D Class
Microsoft.Xna.Framework.Graphics Namespace


Texture2D.FromStream Method

Texture2D.FromStream Method

Methods for loading an image.

Expand image Overload List

Name | Description
Texture2D.FromStream (GraphicsDevice, Stream) | Loads texture data from a stream.
Texture2D.FromStream (GraphicsDevice, Stream, Int32, Int32, Boolean) | Loads texture data from a stream.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace


Texture2D.FromStream Method (GraphicsDevice, Stream)

Texture2D.FromStream Method (GraphicsDevice, Stream)
See Also
CollapseAll image

Loads texture data from a stream.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static Texture2D FromStream (
         GraphicsDevice graphicsDevice,
         Stream stream
)

Parameters

graphicsDevice
A graphics device.
stream
Data stream from one of the following file types: .gif, .jpg or .png.

Return Value

2D texture.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.FromStream Method (GraphicsDevice, Stream, Int32, Int32, Boolean)

Texture2D.FromStream Method (GraphicsDevice, Stream, Int32, Int32, Boolean)
See Also
CollapseAll image

Loads texture data from a stream.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static Texture2D FromStream (
         GraphicsDevice graphicsDevice,
         Stream stream,
         int width,
         int height,
         bool zoom
)

Parameters

graphicsDevice
A graphics device.
stream
Data stream from one of the following file types: .gif, .jpg or .png.
width
The requested image width.
height
The requested image height.
zoom
Control the aspect ratio when zooming (scaling); set to false to maintain a constant aspect ratio, true otherwise. See remarks.

Return Value

A 2D texture.

Expand image Remarks

When zooming, the image is scaled relative to the image center.

  • Set zoom to false to maintain the aspect ratio which may result in the width or height returned not matching the values requested.
  • Set zoom to true to scale the image to fit the requested height and width regardless of the aspect ratio. This may result in clipping some of the original image.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.GetData Method

Texture2D.GetData Method

Copies texture data into an array.

Expand image Overload List

Name | Description
Texture2D.GetData (Int32, Nullable<Rectangle>, T[], Int32, Int32) | Gets a copy of 2D texture data, specifying a mimap level, source rectangle, start index, and number of elements.
Texture2D.GetData (T[]) | Gets a copy of 2D texture data.
Texture2D.GetData (T[], Int32, Int32) | Gets a copy of 2D texture data, specifying a start index and number of elements.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace


Texture2D.GetData Generic Method (Int32, Nullable<Rectangle>, T[], Int32, Int32)

Texture2D.GetData Generic Method (Int32, Nullable<Rectangle>, T[], Int32, Int32)
See Also Example
CollapseAll image

Gets a copy of 2D texture data, specifying a mimap level, source rectangle, start index, and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         int level,
         Nullable<Rectangle> rect,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array. This is usually a Microsoft.Xna.Framework.Graphics.PackedVector type but it can be any fundamental type that matches the bit size of the surface format.

Parameters

level
Mipmap level.
rect
The section of the texture to copy. null indicates the data will be copied from the entire texture.
data
Array of data.
startIndex
Index of the first element to get.
elementCount
Number of elements to get.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data must be of sufficient length to receive the data.
InvalidOperationException | The vertex stride is larger than the vertex buffer, or the vertex stride is too small for the type of data requested.

Expand image Example

In this example, the color of the pixel beneath the mouse is retrieved from the back buffer.

C#
sourceTexture.SetData<Color>(sourceColorData);

// Initialize a texture with texture data from another texture
sourceTexture.GetData<Color>(destinationColorData);
destinationTexture.SetData<Color>(destinationColorData);
if (Mouse.GetState().LeftButton == ButtonState.Pressed &&
    // If the left button is pressed
    Mouse.GetState().X > 0 && Mouse.GetState().Y > 0 &&
    // and we are inside the game window
    (Mouse.GetState().X <
    GraphicsDevice.PresentationParameters.BackBufferWidth) &&
    (Mouse.GetState().Y <
    GraphicsDevice.PresentationParameters.BackBufferHeight))
{
    backBufferData = new Texture2D(
        GraphicsDevice,
        GraphicsDevice.PresentationParameters.BackBufferWidth,
        GraphicsDevice.PresentationParameters.BackBufferHeight);

    Rectangle sourceRectangle =
        new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 1, 1);

    Color[] retrievedColor = new Color[1];

    backBufferData.GetData<Color>(
        0,
        sourceRectangle,
        retrievedColor,
        0,
        1);
}

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.GetData Generic Method (T[])

Texture2D.GetData Generic Method (T[])
See Also Example
CollapseAll image

Gets a copy of 2D texture data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         T[] data
) where T : ValueType

Type Parameters

T
The type of the elements in the array. This is usually a Microsoft.Xna.Framework.Graphics.PackedVector type but it can be any fundamental type that matches the bit size of the surface format.

Parameters

data
Array of data.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data must be of sufficient length to receive the data.
InvalidOperationException | The vertex stride is larger than the vertex buffer, or the vertex stride is too small for the type of data requested.

Expand image Example

In this example, the color of the pixel beneath the mouse is retrieved from the back buffer.

C#
sourceTexture.SetData<Color>(sourceColorData);

// Initialize a texture with texture data from another texture
sourceTexture.GetData<Color>(destinationColorData);
destinationTexture.SetData<Color>(destinationColorData);
if (Mouse.GetState().LeftButton == ButtonState.Pressed &&
    // If the left button is pressed
    Mouse.GetState().X > 0 && Mouse.GetState().Y > 0 &&
    // and we are inside the game window
    (Mouse.GetState().X <
    GraphicsDevice.PresentationParameters.BackBufferWidth) &&
    (Mouse.GetState().Y <
    GraphicsDevice.PresentationParameters.BackBufferHeight))
{
    backBufferData = new Texture2D(
        GraphicsDevice,
        GraphicsDevice.PresentationParameters.BackBufferWidth,
        GraphicsDevice.PresentationParameters.BackBufferHeight);

    Rectangle sourceRectangle =
        new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 1, 1);

    Color[] retrievedColor = new Color[1];

    backBufferData.GetData<Color>(
        0,
        sourceRectangle,
        retrievedColor,
        0,
        1);
}

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.GetData Generic Method (T[], Int32, Int32)

Texture2D.GetData Generic Method (T[], Int32, Int32)
See Also Example
CollapseAll image

Gets a copy of 2D texture data, specifying a start index and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array. This is usually a Microsoft.Xna.Framework.Graphics.PackedVector type but it can be any fundamental type that matches the bit size of the surface format.

Parameters

data
Array of data.
startIndex
Index of the first element to get.
elementCount
Number of elements to get.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data must be of sufficient length to receive the data.
InvalidOperationException | The vertex stride is larger than the vertex buffer, or the vertex stride is too small for the type of data requested.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image Example

In this example, the color of the pixel beneath the mouse is retrieved from the back buffer.

C#
sourceTexture.SetData<Color>(sourceColorData);

// Initialize a texture with texture data from another texture
sourceTexture.GetData<Color>(destinationColorData);
destinationTexture.SetData<Color>(destinationColorData);
if (Mouse.GetState().LeftButton == ButtonState.Pressed &&
    // If the left button is pressed
    Mouse.GetState().X > 0 && Mouse.GetState().Y > 0 &&
    // and we are inside the game window
    (Mouse.GetState().X <
    GraphicsDevice.PresentationParameters.BackBufferWidth) &&
    (Mouse.GetState().Y <
    GraphicsDevice.PresentationParameters.BackBufferHeight))
{
    backBufferData = new Texture2D(
        GraphicsDevice,
        GraphicsDevice.PresentationParameters.BackBufferWidth,
        GraphicsDevice.PresentationParameters.BackBufferHeight);

    Rectangle sourceRectangle =
        new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 1, 1);

    Color[] retrievedColor = new Color[1];

    backBufferData.GetData<Color>(
        0,
        sourceRectangle,
        retrievedColor,
        0,
        1);
}

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.SaveAsJpeg Method

Texture2D.SaveAsJpeg Method

Saves texture data as a .jpg.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SaveAsJpeg (
         Stream stream,
         int width,
         int height
)

Parameters

stream
Data stream number.
width
Image width.
height
Image height.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.SaveAsPng Method

Texture2D.SaveAsPng Method

Saves texture data as a .png.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SaveAsPng (
         Stream stream,
         int width,
         int height
)

Parameters

stream
Data stream number.
width
Image width.
height
Image height.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.SetData Method

Texture2D.SetData Method

Sets data to the texture.

Expand image Overload List

Name | Description
Texture2D.SetData (Int32, Nullable<Rectangle>, T[], Int32, Int32) | Sets 2D texture data, specifying a mipmap level, source rectangle, start index, and number of elements.
Texture2D.SetData (T[]) | Sets 2D texture data.
Texture2D.SetData (T[], Int32, Int32) | Sets 2D texture data, specifying a start index, and number of elements.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace


Texture2D.SetData Generic Method (Int32, Nullable<Rectangle>, T[], Int32, Int32)

Texture2D.SetData Generic Method (Int32, Nullable<Rectangle>, T[], Int32, Int32)
See Also
CollapseAll image

Sets 2D texture data, specifying a mipmap level, source rectangle, start index, and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         int level,
         Nullable<Rectangle> rect,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

level
Mipmap level.
rect
A bounding box that defines the position and location (in pixels) of the data.
data
Array of data.
startIndex
Index of the first element to set.
elementCount
Number of elements to set.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.SetData Generic Method (T[])

Texture2D.SetData Generic Method (T[])
See Also
CollapseAll image

Sets 2D texture data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         T[] data
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The size of the data passed in is too large or too small for this resource.

Expand image Remarks

Caution

Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to vertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes.

This is because, in cases where the size of the back buffer and depth-stencil buffer exceed the size of the Xbox 360 10 MB of embedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirements. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render target dimensions.

When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not available for modification until the GPU is finished with presenting the entire frame.

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Concepts

Predicated Tiling

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.SetData Generic Method (T[], Int32, Int32)

Texture2D.SetData Generic Method (T[], Int32, Int32)
See Also
CollapseAll image

Sets 2D texture data, specifying a start index, and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.
startIndex
Index of the first element to set.
elementCount
Number of elements to set.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D Properties

Texture2D Properties

Expand image Public Properties

 | Name | Description
Public Property | Bounds | Gets the size of this resource.
Public Property | Format | (Inherited from Texture.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | Height | Gets the height of this texture resource, in pixels.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | (Inherited from Texture.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Width | Gets the width of this texture resource, in pixels.

Expand image See Also

Reference

Texture2D Class
Microsoft.Xna.Framework.Graphics Namespace


Texture2D.Bounds Property

Texture2D.Bounds Property

Gets the size of this resource.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Rectangle Bounds { get; }

Property Value

A bounding-box rectangle.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.Height Property

Texture2D.Height Property

Gets the height of this texture resource, in pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Height { get; }

Property Value

The height of this texture resource, in pixels.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture2D.Width Property

Texture2D.Width Property

Gets the width of this texture resource, in pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Width { get; }

Property Value

The width of this texture resource, in pixels.

Expand image See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D Class

Texture3D Class
See Also Members
CollapseAll image

Represents a 3D volume of texels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class Texture3D : Texture

Expand image Remarks

A texel represents the smallest unit of a texture that can be read from or written to by the GPU. A texel is composed of 1 to 4 components. Specifically, a texel may be any one of the available texture formats represented in the SurfaceFormat enumeration.

A Texture3D resource (also known as a volume texture) contains a 3D volume of texels. Since it is a texture resource, it may contain mipmap levels. Figure 1 shows a fully populated Texture3D resource.

Figure 1. Texture3D Resource Architecture

When a Texture3D mipmap slice is bound as a render target output (by creating a RenderTargetCube), the Texture3D behaves identically to an array of Texture2D objects with n array slices, where n is the depth (third dimension) of the Texture3D.

Expand image See Also

Reference

RenderTargetCube Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D Members

Texture3D Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the Texture3D type.

Expand image Public Constructors

 | Name | Description
Public Method | Texture3D | Creates a new instance of this object.
 | Texture3D | Overloaded. Creates a new instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | Depth | Gets the depth of this volume texture resource, in pixels.
Public Property | Format | (Inherited from Texture.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | Height | Gets the height of this texture resource, in pixels.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | (Inherited from Texture.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Width | Gets the width of this texture resource, in pixels.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | Overloaded. Gets a copy of the texture data.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Sets data.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

Texture3D Class
Microsoft.Xna.Framework.Graphics Namespace


Texture3D Constructor

Texture3D Constructor

Creates a new instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture3D (
         GraphicsDevice graphicsDevice,
         int width,
         int height,
         int depth,
         bool mipMap,
         SurfaceFormat format
)

Parameters

graphicsDevice
A device.
width
Texture width.
height
Texture height.
depth
Texture depth.
mipMap
[MarshalAsAttribute(U1)] True to generate a full mipmap chain; false otherwise.
format
Data format.

Expand image Exceptions

Exception type Condition
NotSupportedException One or more of the following is true:
  • The profile does not support MaxVolumeExtent of 0.
  • The profile does not support the requested format.
  • The profile supports a maximum texture size of 2048.
  • The profile supports a maximum texture aspect ratio of 2048.
  • The profile requires texture size to be a power of two.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D Constructor

Texture3D Constructor

Creates a new instance of this object.

Expand image Overload List

Name Description

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace


Texture3D Methods

Texture3D Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | Overloaded. Gets a copy of the texture data.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Sets data.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Texture3D Class
Microsoft.Xna.Framework.Graphics Namespace


Texture3D.GetData Method

Texture3D.GetData Method

Gets a copy of the texture data.

Expand image Overload List

Name | Description
Texture3D.GetData (Int32, Int32, Int32, Int32, Int32, Int32, Int32, T[], Int32, Int32) | Gets a copy of 3D texture data, specifying a mimap level, source rectangle, start index, and number of elements.
Texture3D.GetData (T[]) | Gets a copy of 3D texture data.
Texture3D.GetData (T[], Int32, Int32) | Gets a copy of 3D texture data, specifying a start index and number of elements.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace


Texture3D.GetData Generic Method (Int32, Int32, Int32, Int32, Int32, Int32, Int32, T[], Int32, Int32)

Texture3D.GetData Generic Method (Int32, Int32, Int32, Int32, Int32, Int32, Int32, T[], Int32, Int32)
See Also
CollapseAll image

Gets a copy of 3D texture data, specifying a mimap level, source rectangle, start index, and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         int level,
         int left,
         int top,
         int right,
         int bottom,
         int front,
         int back,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

level
Mipmap level.
left
Position of the left side of the box on the x-axis.
top
Position of the top of the box on the y-axis.
right
Position of the right side of the box on the x-axis.
bottom
Position of the bottom of the box on the y-axis.
front
Position of the front of the box on the z-axis.
back
Position of the back of the box on the z-axis.
data
Array of data.
startIndex
Index of the first element to get.
elementCount
Number of elements to get.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D.GetData Generic Method (T[])

Texture3D.GetData Generic Method (T[])
See Also
CollapseAll image

Gets a copy of 3D texture data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         T[] data
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D.GetData Generic Method (T[], Int32, Int32)

Texture3D.GetData Generic Method (T[], Int32, Int32)
See Also
CollapseAll image

Gets a copy of 3D texture data, specifying a start index and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.
startIndex
Index of the first element to get.
elementCount
Number of elements to get.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D.SetData Method

Texture3D.SetData Method

Sets data.

Expand image Overload List

Name | Description
Texture3D.SetData (Int32, Int32, Int32, Int32, Int32, Int32, Int32, T[], Int32, Int32) | Sets 3D texture data, specifying a mipmap level, source box, start index, and number of elements.
Texture3D.SetData (T[]) | Sets 3D texture data.
Texture3D.SetData (T[], Int32, Int32) | Sets 3D texture data, specifying a start index and number of elements.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace


Texture3D.SetData Generic Method (Int32, Int32, Int32, Int32, Int32, Int32, Int32, T[], Int32, Int32)

Texture3D.SetData Generic Method (Int32, Int32, Int32, Int32, Int32, Int32, Int32, T[], Int32, Int32)
See Also
CollapseAll image

Sets 3D texture data, specifying a mipmap level, source box, start index, and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         int level,
         int left,
         int top,
         int right,
         int bottom,
         int front,
         int back,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

level
Mipmap level.
left
X coordinate of the left face of the 3D bounding cube.
top
Y coordinate of the top face of the 3D bounding cube.
right
X coordinate of the right face of the 3D bounding cube.
bottom
Y coordinate of the bottom face of the 3D bounding cube.
front
Z coordinate of the front face of the 3D bounding cube.
back
Z coordinate of the back face of the 3D bounding cube.
data
Array of data.
startIndex
Index of the first element to set.
elementCount
Number of elements to set.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D.SetData Generic Method (T[])

Texture3D.SetData Generic Method (T[])
See Also
CollapseAll image

Sets 3D texture data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         T[] data
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D.SetData Generic Method (T[], Int32, Int32)

Texture3D.SetData Generic Method (T[], Int32, Int32)
See Also
CollapseAll image

Sets 3D texture data, specifying a start index and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.
startIndex
Index of the first element to set.
elementCount
Number of elements to set.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D Properties

Texture3D Properties

Expand image Public Properties

 | Name | Description
Public Property | Depth | Gets the depth of this volume texture resource, in pixels.
Public Property | Format | (Inherited from Texture.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | Height | Gets the height of this texture resource, in pixels.
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | (Inherited from Texture.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | Width | Gets the width of this texture resource, in pixels.

Expand image See Also

Reference

Texture3D Class
Microsoft.Xna.Framework.Graphics Namespace


Texture3D.Depth Property

Texture3D.Depth Property

Gets the depth of this volume texture resource, in pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Depth { get; }

Property Value

The depth of this volume texture resource, in pixels.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D.Height Property

Texture3D.Height Property

Gets the height of this texture resource, in pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Height { get; }

Property Value

The height of this texture resource, in pixels.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Texture3D.Width Property

Texture3D.Width Property

Gets the width of this texture resource, in pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Width { get; }

Property Value

The width of this texture resource, in pixels.

Expand image See Also

Reference

Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureAddressMode Enumeration

TextureAddressMode Enumeration

Defines modes for addressing texels using texture coordinates that are outside of the typical range of 0.0 to 1.0.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum TextureAddressMode

Expand image Members

Member name | Description
Clamp | Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively.
Mirror | Similar to Wrap, except that the texture is flipped at every integer junction. For u values between 0 and 1, for example, the texture is addressed normally; between 1 and 2, the texture is flipped (mirrored); between 2 and 3, the texture is normal again, and so on.
Wrap | Tile the texture at every integer junction. For example, for u values between 0 and 3, the texture is repeated three times; no mirroring is performed.

Expand image See Also

Reference

AddressU
AddressV
AddressW
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCollection Class

TextureCollection Class
See Also Members
CollapseAll image

Represents a collection of Texture objects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public sealed class TextureCollection

Expand image See Also

Reference

TextureCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCollection Members

TextureCollection Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the TextureCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Item | Gets or sets the Texture at the specified sampler number.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureCollection Class
Microsoft.Xna.Framework.Graphics Namespace


TextureCollection Methods

TextureCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureCollection Class
Microsoft.Xna.Framework.Graphics Namespace


TextureCollection Properties

TextureCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Item | Gets or sets the Texture at the specified sampler number.

Expand image See Also

Reference

TextureCollection Class
Microsoft.Xna.Framework.Graphics Namespace


TextureCollection.Item Property

TextureCollection.Item Property

Gets or sets the Texture at the specified sampler number.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Texture this [
         int index
] { get; set; }

Property Value

The Texture at the specified index.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | The sampler number is invalid. It is either less than zero or greater than the maximum number of textures available for the graphics device.
ObjectDisposedException | Item was called after the GraphicsDevice was disposed.

Expand image See Also

Reference

GraphicsDevice.SamplerStates Property
GraphicsDevice.Textures Property
GraphicsDevice.VertexTextures Property
TextureCollection Class
TextureCollection Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCube Class

TextureCube Class
See Also Members
CollapseAll image

Represents a set of six 2D textures, one for each face of a cube.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class TextureCube : Texture

Expand image Remarks

A texel represents the smallest unit of a texture that can be read from or written to by the GPU. A texel is composed of 1 to 4 components. Specifically, a texel may be any one of the available texture formats represented in the SurfaceFormat enumeration.

A cube texture is a collection of six textures, one for each face of the cube. All faces must be present in the cube texture. Also, a cube map surface must be the same pixel size in all three dimensions (x, y, and z). Figure 1 shows a fully populated texture cube.

Figure 1. TextureCube Resource Architecture

Expand image See Also

Reference

TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCube Members

TextureCube Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the TextureCube type.

Expand image Public Constructors

 | Name | Description
Public Method | TextureCube | Creates a new instance of this object.
 | TextureCube | Overloaded. Creates a new instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | Format | (Inherited from Texture.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | (Inherited from Texture.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Size | Gets the width and height of this texture resource, in pixels.
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | Overloaded. Returns a copy of the texture data.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Sets texture data.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

TextureCube Class
Microsoft.Xna.Framework.Graphics Namespace


TextureCube Constructor

TextureCube Constructor

Creates a new instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public TextureCube (
         GraphicsDevice graphicsDevice,
         int size,
         bool mipMap,
         SurfaceFormat format
)

Parameters

graphicsDevice
The device.
size
The size (in pixels) of the top-level faces of the cube texture. Subsequent levels of each face will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension is clamped to a minimum of 1 pixel.
mipMap
[MarshalAsAttribute(U1)] True to generate a full mipmap chain, false otherwise.
format
Surface data format.

Expand image Exceptions

Exception type Condition
NotSupportedException One or more of the following is true:
  • The profile does not support the requested format.
  • The profile supports a maximum texture size of 2048.
  • The profile requires texture size to be a power of two.

Expand image Remarks

To initialize the resource from an existing file, use ContentManager.Load.

Expand image See Also

Reference

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCube Constructor

TextureCube Constructor

Creates a new instance of this object.

Expand image Overload List

Name Description

Expand image See Also

Reference

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace


TextureCube Methods

TextureCube Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | (Inherited from GraphicsResource.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | Overloaded. Returns a copy of the texture data.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Sets texture data.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureCube Class
Microsoft.Xna.Framework.Graphics Namespace


TextureCube.GetData Method

TextureCube.GetData Method

Returns a copy of the texture data.

Expand image Overload List

Name | Description
TextureCube.GetData (CubeMapFace, Int32, Nullable<Rectangle>, T[], Int32, Int32) | Gets a copy of cube texture data, specifying a cubemap face, mimap level, source rectangle, start index, and number of elements.
TextureCube.GetData (CubeMapFace, T[]) | Gets a copy of cube texture data specifying a cubemap face.
TextureCube.GetData (CubeMapFace, T[], Int32, Int32) | Gets a copy of cube texture data, specifying a cubemap face, start index, and number of elements.

Expand image See Also

Reference

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace


TextureCube.GetData Generic Method (CubeMapFace, Int32, Nullable<Rectangle>, T[], Int32, Int32)

TextureCube.GetData Generic Method (CubeMapFace, Int32, Nullable<Rectangle>, T[], Int32, Int32)
See Also
CollapseAll image

Gets a copy of cube texture data, specifying a cubemap face, mimap level, source rectangle, start index, and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         CubeMapFace cubeMapFace,
         int level,
         Nullable<Rectangle> rect,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

cubeMapFace
Cube map face.
level
Mipmap level.
rect
The section of the texture where the data will be placed. null indicates the data will be copied over the entire texture.
data
Array of data.
startIndex
Index of the first element to get.
elementCount
Number of elements to get.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data must be of sufficient length to receive the data.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCube.GetData Generic Method (CubeMapFace, T[])

TextureCube.GetData Generic Method (CubeMapFace, T[])
See Also
CollapseAll image

Gets a copy of cube texture data specifying a cubemap face.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         CubeMapFace cubeMapFace,
         T[] data
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

cubeMapFace
Cubemap face.
data
Array of data.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data must be of sufficient length to receive the data.

Expand image See Also

Reference

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCube.GetData Generic Method (CubeMapFace, T[], Int32, Int32)

TextureCube.GetData Generic Method (CubeMapFace, T[], Int32, Int32)
See Also
CollapseAll image

Gets a copy of cube texture data, specifying a cubemap face, start index, and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         CubeMapFace cubeMapFace,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

cubeMapFace
Cubemap face.
data
Array of data.
startIndex
Index of the first element to get.
elementCount
Number of elements to get.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data must be of sufficient length to receive the data.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCube.SetData Method

TextureCube.SetData Method

Sets texture data.

Expand image Overload List

Name | Description
TextureCube.SetData (CubeMapFace, Int32, Nullable<Rectangle>, T[], Int32, Int32) | Sets cube texture data, specifying a cubemap face, mipmap level, source rectangle, start index, and number of elements.
TextureCube.SetData (CubeMapFace, T[]) | Sets cube texture data, specifying a cubemap face.
TextureCube.SetData (CubeMapFace, T[], Int32, Int32) | Sets cube texture data, specifying a cubemap face, start index, and number of elements.

Expand image See Also

Reference

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace


TextureCube.SetData Generic Method (CubeMapFace, Int32, Nullable<Rectangle>, T[], Int32, Int32)

TextureCube.SetData Generic Method (CubeMapFace, Int32, Nullable<Rectangle>, T[], Int32, Int32)
See Also
CollapseAll image

Sets cube texture data, specifying a cubemap face, mipmap level, source rectangle, start index, and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         CubeMapFace cubeMapFace,
         int level,
         Nullable<Rectangle> rect,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

cubeMapFace
Cubemap face.
level
Mipmap level.
rect
Region in the texture to set the data; use null to set data to the entire texture.
data
Array of data.
startIndex
Index of the first element to set.
elementCount
Number of elements to set.

Expand image See Also

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCube.SetData Generic Method (CubeMapFace, T[])

TextureCube.SetData Generic Method (CubeMapFace, T[])
See Also
CollapseAll image

Sets cube texture data, specifying a cubemap face.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         CubeMapFace cubeMapFace,
         T[] data
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

cubeMapFace
The cubemap face.
data
Array of data.

Expand image See Also

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCube.SetData Generic Method (CubeMapFace, T[], Int32, Int32)

TextureCube.SetData Generic Method (CubeMapFace, T[], Int32, Int32)
See Also
CollapseAll image

Sets cube texture data, specifying a cubemap face, start index, and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         CubeMapFace cubeMapFace,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

cubeMapFace
The cubemap face.
data
Array of data.
startIndex
Index of the first element to set.
elementCount
Number of elements to set.

Expand image See Also

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureCube Properties

TextureCube Properties

Expand image Public Properties

 | Name | Description
Public Property | Format | (Inherited from Texture.)
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | LevelCount | (Inherited from Texture.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Size | Gets the width and height of this texture resource, in pixels.
Public Property | Tag | (Inherited from GraphicsResource.)

Expand image See Also

Reference

TextureCube Class
Microsoft.Xna.Framework.Graphics Namespace


TextureCube.Size Property

TextureCube.Size Property

Gets the width and height of this texture resource, in pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Size { get; }

Property Value

The size of this texture resource, in pixels.

Expand image See Also

Reference

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TextureFilter Enumeration

TextureFilter Enumeration

Defines filtering types during texture sampling.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum TextureFilter

Expand image Members

Member name | Description
Linear | Use linear filtering.
Point | Use point filtering.
Anisotropic | Use anisotropic filtering.
LinearMipPoint | Use linear filtering to shrink or expand, and point filtering between mipmap levels (mip).
PointMipLinear | Use point filtering to shrink (minify) or expand (magnify), and linear filtering between mipmap levels.
MinLinearMagPointMipLinear | Use linear filtering to shrink, point filtering to expand, and linear filtering between mipmap levels.
MinLinearMagPointMipPoint | Use linear filtering to shrink, point filtering to expand, and point filtering between mipmap levels.
MinPointMagLinearMipLinear | Use point filtering to shrink, linear filtering to expand, and linear filtering between mipmap levels.
MinPointMagLinearMipPoint | Use point filtering to shrink, linear filtering to expand, and point filtering between mipmap levels.

Expand image Remarks

A texture coordinate determines where to sample a texture. When a texel does not map exactly to one pixel, filtering is necessary to magnify (enlarge) or minify (shrink) the texture.

Not all valid filtering modes for a device apply to volume maps. In general, Point and Linear magnification filters are supported for volume maps. Devices that support anisotropic filtering for 2D maps do not necessarily support it for volume maps. However, applications that enable anisotropic filtering, even if they do not support it, receive the best available filtering (probably linear).

Expand image See Also

Reference

SamplerState.Filter Property
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer Class

VertexBuffer Class
See Also Members
CollapseAll image

Represents a list of 3D vertices to be streamed to the graphics device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class VertexBuffer : GraphicsResource

Expand image See Also

Reference

VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer Members

VertexBuffer Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the VertexBuffer type.

Expand image Public Constructors

 | Name | Description
Public Method | VertexBuffer | Overloaded. Creates an instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | BufferUsage | Gets the state of the related BufferUsage enumeration.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | VertexCount | Gets the number of vertices.
Public Property | VertexDeclaration | Defines per-vertex data in a buffer.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | Overloaded. Returns a copy of the vertex buffer data.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Sets the vertex buffer data.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

VertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


VertexBuffer Constructor

VertexBuffer Constructor

Creates an instance of this object.

Expand image Overload List

Name | Description
VertexBuffer (GraphicsDevice, Type, Int32, BufferUsage) | Creates an instance of this object.
VertexBuffer (GraphicsDevice, VertexDeclaration, Int32, BufferUsage) | Creates an instance of this object.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


VertexBuffer Constructor (GraphicsDevice, Type, Int32, BufferUsage)

VertexBuffer Constructor (GraphicsDevice, Type, Int32, BufferUsage)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexBuffer (
         GraphicsDevice graphicsDevice,
         Type vertexType,
         int vertexCount,
         BufferUsage usage
)

Parameters

graphicsDevice
The graphics device.
vertexType
The data type.
vertexCount
The number of vertices.
usage
Behavior options; it is good practice for this to match the createOptions parameter in the GraphicsDevice constructor.

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer Constructor (GraphicsDevice, VertexDeclaration, Int32, BufferUsage)

VertexBuffer Constructor (GraphicsDevice, VertexDeclaration, Int32, BufferUsage)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexBuffer (
         GraphicsDevice graphicsDevice,
         VertexDeclaration vertexDeclaration,
         int vertexCount,
         BufferUsage usage
)

Parameters

graphicsDevice
The graphics device.
vertexDeclaration
The vertex declaration, which describes per-vertex data.
vertexCount
The number of vertices.
usage
Behavior options; it is good practice for this to match the createOptions parameter in the GraphicsDevice constructor.

Expand image Exceptions

Exception type | Condition
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer Methods

VertexBuffer Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetData | Overloaded. Returns a copy of the vertex buffer data.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetData | Overloaded. Sets the vertex buffer data.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


VertexBuffer.Dispose Method

VertexBuffer.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
VertexBuffer.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image Remarks

Call Dispose when you are finished using the VertexBuffer. The Dispose method leaves the VertexBuffer in an unusable state. After calling Dispose, you must release all references to the VertexBuffer so the garbage collector can reclaim the memory that the VertexBuffer was occupying.

Note
Always call Dispose before you release your last reference to the VertexBuffer. Otherwise, the resources it is using will not be freed until the garbage collector calls the VertexBuffer object's Finalize method.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


VertexBuffer.Dispose Method (Boolean)

VertexBuffer.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image Remarks

This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.

When the disposing parameter is true, this method releases all resources held by any managed objects that this VertexBuffer references. This method invokes the Dispose method of each referenced object.

Note

Notes to Inheritors

Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects disposed of in an earlier call to Dispose.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer.GetData Method

VertexBuffer.GetData Method

Returns a copy of the vertex buffer data.

Expand image Overload List

Name | Description
VertexBuffer.GetData (Int32, T[], Int32, Int32, Int32) | Gets a copy of the vertex buffer data, specifying the starting offset, start index, number of elements, and vertex stride.
VertexBuffer.GetData (T[]) | Gets a copy of the vertex buffer data.
VertexBuffer.GetData (T[], Int32, Int32) | Gets a copy of the vertex buffer data, specifying the start index and number of elements.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


VertexBuffer.GetData Generic Method (Int32, T[], Int32, Int32, Int32)

VertexBuffer.GetData Generic Method (Int32, T[], Int32, Int32, Int32)
See Also
CollapseAll image

Gets a copy of the vertex buffer data, specifying the starting offset, start index, number of elements, and vertex stride.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         int offsetInBytes,
         T[] data,
         int startIndex,
         int elementCount,
         int vertexStride
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

offsetInBytes
Offset in bytes from the beginning of the buffer to the data.
data
Array of data.
startIndex
Index of the first element to get.
elementCount
Number of elements to get.
vertexStride
Size, in bytes, of an element in the vertex buffer.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null. data must be of sufficient length to receive the data.
ArgumentOutOfRangeException One of the following conditions is true:
  • The vertex stride is larger than the vertex buffer.
  • The vertex stride is too small for the type of data requested.
InvalidOperationException | The array is not the correct size for the amount of data requested.
NotSupportedException | This VertexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData on a resource that was created with BufferUsage.WriteOnly is not supported.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer.GetData Generic Method (T[])

VertexBuffer.GetData Generic Method (T[])
See Also
CollapseAll image

Gets a copy of the vertex buffer data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         T[] data
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null. data must be of sufficient length to receive the data.
ArgumentOutOfRangeException One of the following conditions is true:
  • The vertex stride is larger than the vertex buffer.
  • The vertex stride is too small for the type of data requested.
InvalidOperationException | The array is not the correct size for the amount of data requested.
NotSupportedException | This VertexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData on a resource that was created with BufferUsage.WriteOnly is not supported.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer.GetData Generic Method (T[], Int32, Int32)

VertexBuffer.GetData Generic Method (T[], Int32, Int32)
See Also
CollapseAll image

Gets a copy of the vertex buffer data, specifying the start index and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void GetData<T> (
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.
startIndex
Index of the first element to get.
elementCount
Number of elements to get.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null. data must be of sufficient length to receive the data.
ArgumentOutOfRangeException One of the following conditions is true:
  • The vertex stride is larger than the vertex buffer.
  • The vertex stride is too small for the type of data requested.
InvalidOperationException | The array is not the correct size for the amount of data requested.
NotSupportedException | This VertexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData on a resource that was created with BufferUsage.WriteOnly is not supported.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer.SetData Method

VertexBuffer.SetData Method

Sets the vertex buffer data.

Expand image Overload List

Name | Description
VertexBuffer.SetData (Int32, T[], Int32, Int32, Int32) | Sets vertex buffer data, specifying the offset, start index, number of elements, and the vertex stride.
VertexBuffer.SetData (T[]) | Sets vertex buffer data.
VertexBuffer.SetData (T[], Int32, Int32) | Sets vertex buffer data, specifying the start index and number of elements.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace


VertexBuffer.SetData Generic Method (Int32, T[], Int32, Int32, Int32)

VertexBuffer.SetData Generic Method (Int32, T[], Int32, Int32, Int32)
See Also
CollapseAll image

Sets vertex buffer data, specifying the offset, start index, number of elements, and the vertex stride.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         int offsetInBytes,
         T[] data,
         int startIndex,
         int elementCount,
         int vertexStride
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

offsetInBytes
Offset in bytes from the beginning of the buffer to the data.
data
Array of data.
startIndex
Index of the first element to set.
elementCount
Number of elements to set.
vertexStride
Stride, or size, of a vertex.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null.
ArgumentOutOfRangeException One of the following conditions is true:
  • The vertex stride is larger than the vertex buffer.
  • The vertex stride is too small for the type of data requested.
InvalidOperationException | The array is not the correct size for the amount of data requested.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer.SetData Generic Method (T[])

VertexBuffer.SetData Generic Method (T[])
See Also Example
CollapseAll image

Sets vertex buffer data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         T[] data
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null.
ArgumentOutOfRangeException One of the following conditions is true:
  • The vertex stride is larger than the vertex buffer.
  • The vertex stride is too small for the type of data requested.
InvalidOperationException | The array is not the correct size for the amount of data requested.

Expand image Example

This example demonstrates how to create a vertex buffer to hold a list of vertices and set the data for the vertex buffer to the array of vertices.

C#
// Initialize the vertex buffer, allocating memory for each vertex.
vertexBuffer = new VertexBuffer(graphics.GraphicsDevice, vertexDeclaration,
    points, BufferUsage.None);

// Set the vertex buffer data to the array of vertices.
vertexBuffer.SetData<VertexPositionColor>(pointList);

Expand image See Also

Concepts

Predicated Tiling

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer.SetData Generic Method (T[], Int32, Int32)

VertexBuffer.SetData Generic Method (T[], Int32, Int32)
See Also
CollapseAll image

Sets vertex buffer data, specifying the start index and number of elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public void SetData<T> (
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType

Type Parameters

T
The type of the elements in the array.

Parameters

data
Array of data.
startIndex
Index of the first element to set.
elementCount
Number of elements to set.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null.
ArgumentOutOfRangeException One of the following conditions is true:
  • The vertex stride is larger than the vertex buffer.
  • The vertex stride is too small for the type of data requested.
InvalidOperationException | The array is not the correct size for the amount of data requested.

Expand image Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer Properties

VertexBuffer Properties

Expand image Public Properties

 | Name | Description
Public Property | BufferUsage | Gets the state of the related BufferUsage enumeration.
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | VertexCount | Gets the number of vertices.
Public Property | VertexDeclaration | Defines per-vertex data in a buffer.

Expand image See Also

Reference

VertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace


VertexBuffer.BufferUsage Property

VertexBuffer.BufferUsage Property

Gets the state of the related BufferUsage enumeration.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public BufferUsage BufferUsage { get; }

Property Value

Indicates how the application uses buffer contents.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer.VertexCount Property

VertexBuffer.VertexCount Property

Gets the number of vertices.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int VertexCount { get; }

Property Value

The number of vertices.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBuffer.VertexDeclaration Property

VertexBuffer.VertexDeclaration Property

Defines per-vertex data in a buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexDeclaration VertexDeclaration { get; }

Property Value

Defines per-vertex data.

Expand image See Also

Reference

VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBufferBinding Structure

VertexBufferBinding Structure

Binding structure that specifies a vertex buffer and other per-vertex parameters (such as offset and instancing) for a graphics device.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public struct VertexBufferBinding

Expand image See Also

Reference

VertexBufferBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBufferBinding Members

VertexBufferBinding Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the VertexBufferBinding type.

Expand image Public Constructors

 | Name | Description
Public Method | VertexBufferBinding | Overloaded. Creates an instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | InstanceFrequency | Gets the instancing frequency.
Public Property | VertexBuffer | Gets a vertex buffer.
Public Property | VertexOffset | Gets the offset between the beginning of the buffer and the vertex data to use.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexBufferBinding Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexBufferBinding Constructor

VertexBufferBinding Constructor

Creates an instance of this object.

Expand image Overload List

Name | Description
VertexBufferBinding (VertexBuffer) | Creates an instance of this object.
VertexBufferBinding (VertexBuffer, Int32) | Creates an instance of this object.
VertexBufferBinding (VertexBuffer, Int32, Int32) | Creates an instance of this object.

Expand image See Also

Reference

VertexBufferBinding Structure
VertexBufferBinding Members
Microsoft.Xna.Framework.Graphics Namespace


VertexBufferBinding Constructor (VertexBuffer)

VertexBufferBinding Constructor (VertexBuffer)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexBufferBinding (
         VertexBuffer vertexBuffer
)

Parameters

vertexBuffer
The vertex buffer.

Expand image See Also

Reference

VertexBufferBinding Structure
VertexBufferBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBufferBinding Constructor (VertexBuffer, Int32)

VertexBufferBinding Constructor (VertexBuffer, Int32)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexBufferBinding (
         VertexBuffer vertexBuffer,
         int vertexOffset
)

Parameters

vertexBuffer
The vertex buffer.
vertexOffset
Offset (in bytes) from the beginning of the buffer to the first vertex to use.

Expand image See Also

Reference

VertexBufferBinding Structure
VertexBufferBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBufferBinding Constructor (VertexBuffer, Int32, Int32)

VertexBufferBinding Constructor (VertexBuffer, Int32, Int32)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexBufferBinding (
         VertexBuffer vertexBuffer,
         int vertexOffset,
         int instanceFrequency
)

Parameters

vertexBuffer
The vertex buffer.
vertexOffset
Offset (in bytes) from the beginning of the buffer to the first vertex to use.
instanceFrequency
Number (or frequency) of instances to draw for each draw call; 1 means draw one instance, 2 means draw 2 instances, etc. Use 0 if you are not instancing.

Expand image Remarks

The frequency is the number of times to draw the same geometry each time draw is called: 1 means draw one instance, 2 means draw two instances, and so on. Use 0 if you are not instancing.

Expand image See Also

Reference

VertexBufferBinding Structure
VertexBufferBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBufferBinding Methods

VertexBufferBinding Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexBufferBinding Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexBufferBinding Properties

VertexBufferBinding Properties

Expand image Public Properties

 | Name | Description
Public Property | InstanceFrequency | Gets the instancing frequency.
Public Property | VertexBuffer | Gets a vertex buffer.
Public Property | VertexOffset | Gets the offset between the beginning of the buffer and the vertex data to use.

Expand image See Also

Reference

VertexBufferBinding Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexBufferBinding.InstanceFrequency Property

VertexBufferBinding.InstanceFrequency Property

Gets the instancing frequency.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int InstanceFrequency { get; }

Property Value

The number of instances to draw for each draw call.

Expand image Remarks

The frequency is the number of times to draw the same geometry each time draw is called: 1 means draw one instance, 2 means draw two instances, and so on. Use 0 if you are not instancing.

Expand image See Also

Reference

VertexBufferBinding Structure
VertexBufferBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBufferBinding.VertexBuffer Property

VertexBufferBinding.VertexBuffer Property

Gets a vertex buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexBuffer VertexBuffer { get; }

Property Value

A vertex buffer.

Expand image See Also

Reference

VertexBufferBinding Structure
VertexBufferBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexBufferBinding.VertexOffset Property

VertexBufferBinding.VertexOffset Property

Gets the offset between the beginning of the buffer and the vertex data to use.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int VertexOffset { get; }

Property Value

The offset (in bytes).

Expand image See Also

Reference

VertexBufferBinding Structure
VertexBufferBinding Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexDeclaration Class

VertexDeclaration Class
See Also Members
CollapseAll image

A vertex declaration, which defines per-vertex data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public class VertexDeclaration : GraphicsResource

Expand image See Also

Reference

VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexDeclaration Members

VertexDeclaration Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the VertexDeclaration type.

Expand image Public Constructors

 | Name | Description
Public Method | VertexDeclaration | Overloaded. Creates an instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | VertexStride | The number of bytes from one vertex to the next.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetVertexElements | Gets the vertex shader declaration.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

VertexDeclaration Class
Microsoft.Xna.Framework.Graphics Namespace


VertexDeclaration Constructor

VertexDeclaration Constructor

Creates an instance of this object.

Expand image Overload List

Name | Description
VertexDeclaration (Int32, VertexElement[]) | Creates an instance of this object.
VertexDeclaration (VertexElement[]) | Creates an instance of this object.

Expand image See Also

Reference

VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace


VertexDeclaration Constructor (Int32, VertexElement[])

VertexDeclaration Constructor (Int32, VertexElement[])
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexDeclaration (
         int vertexStride,
         params VertexElement[] elements
)

Parameters

vertexStride
The number of bytes per element.
elements
[ParamArrayAttribute] An array of per-vertex elements.

Expand image Exceptions

Exception type | Condition
NotSupportedException One or more of the following is true:
  • The vertex stride and the vertex element offset must be multiples of four.
  • The first element does not fit within the specified vertex stride.
  • Duplicate elements.
  • The first and second elements overlap.
  • The profile supports a maximum vertex stride of 255.
  • The profile supports a maximum of 16 simultaneous vertex elements.
  • The profile does not support the format requested.
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexDeclaration Constructor (VertexElement[])

VertexDeclaration Constructor (VertexElement[])
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexDeclaration (
         params VertexElement[] elements
)

Parameters

elements
[ParamArrayAttribute] An array of per-vertex elements.

Expand image Exceptions

Exception type | Condition
NotSupportedException One or more of the following is true:
  • The vertex stride and the vertex element offset must be multiples of four.
  • The first element does not fit within the specified vertex stride.
  • Duplicate elements.
  • The first and second elements overlap.
  • The profile supports a maximum vertex stride of 255.
  • The profile supports a maximum of 16 simultaneous vertex elements.
  • The profile does not support the format requested.
OutOfMemoryException | There is not enough memory to create this resource.

Expand image See Also

Reference

VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexDeclaration Methods

VertexDeclaration Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetVertexElements | Gets the vertex shader declaration.
Public Method | ToString | (Inherited from GraphicsResource.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from GraphicsResource.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexDeclaration Class
Microsoft.Xna.Framework.Graphics Namespace


VertexDeclaration.Dispose Method

VertexDeclaration.Dispose Method

Immediately releases the unmanaged resources used by this object.

Expand image Overload List

Name | Description
VertexDeclaration.Dispose (Boolean) | Immediately releases the unmanaged resources used by this object.

Expand image See Also

Reference

VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace


VertexDeclaration.Dispose Method (Boolean)

VertexDeclaration.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool
)

Parameters

[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image Remarks

This method is called by the public Dispose method, which invokes the protected Dispose(Boolean) method with the disposing parameter set to true.

When the disposing parameter is true, this method releases all resources held by any managed objects that this VertexDeclaration references. This method invokes the Dispose method of each referenced object.

Note

Notes to Inheritors

Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects disposed of in an earlier call to Dispose.

Expand image See Also

Reference

VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexDeclaration.GetVertexElements Method

VertexDeclaration.GetVertexElements Method

Gets the vertex shader declaration.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexElement[] GetVertexElements ()

Return Value

The array of vertex elements that make up the vertex shader declaration.

Expand image See Also

Reference

VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexDeclaration Properties

VertexDeclaration Properties

Expand image Public Properties

 | Name | Description
Public Property | GraphicsDevice | (Inherited from GraphicsResource.)
Public Property | IsDisposed | (Inherited from GraphicsResource.)
Public Property | Name | (Inherited from GraphicsResource.)
Public Property | Tag | (Inherited from GraphicsResource.)
Public Property | VertexStride | The number of bytes from one vertex to the next.

Expand image See Also

Reference

VertexDeclaration Class
Microsoft.Xna.Framework.Graphics Namespace


VertexDeclaration.VertexStride Property

VertexDeclaration.VertexStride Property

The number of bytes from one vertex to the next.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int VertexStride { get; }

Property Value

The stride (in bytes).

Expand image See Also

Reference

VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexDeclaration Events

VertexDeclaration Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | (Inherited from GraphicsResource.)

Expand image See Also

Reference

VertexDeclaration Class
Microsoft.Xna.Framework.Graphics Namespace


VertexElement Structure

VertexElement Structure

Defines input vertex data to the pipeline.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SerializableAttribute]
public struct VertexElement

Expand image See Also

Reference

VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElement Members

VertexElement Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the VertexElement type.

Expand image Public Constructors

 | Name | Description
Public Method | VertexElement | Initializes a new instance of the VertexElement class.

Expand image Public Properties

 | Name | Description
Public Property | Offset | Retrieves or sets the offset (if any) from the beginning of the stream to the beginning of the vertex data.
Public Property | UsageIndex | Modifies the usage data to allow the user to specify multiple usage types.
Public Property | VertexElementFormat | Gets or sets the format of this vertex element.
Public Property | VertexElementUsage | Gets or sets a value describing how the vertex element is to be used.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexElement Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexElement Constructor

VertexElement Constructor

Initializes a new instance of the VertexElement class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexElement (
         int offset,
         VertexElementFormat elementFormat,
         VertexElementUsage elementUsage,
         int usageIndex
)

Parameters

offset
Offset (if any) from the beginning of the stream to the beginning of the vertex data.
elementFormat
One of several predefined types that define the vertex data size.
elementUsage
The intended use of the vertex data.
usageIndex
Modifies the usage data to allow the user to specify multiple usage types.

Expand image Remarks

Vertex data is defined using an array of VertexElement structures.

Expand image See Also

Reference

VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElement Methods

VertexElement Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexElement Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexElement.Equals Method

VertexElement.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current VertexElement.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElement.GetHashCode Method

VertexElement.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElement.op_Equality Method

VertexElement.op_Equality Method

Compares two objects to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool op_Equality (
         VertexElement left,
         VertexElement right
)

Parameters

left
Object to the left of the equality operator.
right
Object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElement.op_Inequality Method

VertexElement.op_Inequality Method

Compares two objects to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         VertexElement left,
         VertexElement right
)

Parameters

left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElement.ToString Method

VertexElement.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElement Properties

VertexElement Properties

Expand image Public Properties

 | Name | Description
Public Property | Offset | Retrieves or sets the offset (if any) from the beginning of the stream to the beginning of the vertex data.
Public Property | UsageIndex | Modifies the usage data to allow the user to specify multiple usage types.
Public Property | VertexElementFormat | Gets or sets the format of this vertex element.
Public Property | VertexElementUsage | Gets or sets a value describing how the vertex element is to be used.

Expand image See Also

Reference

VertexElement Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexElement.Offset Property

VertexElement.Offset Property

Retrieves or sets the offset (if any) from the beginning of the stream to the beginning of the vertex data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Offset { get; set; }

Property Value

Offset, in bytes, to the start of the vertex data.

Expand image See Also

Reference

VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElement.UsageIndex Property

VertexElement.UsageIndex Property

Modifies the usage data to allow the user to specify multiple usage types.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int UsageIndex { get; set; }

Property Value

The usage index.

Expand image Remarks

The UsageIndex property is used in conjunction with VertexElementUsage to specify the semantic of a vertex element.

Expand image See Also

Reference

VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElement.VertexElementFormat Property

VertexElement.VertexElementFormat Property

Gets or sets the format of this vertex element.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexElementFormat VertexElementFormat { get; set; }

Property Value

The format of this vertex element.

Expand image See Also

Reference

VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElement.VertexElementUsage Property

VertexElement.VertexElementUsage Property

Gets or sets a value describing how the vertex element is to be used.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexElementUsage VertexElementUsage { get; set; }

Property Value

A value describing how the vertex element is to be used.

Expand image See Also

Reference

VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElementFormat Enumeration

VertexElementFormat Enumeration

Defines vertex element formats.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum VertexElementFormat

Expand image Members

Member name | Description
Single | Single-component, 32-bit floating-point, expanded to (float, 0, 0, 1).
Vector2 | Two-component, 32-bit floating-point, expanded to (float, Float32 value, 0, 1).
Vector3 | Three-component, 32-bit floating point, expanded to (float, float, float, 1).
Vector4 | Four-component, 32-bit floating point, expanded to (float, float, float, float).
HalfVector2 | Two-component, 16-bit floating point expanded to (value, value, value, value). This type is valid for vertex shader version 2.0 or higher.
HalfVector4 | Four-component, 16-bit floating-point expanded to (value, value, value, value). This type is valid for vertex shader version 2.0 or higher.
Color | Four-component, packed, unsigned byte, mapped to 0 to 1 range. Input is in Int32 format (ARGB) expanded to (R, G, B, A).
NormalizedShort2 | Normalized, two-component, signed short, expanded to (first short/32767.0, second short/32767.0, 0, 1). This type is valid for vertex shader version 2.0 or higher.
NormalizedShort4 | Normalized, four-component, signed short, expanded to (first short/32767.0, second short/32767.0, third short/32767.0, fourth short/32767.0). This type is valid for vertex shader version 2.0 or higher.
Short2 | Two-component, signed short expanded to (value, value, 0, 1).
Short4 | Four-component, signed short expanded to (value, value, value, value).
Byte4 | Four-component, unsigned byte.

Expand image Remarks

A mapping of each Direct3D 9 format name to the VertexElementFormat equivalent is listed in the following table.

 | Direct3D 9 Vertex Format | VertexElementFormat equivalent
Floating Point
Float32 | D3DDECLTYPE_FLOAT1 | Single
 | D3DDECLTYPE_FLOAT2 | Vector2
 | D3DDECLTYPE_FLOAT3 | Vector3
 | D3DDECLTYPE_FLOAT4 | Vector4
Float16 | D3DDECLTYPE_FLOAT16_2 | HalfVector2
 | D3DDECLTYPE_FLOAT16_4 | HalfVector4
Unsigned Normalized
64 bpp | D3DDECLTYPE_USHORT4N | Rgba64
32 bpp | D3DDECLTYPE_D3DCOLOR | Color
 | D3DDECLTYPE_UBYTE4N | Rgba32
 | D3DDECLTYPE_USHORT2N | Rg32
Signed Normalized
 | D3DDECLTYPE_SHORT2N | NormalizedShort2
 | D3DDECLTYPE_SHORT4N | NormalizedShort4
 | D3DDECLTYPE_DEC3N | Normalized101010
Signed Integer
 | D3DDECLTYPE_SHORT2 | Short2
 | D3DDECLTYPE_SHORT4 | Short4
Unsigned Integer
 | D3DDECLTYPE_UBYTE4 | Byte4
 | D3DDECLTYPE_UDEC3 | UInt101010

Expand image See Also

Reference

VertexElement.VertexElementFormat Property
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexElementUsage Enumeration

VertexElementUsage Enumeration

Defines usage for vertex elements.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public enum VertexElementUsage

Expand image Members

Member name | Description
Binormal | Vertex binormal data.
BlendIndices | Blending indices data. (BlendIndices with UsageIndex = 0) specifies matrix indices for fixed-function vertex processing using indexed paletted skinning.
BlendWeight | Blending weight data. (BlendWeight with UsageIndex = 0) specifies the blend weights in fixed-function vertex processing.
Color | Vertex data contains diffuse or specular color. (Color with UsageIndex = 0) specifies the diffuse color in the fixed-function vertex shader and in pixel shaders prior to ps_3_0. (Color with UsageIndex = 1) specifies the specular color in the fixed-function vertex shader and in pixel shaders prior to ps_3_0.
Depth | Vertex data contains depth data.
Fog | Vertex data contains fog data. (Fog with UsageIndex = 0) specifies a fog blend value to use after pixel shading is finished. This flag applies to pixel shaders prior to version ps_3_0.
Normal | Vertex normal data. (Normal with UsageIndex = 0) specifies vertex normals for fixed-function vertex processing and the N-patch tessellator. (Normal with UsageIndex = 1) specifies vertex normals for fixed-function vertex processing for skinning.
PointSize | Point size data. (PointSize with UsageIndex = 0) specifies the point-size attribute used by the setup engine of the rasterizer to expand a point into a quad for the point-sprite functionality.
Position | Position data. (Position with UsageIndex = 0 ) specifies the nontransformed position in fixed-function vertex processing and the N-patch tessellator. (Position with UsageIndex = 1) specifies the nontransformed position in the fixed-function vertex shader for skinning.
Sample | Vertex data contains sampler data. (Sample with UsageIndex = 0) specifies the displacement value to look up.
Tangent | Vertex tangent data.
TessellateFactor | Single, positive floating-point value. (TessellateFactor with UsageIndex = 0) specifies a tessellation factor used in the tessellation unit to control the rate of tessellation.
TextureCoordinate | Texture coordinate data. (TextureCoordinate, n) specifies texture coordinates in fixed-function vertex processing and in pixel shaders prior to ps_3_0. These coordinates can be used to pass user-defined data.

Expand image Remarks

Vertex data is declared with an array of VertexElement structures. Each element in the array contains a usage type.

Expand image See Also

Reference

Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor Structure

VertexPositionColor Structure

Describes a custom vertex format structure that contains position and color information.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SerializableAttribute]
public struct VertexPositionColor : IVertexType

Expand image See Also

Reference

VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor Members

VertexPositionColor Members
See Also Constructors Fields Methods Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the VertexPositionColor type.

Expand image Public Constructors

 | Name | Description
Public Method | VertexPositionColor | Initializes a new instance of the VertexPositionColor class.

Expand image Public Fields

 | Name | Description
Public Field | Color | The vertex color.
Public Field | Position | XYZ position.
 | VertexDeclaration | Vertex declaration, which defines per-vertex data.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration | Gets a vertex declaration.

Expand image See Also

Reference

VertexPositionColor Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionColor Fields

VertexPositionColor Fields

Expand image Public Fields

 | Name | Description
Public Field | Color | The vertex color.
Public Field | Position | XYZ position.
 | VertexDeclaration | Vertex declaration, which defines per-vertex data.

Expand image See Also

Reference

VertexPositionColor Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionColor.Color Field

VertexPositionColor.Color Field

The vertex color.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public Color Color

Expand image See Also

Reference

VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor.Position Field

VertexPositionColor.Position Field

XYZ position.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public Vector3 Position

Expand image See Also

Reference

VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor.VertexDeclaration Field

VertexPositionColor.VertexDeclaration Field

Vertex declaration, which defines per-vertex data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly VertexDeclaration VertexDeclaration

Expand image See Also

Reference

VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor Constructor

VertexPositionColor Constructor

Initializes a new instance of the VertexPositionColor class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexPositionColor (
         Vector3 position,
         Color color
)

Parameters

position
The position of the vertex.
color
The color of the vertex.

Expand image See Also

Reference

VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor Methods

VertexPositionColor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration | Gets a vertex declaration.

Expand image See Also

Reference

VertexPositionColor Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionColor.Equals Method

VertexPositionColor.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current VertexPositionColor.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor.GetHashCode Method

VertexPositionColor.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor.op_Equality Method

VertexPositionColor.op_Equality Method

Compares two objects to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool op_Equality (
         VertexPositionColor left,
         VertexPositionColor right
)

Parameters

left
Object to the left of the equality operator.
right
Object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor.op_Inequality Method

VertexPositionColor.op_Inequality Method

Compares two objects to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         VertexPositionColor left,
         VertexPositionColor right
)

Parameters

left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor.ToString Method

VertexPositionColor.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColor Properties

VertexPositionColor Properties

Expand image See Also

Reference

VertexPositionColor Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionColor.Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration Property

VertexPositionColor.Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration Property
See Also
CollapseAll image

Gets a vertex declaration.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private VertexDeclaration Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration { get; }

Property Value

A vertex declaration.

Expand image See Also

Reference

VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture Structure

VertexPositionColorTexture Structure

Describes a custom vertex format structure that contains position, color, and one set of texture coordinates.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SerializableAttribute]
public struct VertexPositionColorTexture : IVertexType

Expand image See Also

Reference

VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture Members

VertexPositionColorTexture Members
See Also Constructors Fields Methods Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the VertexPositionColorTexture type.

Expand image Public Constructors

 | Name | Description
Public Method | VertexPositionColorTexture | Initializes a new instance of the VertexPositionColorTexture class.

Expand image Public Fields

 | Name | Description
Public Field | Color | The vertex color.
Public Field | Position | XYZ position.
Public Field | TextureCoordinate | UV texture coordinates.
 | VertexDeclaration | Vertex declaration, which defines per-vertex data.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration | Gets a vertex declaration.

Expand image See Also

Reference

VertexPositionColorTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionColorTexture Fields

VertexPositionColorTexture Fields

Expand image Public Fields

 | Name | Description
Public Field | Color | The vertex color.
Public Field | Position | XYZ position.
Public Field | TextureCoordinate | UV texture coordinates.
 | VertexDeclaration | Vertex declaration, which defines per-vertex data.

Expand image See Also

Reference

VertexPositionColorTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionColorTexture.Color Field

VertexPositionColorTexture.Color Field

The vertex color.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public Color Color

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture.Position Field

VertexPositionColorTexture.Position Field

XYZ position.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public Vector3 Position

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture.TextureCoordinate Field

VertexPositionColorTexture.TextureCoordinate Field

UV texture coordinates.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public Vector2 TextureCoordinate

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture.VertexDeclaration Field

VertexPositionColorTexture.VertexDeclaration Field

Vertex declaration, which defines per-vertex data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly VertexDeclaration VertexDeclaration

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture Constructor

VertexPositionColorTexture Constructor

Initializes a new instance of the VertexPositionColorTexture class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexPositionColorTexture (
         Vector3 position,
         Color color,
         Vector2 textureCoordinate
)

Parameters

position
Position of the vertex.
color
Color of the vertex.
textureCoordinate
Texture coordinate of the vertex.

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture Methods

VertexPositionColorTexture Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration | Gets a vertex declaration.

Expand image See Also

Reference

VertexPositionColorTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionColorTexture.Equals Method

VertexPositionColorTexture.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current VertexPositionColorTexture.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture.GetHashCode Method

VertexPositionColorTexture.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture.op_Equality Method

VertexPositionColorTexture.op_Equality Method

Compares two objects to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool op_Equality (
         VertexPositionColorTexture left,
         VertexPositionColorTexture right
)

Parameters

left
Object to the left of the equality operator.
right
Object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture.op_Inequality Method

VertexPositionColorTexture.op_Inequality Method

Compares two objects to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         VertexPositionColorTexture left,
         VertexPositionColorTexture right
)

Parameters

left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture.ToString Method

VertexPositionColorTexture.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionColorTexture Properties

VertexPositionColorTexture Properties

Expand image See Also

Reference

VertexPositionColorTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionColorTexture.Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration Property

VertexPositionColorTexture.Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration Property
See Also
CollapseAll image

Gets a vertex declaration.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private VertexDeclaration Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration { get; }

Property Value

A vertex declaration.

Expand image See Also

Reference

VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture Structure

VertexPositionNormalTexture Structure

Describes a custom vertex format structure that contains position, normal data, and one set of texture coordinates.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SerializableAttribute]
public struct VertexPositionNormalTexture : IVertexType

Expand image See Also

Reference

VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture Members

VertexPositionNormalTexture Members
See Also Constructors Fields Methods Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the VertexPositionNormalTexture type.

Expand image Public Constructors

 | Name | Description
Public Method | VertexPositionNormalTexture | Initializes a new instance of the VertexPositionNormalTexture class.

Expand image Public Fields

 | Name | Description
Public Field | Normal | XYZ surface normal.
Public Field | Position | XYZ position.
Public Field | TextureCoordinate | UV texture coordinates.
 | VertexDeclaration | Vertex declaration, which defines per-vertex data.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration | Gets a vertex declaration.

Expand image See Also

Reference

VertexPositionNormalTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionNormalTexture Fields

VertexPositionNormalTexture Fields

Expand image Public Fields

 | Name | Description
Public Field | Normal | XYZ surface normal.
Public Field | Position | XYZ position.
Public Field | TextureCoordinate | UV texture coordinates.
 | VertexDeclaration | Vertex declaration, which defines per-vertex data.

Expand image See Also

Reference

VertexPositionNormalTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionNormalTexture.Normal Field

VertexPositionNormalTexture.Normal Field

XYZ surface normal.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public Vector3 Normal

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture.Position Field

VertexPositionNormalTexture.Position Field

XYZ position.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public Vector3 Position

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture.TextureCoordinate Field

VertexPositionNormalTexture.TextureCoordinate Field

UV texture coordinates.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public Vector2 TextureCoordinate

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture.VertexDeclaration Field

VertexPositionNormalTexture.VertexDeclaration Field

Vertex declaration, which defines per-vertex data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly VertexDeclaration VertexDeclaration

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture Constructor

VertexPositionNormalTexture Constructor

Initializes a new instance of the VertexPositionNormalTexture class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexPositionNormalTexture (
         Vector3 position,
         Vector3 normal,
         Vector2 textureCoordinate
)

Parameters

position
Position of the vertex.
normal
The vertex normal.
textureCoordinate
The texture coordinate.

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture Methods

VertexPositionNormalTexture Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration | Gets a vertex declaration.

Expand image See Also

Reference

VertexPositionNormalTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionNormalTexture.Equals Method

VertexPositionNormalTexture.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current VertexPositionNormalTexture.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture.GetHashCode Method

VertexPositionNormalTexture.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture.op_Equality Method

VertexPositionNormalTexture.op_Equality Method

Compares two objects to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool op_Equality (
         VertexPositionNormalTexture left,
         VertexPositionNormalTexture right
)

Parameters

left
Object to the left of the equality operator.
right
Object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture.op_Inequality Method

VertexPositionNormalTexture.op_Inequality Method

Compares two objects to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         VertexPositionNormalTexture left,
         VertexPositionNormalTexture right
)

Parameters

left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture.ToString Method

VertexPositionNormalTexture.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionNormalTexture Properties

VertexPositionNormalTexture Properties

Expand image See Also

Reference

VertexPositionNormalTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionNormalTexture.Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration Property

VertexPositionNormalTexture.Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration Property
See Also
CollapseAll image

Gets a vertex declaration.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private VertexDeclaration Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration { get; }

Property Value

A vertex declaration.

Expand image See Also

Reference

VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture Structure

VertexPositionTexture Structure

Describes a custom vertex format structure that contains position and one set of texture coordinates.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SerializableAttribute]
public struct VertexPositionTexture : IVertexType

Expand image See Also

Reference

VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture Members

VertexPositionTexture Members
See Also Constructors Fields Methods Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the VertexPositionTexture type.

Expand image Public Constructors

 | Name | Description
Public Method | VertexPositionTexture | Initializes a new instance of the VertexPositionTexture class.

Expand image Public Fields

 | Name | Description
Public Field | Position | XYZ position.
Public Field | TextureCoordinate | UV texture coordinates.
 | VertexDeclaration | Vertex declaration, which defines per-vertex data.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration | Gets a vertex declaration.

Expand image See Also

Reference

VertexPositionTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionTexture Fields

VertexPositionTexture Fields

Expand image Public Fields

 | Name | Description
Public Field | Position | XYZ position.
Public Field | TextureCoordinate | UV texture coordinates.
 | VertexDeclaration | Vertex declaration, which defines per-vertex data.

Expand image See Also

Reference

VertexPositionTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionTexture.Position Field

VertexPositionTexture.Position Field

XYZ position.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public Vector3 Position

Expand image See Also

Reference

VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture.TextureCoordinate Field

VertexPositionTexture.TextureCoordinate Field

UV texture coordinates.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SuppressMessageAttribute("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public Vector2 TextureCoordinate

Expand image See Also

Reference

VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture.VertexDeclaration Field

VertexPositionTexture.VertexDeclaration Field

Vertex declaration, which defines per-vertex data.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static readonly VertexDeclaration VertexDeclaration

Expand image See Also

Reference

VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture Constructor

VertexPositionTexture Constructor

Initializes a new instance of the VertexPositionTexture class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public VertexPositionTexture (
         Vector3 position,
         Vector2 textureCoordinate
)

Parameters

position
Position of the vertex.
textureCoordinate
Texture coordinate of the vertex.

Expand image See Also

Reference

VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture Methods

VertexPositionTexture Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration | Gets a vertex declaration.

Expand image See Also

Reference

VertexPositionTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionTexture.Equals Method

VertexPositionTexture.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the current VertexPositionTexture.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture.GetHashCode Method

VertexPositionTexture.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture.op_Equality Method

VertexPositionTexture.op_Equality Method

Compares two objects to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool op_Equality (
         VertexPositionTexture left,
         VertexPositionTexture right
)

Parameters

left
Object to the left of the equality operator.
right
Object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture.op_Inequality Method

VertexPositionTexture.op_Inequality Method

Compares two objects to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         VertexPositionTexture left,
         VertexPositionTexture right
)

Parameters

left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture.ToString Method

VertexPositionTexture.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VertexPositionTexture Properties

VertexPositionTexture Properties

Expand image See Also

Reference

VertexPositionTexture Structure
Microsoft.Xna.Framework.Graphics Namespace


VertexPositionTexture.Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration Property

VertexPositionTexture.Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration Property
See Also
CollapseAll image

Gets a vertex declaration.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
private VertexDeclaration Microsoft.Xna.Framework.Graphics.IVertexType.VertexDeclaration { get; }

Property Value

A vertex declaration.

Expand image See Also

Reference

VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport Structure

Viewport Structure

Defines the window dimensions of a render-target surface onto which a 3D volume projects.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
[SerializableAttribute]
public struct Viewport

Expand image See Also

Reference

Viewport
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport Members

Viewport Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the Viewport type.

Expand image Public Constructors

 | Name | Description
Public Method | Viewport | Overloaded. Creates an instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | AspectRatio | Gets the aspect ratio used by the viewport
Public Property | Bounds | Gets the size of this resource.
Public Property | Height | Gets or sets the height dimension of the viewport on the render-target surface, in pixels.
Public Property | MaxDepth | Gets or sets the maximum depth of the clip volume.
Public Property | MinDepth | Gets or sets the minimum depth of the clip volume.
Public Property | TitleSafeArea | Returns the title safe area of the current viewport.
Public Property | Width | Gets or sets the width dimension of the viewport on the render-target surface, in pixels.
Public Property | X | Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.
Public Property | Y | Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | Project | Projects a 3D vector from object space into screen space.
Public Method | ToString | Retrieves a string representation of this object.
Public Method | Unproject | Converts a screen space point into a corresponding point in world space.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Viewport Structure
Microsoft.Xna.Framework.Graphics Namespace


Viewport Constructor

Viewport Constructor

Creates an instance of this class.

Expand image Overload List

Name | Description
Viewport (Int32, Int32, Int32, Int32) | Creates an instance of this object.
Viewport (Rectangle) | Creates an instance of this object.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace


Viewport Constructor (Int32, Int32, Int32, Int32)

Viewport Constructor (Int32, Int32, Int32, Int32)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Viewport (
         int x,
         int y,
         int width,
         int height
)

Parameters

x
The x coordinate of the upper-left corner of the viewport in pixels.
y
The y coordinate of the upper-left corner of the viewport in pixels.
width
The width of the viewport in pixels.
height
The height of the viewport in pixels.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport Constructor (Rectangle)

Viewport Constructor (Rectangle)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Viewport (
         Rectangle bounds
)

Parameters

bounds
A bounding box that defines the location and size of the viewport in a render target.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport Methods

Viewport Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | Project | Projects a 3D vector from object space into screen space.
Public Method | ToString | Retrieves a string representation of this object.
Public Method | Unproject | Converts a screen space point into a corresponding point in world space.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Viewport Structure
Microsoft.Xna.Framework.Graphics Namespace


Viewport.Project Method

Viewport.Project Method

Projects a 3D vector from object space into screen space.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 Project (
         Vector3 source,
         Matrix projection,
         Matrix view,
         Matrix world
)

Parameters

source
The vector to project.
projection
The projection matrix.
view
The view matrix.
world
The world matrix.

Return Value

The vector in screen space.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport.ToString Method

Viewport.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport.Unproject Method

Viewport.Unproject Method

Converts a screen space point into a corresponding point in world space.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Vector3 Unproject (
         Vector3 source,
         Matrix projection,
         Matrix view,
         Matrix world
)

Parameters

source
The vector to project.
projection
The projection matrix.
view
The view matrix.
world
The world matrix.

Return Value

The vector in object space.

Expand image Remarks

A common use for Unproject is determining if the current cursor location intersects with an object in 3D world space. First, calculate two Vector3 values that differ only by their Z value. For instance, assume that the cursor location is currently (100, 100). Therefore, the first vector (located at the near clip plane) becomes (100, 100, 0) and the second (located at the far clip plane) becomes (100, 100, 1).

Call Unproject for each point, and store the result. For example, minPointSource stores the result of "unprojecting" (100,100,0), and maxPointSource stores the result of "unprojecting" (100, 100, 1). Determine the direction vector by subtracting maxPointSource from minPointSource.

Finally, normalize the direction vector, and create a Ray with minPointSource and the now-normalized direction vector. You can now use this ray in a simple intersect test case (for example, Intersects) with the model.

For more usage examples of Unproject, see the following:

  • Picking sample (found at http://creators.xna.com)
  • Picking with Triangle Accuracy sample (also found at http://creators.xna.com)

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport Properties

Viewport Properties

Expand image Public Properties

 | Name | Description
Public Property | AspectRatio | Gets the aspect ratio used by the viewport
Public Property | Bounds | Gets the size of this resource.
Public Property | Height | Gets or sets the height dimension of the viewport on the render-target surface, in pixels.
Public Property | MaxDepth | Gets or sets the maximum depth of the clip volume.
Public Property | MinDepth | Gets or sets the minimum depth of the clip volume.
Public Property | TitleSafeArea | Returns the title safe area of the current viewport.
Public Property | Width | Gets or sets the width dimension of the viewport on the render-target surface, in pixels.
Public Property | X | Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.
Public Property | Y | Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.

Expand image See Also

Reference

Viewport Structure
Microsoft.Xna.Framework.Graphics Namespace


Viewport.AspectRatio Property

Viewport.AspectRatio Property

Gets the aspect ratio used by the viewport

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float AspectRatio { get; }

Property Value

The aspect ratio of the viewport.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport.Bounds Property

Viewport.Bounds Property

Gets the size of this resource.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Rectangle Bounds { get; set; }

Property Value

A bounding-box rectangle.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport.Height Property

Viewport.Height Property

Gets or sets the height dimension of the viewport on the render-target surface, in pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Height { get; set; }

Property Value

The height, in pixels, of the viewport to set or get.

Expand image Remarks

Unless rendering is being done only to a subset of the surface, this member should be set to the height dimension of the render target surface.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport.MaxDepth Property

Viewport.MaxDepth Property

Gets or sets the maximum depth of the clip volume.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float MaxDepth { get; set; }

Property Value

The maximum depth of the clipping volume.

Expand image Remarks

MaxDepth, together with MinDepth, specifies the range of depth values into which a scene is rendered. Most applications set this value to 1.0. Clipping is performed after the projection matrix is applied.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport.MinDepth Property

Viewport.MinDepth Property

Gets or sets the minimum depth of the clip volume.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public float MinDepth { get; set; }

Property Value

The minimum depth of the clipping volume.

Expand image Remarks

MinDepth, together with MaxDepth, specifies the range of depth values into which a scene is rendered. Most applications set this value to 0.0. Clipping is performed after the projection matrix is applied.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport.TitleSafeArea Property

Viewport.TitleSafeArea Property

Returns the title safe area of the current viewport.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public Rectangle TitleSafeArea { get; }

Property Value

The title safe area.

Expand image Remarks

On television sets, text should not be displayed at the outer edges of the screen because it may not be visible to the user. The title safe area is the part of the screen where text should be displayed.

This property does not compare the current location of the viewport with the title safe area of the entire display—it reduces the title safe area of the viewport uniformly.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport.Width Property

Viewport.Width Property

Gets or sets the width dimension of the viewport on the render-target surface, in pixels.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Width { get; set; }

Property Value

The width, in pixels, of the viewport to set or get.

Expand image Remarks

Unless rendering is being done only to a subset of the surface, this member should be set to the width dimension of the render-target surface.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport.X Property

Viewport.X Property

Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int X { get; set; }

Property Value

The upper-left corner of the viewport to set or get.

Expand image Remarks

Unless rendering is being done only to a subset of the surface, this member can be set to 0.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Viewport.Y Property

Viewport.Y Property

Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Expand image Syntax

C#
public int Y { get; set; }

Property Value

The upper-left corner of the viewport to set or get.

Expand image Remarks

Unless rendering is being done only to a subset of the surface, this member can be set to 0.

Expand image See Also

Reference

Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Represents data types with components that are not multiples of 8 bits.

Expand image Interfaces

 | Name | Description
Public Interface | IPackedVector | Converts packed vector types to and from Vector4 values.
Public Interface | IPackedVector | Interface that converts packed vector types to and from Vector4 values, allowing multiple encodings to be manipulated in a generic way.

Expand image Structures

 | Name | Description
Public Structure | Alpha8 | Packed vector type containing a single 8 bit normalized W value in the range of 0 to 1.
Public Structure | Bgr565 | Packed vector type containing unsigned normalized values ranging from 0 to 1. The x and z components use 5 bits, and the y component uses 6 bits.
Public Structure | Bgra4444 | Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 4 bits each for x, y, z, and w.
Public Structure | Bgra5551 | Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 5 bits each for x, y, and z, and 1 bit for w.
Public Structure | Byte4 | Packed vector type containing four 8-bit unsigned integer values, ranging from 0 to 255.
Public Structure | HalfSingle | Packed vector type containing a single 16 bit floating point value.
Public Structure | HalfVector2 | Packed vector type containing two 16-bit floating-point values.
Public Structure | HalfVector4 | Packed vector type containing four 16-bit floating-point values.
Public Structure | NormalizedByte2 | Packed vector type containing two 8-bit signed normalized values, ranging from −1 to 1.
Public Structure | NormalizedByte4 | Packed vector type containing four 8-bit signed normalized values, ranging from −1 to 1.
Public Structure | NormalizedShort2 | Packed vector type containing two 16-bit signed normalized values, ranging from −1 to 1.
Public Structure | NormalizedShort4 | Packed vector type containing four 16-bit signed normalized values, ranging from −1 to 1.
Public Structure | Rg32 | Packed vector type containing two 16-bit unsigned normalized values, ranging from 0 to 1.
Public Structure | Rgba1010102 | Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 10 bits each for x, y, and z, and 2 bits for w.
Public Structure | Rgba64 | Packed vector type containing four 16-bit unsigned normalized values, ranging from 0 to 1.
Public Structure | Short2 | Packed vector type containing two 16-bit signed integer values.
Public Structure | Short4 | Packed vector type containing four 16-bit signed integer values.


Alpha8 Structure

Alpha8 Structure

Packed vector type containing a single 8 bit normalized W value in the range of 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct Alpha8 : IPackedVector<byte>, IEquatable<Alpha8>, IPackedVector

Expand image See Also

Reference

Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Alpha8 Members

Alpha8 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Alpha8 type.

Expand image Public Constructors

 | Name | Description
Public Method | Alpha8 | Initializes a new instance of the Alpha8 structure.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToAlpha | Expands the packed representation to a System.Single.
Public Method | ToString | Returns a string representation of the current instance.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

Alpha8 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Alpha8 Constructor

Alpha8 Constructor

Initializes a new instance of the Alpha8 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Alpha8 (
         float alpha
)

Parameters

alpha
The initial value for the Alpha8 structure.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Alpha8 Methods

Alpha8 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToAlpha | Expands the packed representation to a System.Single.
Public Method | ToString | Returns a string representation of the current instance.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

Alpha8 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Alpha8.Equals Method

Alpha8.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Alpha8.Equals (Alpha8) | Returns a value that indicates whether the current instance is equal to a specified object.
Alpha8.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Alpha8.Equals Method (Alpha8)

Alpha8.Equals Method (Alpha8)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Alpha8 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Alpha8.Equals Method (Object)

Alpha8.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Alpha8.GetHashCode Method

Alpha8.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representaion from.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method
See Also
CollapseAll image

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Alpha8.op_Equality Method

Alpha8.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Alpha8 a,
         Alpha8 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Alpha8.op_Inequality Method

Alpha8.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Alpha8 a,
         Alpha8 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Alpha8.ToAlpha Method

Alpha8.ToAlpha Method

Expands the packed representation to a System.Single.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float ToAlpha ()

Return Value

The expanded Alpha8.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Alpha8.ToString Method

Alpha8.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Alpha8 Properties

Alpha8 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

Alpha8 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Alpha8.PackedValue Property

Alpha8.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public byte PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565 Structure

Bgr565 Structure

Packed vector type containing unsigned normalized values ranging from 0 to 1. The x and z components use 5 bits, and the y component uses 6 bits.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct Bgr565 : IPackedVector<UInt16>, IEquatable<Bgr565>, IPackedVector

Expand image See Also

Reference

Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565 Members

Bgr565 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Bgr565 type.

Expand image Public Constructors

 | Name | Description
Public Method | Bgr565 | Overloaded. Initializes a new instance of the Bgr565 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector3 | Expands the packed representation into a Vector3.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

Bgr565 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgr565 Constructor

Bgr565 Constructor

Initializes a new instance of the Bgr565 class.

Expand image Overload List

Name | Description
Bgr565 (Single, Single, Single) | Initializes a new instance of the Bgr565 class.
Bgr565 (Vector3) | Initializes a new instance of the Bgr565 structure.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgr565 Constructor (Single, Single, Single)

Bgr565 Constructor (Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of the Bgr565 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Bgr565 (
         float x,
         float y,
         float z
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565 Constructor (Vector3)

Bgr565 Constructor (Vector3)
See Also
CollapseAll image

Initializes a new instance of the Bgr565 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Bgr565 (
         Vector3 vector
)

Parameters

vector
A vector containing the initial values for the components of the Bgr565 structure.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565 Methods

Bgr565 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector3 | Expands the packed representation into a Vector3.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

Bgr565 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgr565.Equals Method

Bgr565.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Bgr565.Equals (Bgr565) | Returns a value that indicates whether the current instance is equal to a specified object.
Bgr565.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgr565.Equals Method (Bgr565)

Bgr565.Equals Method (Bgr565)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Bgr565 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565.Equals Method (Object)

Bgr565.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565.GetHashCode Method

Bgr565.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method
See Also
CollapseAll image

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565.op_Equality Method

Bgr565.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Bgr565 a,
         Bgr565 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565.op_Inequality Method

Bgr565.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Bgr565 a,
         Bgr565 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565.ToString Method

Bgr565.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565.ToVector3 Method

Bgr565.ToVector3 Method

Expands the packed representation into a Vector3.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector3 ToVector3 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgr565 Properties

Bgr565 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

Bgr565 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgr565.PackedValue Property

Bgr565.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public UInt16 PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444 Structure

Bgra4444 Structure

Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 4 bits each for x, y, z, and w.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct Bgra4444 : IPackedVector<UInt16>, IPackedVector, IEquatable<Bgra4444>

Expand image See Also

Reference

Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444 Members

Bgra4444 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Bgra4444 type.

Expand image Public Constructors

 | Name | Description
Public Method | Bgra4444 | Overloaded. Creates an instance of this object.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Gets or sets the packed representation of the vector.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Tests for equality.
Public Method | GetHashCode | Gets the hash code for this object.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Equality operator, which compares two objects to see if they are equal.
 | op_Inequality | Tests two objects to see if they are not equal.
Public Method | ToString | Returns a string representation.
Public Method | ToVector4 | Unpacks this object to a four-component vector.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Converts a four-component vector into the format for this object.

Expand image See Also

Reference

Bgra4444 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgra4444 Constructor

Bgra4444 Constructor

Creates an instance of this object.

Expand image Overload List

Name | Description
Bgra4444 (Single, Single, Single, Single) | Creates an instance of this object.
Bgra4444 (Vector4) | Creates an instance of this object.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgra4444 Constructor (Single, Single, Single, Single)

Bgra4444 Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Bgra4444 (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444 Constructor (Vector4)

Bgra4444 Constructor (Vector4)
See Also
CollapseAll image

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Bgra4444 (
         Vector4 vector
)

Parameters

vector
Input value for all four components (xyzw).

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444 Methods

Bgra4444 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Tests for equality.
Public Method | GetHashCode | Gets the hash code for this object.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Equality operator, which compares two objects to see if they are equal.
 | op_Inequality | Tests two objects to see if they are not equal.
Public Method | ToString | Returns a string representation.
Public Method | ToVector4 | Unpacks this object to a four-component vector.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Converts a four-component vector into the format for this object.

Expand image See Also

Reference

Bgra4444 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgra4444.Equals Method

Bgra4444.Equals Method

Tests for equality.

Expand image Overload List

Name | Description
Bgra4444.Equals (Bgra4444) | Tests an object to see if it is equal to this object.
Bgra4444.Equals (Object) | Tests an object to see if it is equal to this object.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgra4444.Equals Method (Bgra4444)

Bgra4444.Equals Method (Bgra4444)
See Also
CollapseAll image

Tests an object to see if it is equal to this object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Bgra4444 other
)

Parameters

other
The object to test.

Return Value

True if they are equal, false otherwise.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444.Equals Method (Object)

Bgra4444.Equals Method (Object)
See Also
CollapseAll image

Tests an object to see if it is equal to this object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object to test.

Return Value

True if they are equal; otherwise false.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444.GetHashCode Method

Bgra4444.GetHashCode Method

Gets the hash code for this object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

The hash code.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Converts a four-component vector into the format for this object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The four-component vector.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444.op_Equality Method

Bgra4444.op_Equality Method

Equality operator, which compares two objects to see if they are equal.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Bgra4444 a,
         Bgra4444 b
)

Parameters

a
The first object.
b
The second object.

Return Value

True if the objects are equal; otherwise false.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444.op_Inequality Method

Bgra4444.op_Inequality Method

Tests two objects to see if they are not equal.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Bgra4444 a,
         Bgra4444 b
)

Parameters

a
The first object.
b
The second object.

Return Value

True if the objects are not equal, false otherwise.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444.ToString Method

Bgra4444.ToString Method

Returns a string representation.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

The string that represents the object.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444.ToVector4 Method

Bgra4444.ToVector4 Method

Unpacks this object to a four-component vector.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

A four-component vector.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra4444 Properties

Bgra4444 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Gets or sets the packed representation of the vector.

Expand image See Also

Reference

Bgra4444 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgra4444.PackedValue Property

Bgra4444.PackedValue Property

Gets or sets the packed representation of the vector.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public UInt16 PackedValue { get; set; }

Property Value

The packed vector.

Expand image See Also

Reference

Bgra4444 Structure
Bgra4444 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551 Structure

Bgra5551 Structure

Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 5 bits each for x, y, and z, and 1 bit for w.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct Bgra5551 : IPackedVector<UInt16>, IEquatable<Bgra5551>, IPackedVector

Expand image See Also

Reference

Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551 Members

Bgra5551 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Bgra5551 type.

Expand image Public Constructors

 | Name | Description
Public Method | Bgra5551 | Overloaded. Initializes a new instance of the Bgra5551 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

Bgra5551 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgra5551 Constructor

Bgra5551 Constructor

Initializes a new instance of the Bgra5551 class.

Expand image Overload List

Name | Description
Bgra5551 (Single, Single, Single, Single) | Initializes a new instance of the Bgra5551 class.
Bgra5551 (Vector4) | Initializes a new instance of the Bgra5551 structure.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgra5551 Constructor (Single, Single, Single, Single)

Bgra5551 Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of the Bgra5551 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Bgra5551 (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551 Constructor (Vector4)

Bgra5551 Constructor (Vector4)
See Also
CollapseAll image

Initializes a new instance of the Bgra5551 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Bgra5551 (
         Vector4 vector
)

Parameters

vector
A vector containing the initial values for the components of the Bgra5551 structure.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551 Methods

Bgra5551 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

Bgra5551 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgra5551.Equals Method

Bgra5551.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Bgra5551.Equals (Bgra5551) | Returns a value that indicates whether the current instance is equal to a specified object.
Bgra5551.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgra5551.Equals Method (Bgra5551)

Bgra5551.Equals Method (Bgra5551)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Bgra5551 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551.Equals Method (Object)

Bgra5551.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551.GetHashCode Method

Bgra5551.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551.op_Equality Method

Bgra5551.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Bgra5551 a,
         Bgra5551 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551.op_Inequality Method

Bgra5551.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Bgra5551 a,
         Bgra5551 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551.ToString Method

Bgra5551.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551.ToVector4 Method

Bgra5551.ToVector4 Method

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Bgra5551 Properties

Bgra5551 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

Bgra5551 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Bgra5551.PackedValue Property

Bgra5551.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public UInt16 PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4 Structure

Byte4 Structure

Packed vector type containing four 8-bit unsigned integer values, ranging from 0 to 255.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct Byte4 : IPackedVector<uint>, IEquatable<Byte4>, IPackedVector

Expand image See Also

Reference

Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4 Members

Byte4 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Byte4 type.

Expand image Public Constructors

 | Name | Description
Public Method | Byte4 | Overloaded. Initializes a new instance of the Byte4 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4

Expand image See Also

Reference

Byte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Byte4 Constructor

Byte4 Constructor

Initializes a new instance of the Byte4 class.

Expand image Overload List

Name | Description
Byte4 (Single, Single, Single, Single) | Initializes a new instance of the Byte4 class.
Byte4 (Vector4) | Initializes a new instance of the Byte4 structure.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Byte4 Constructor (Single, Single, Single, Single)

Byte4 Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of the Byte4 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Byte4 (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4 Constructor (Vector4)

Byte4 Constructor (Vector4)
See Also
CollapseAll image

Initializes a new instance of the Byte4 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Byte4 (
         Vector4 vector
)

Parameters

vector
A vector containing the initial values for the components of the Byte4 structure.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4 Methods

Byte4 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4

Expand image See Also

Reference

Byte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Byte4.Equals Method

Byte4.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Byte4.Equals (Byte4) | Returns a value that indicates whether the current instance is equal to a specified object.
Byte4.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Byte4.Equals Method (Byte4)

Byte4.Equals Method (Byte4)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Byte4 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4.Equals Method (Object)

Byte4.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4.GetHashCode Method

Byte4.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create packed representation from.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4.op_Equality Method

Byte4.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Byte4 a,
         Byte4 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4.op_Inequality Method

Byte4.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Byte4 a,
         Byte4 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4.ToString Method

Byte4.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4.ToVector4 Method

Byte4.ToVector4 Method

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Byte4 Properties

Byte4 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

Byte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Byte4.PackedValue Property

Byte4.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public uint PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfSingle Structure

HalfSingle Structure

Packed vector type containing a single 16 bit floating point value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct HalfSingle : IPackedVector<UInt16>, IEquatable<HalfSingle>, IPackedVector

Expand image See Also

Reference

HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfSingle Members

HalfSingle Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the HalfSingle type.

Expand image Public Constructors

 | Name | Description
Public Method | HalfSingle | Initializes a new instance of the HalfSingle structure.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToSingle | Expands the HalfSingle to a Single.
Public Method | ToString | Returns a string representation of the current instance.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

HalfSingle Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfSingle Constructor

HalfSingle Constructor

Initializes a new instance of the HalfSingle structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public HalfSingle (
         float value
)

Parameters

value
The initial value of the HalfSingle structure.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfSingle Methods

HalfSingle Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToSingle | Expands the HalfSingle to a Single.
Public Method | ToString | Returns a string representation of the current instance.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

HalfSingle Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfSingle.Equals Method

HalfSingle.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
HalfSingle.Equals (HalfSingle) | Returns a value that indicates whether the current instance is equal to a specified object.
HalfSingle.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfSingle.Equals Method (HalfSingle)

HalfSingle.Equals Method (HalfSingle)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         HalfSingle other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfSingle.Equals Method (Object)

HalfSingle.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfSingle.GetHashCode Method

HalfSingle.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method
See Also
CollapseAll image

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfSingle.op_Equality Method

HalfSingle.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         HalfSingle a,
         HalfSingle b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfSingle.op_Inequality Method

HalfSingle.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         HalfSingle a,
         HalfSingle b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfSingle.ToSingle Method

HalfSingle.ToSingle Method

Expands the HalfSingle to a Single.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float ToSingle ()

Return Value

The expanded HalfSingle.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfSingle.ToString Method

HalfSingle.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfSingle Properties

HalfSingle Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

HalfSingle Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfSingle.PackedValue Property

HalfSingle.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public UInt16 PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2 Structure

HalfVector2 Structure

Packed vector type containing two 16-bit floating-point values.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct HalfVector2 : IPackedVector<uint>, IEquatable<HalfVector2>, IPackedVector

Expand image See Also

Reference

HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2 Members

HalfVector2 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the HalfVector2 type.

Expand image Public Constructors

 | Name | Description
Public Method | HalfVector2 | Overloaded. Initializes a new instance of the HalfVector2 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector2 | Expands the HalfVector2 to a Vector2.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

HalfVector2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfVector2 Constructor

HalfVector2 Constructor

Initializes a new instance of the HalfVector2 class.

Expand image Overload List

Name | Description
HalfVector2 (Single, Single) | Initializes a new instance of the HalfVector2 structure.
HalfVector2 (Vector2) | Initializes a new instance of the HalfVector2 structure.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfVector2 Constructor (Single, Single)

HalfVector2 Constructor (Single, Single)
See Also
CollapseAll image

Initializes a new instance of the HalfVector2 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public HalfVector2 (
         float x,
         float y
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2 Constructor (Vector2)

HalfVector2 Constructor (Vector2)
See Also
CollapseAll image

Initializes a new instance of the HalfVector2 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public HalfVector2 (
         Vector2 vector
)

Parameters

vector
A vector containing the initial values for the components of the HalfVector2 structure.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2 Methods

HalfVector2 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector2 | Expands the HalfVector2 to a Vector2.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

HalfVector2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfVector2.Equals Method

HalfVector2.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
HalfVector2.Equals (HalfVector2) | Returns a value that indicates whether the current instance is equal to a specified object.
HalfVector2.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfVector2.Equals Method (HalfVector2)

HalfVector2.Equals Method (HalfVector2)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         HalfVector2 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2.Equals Method (Object)

HalfVector2.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2.GetHashCode Method

HalfVector2.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method
See Also
CollapseAll image

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2.op_Equality Method

HalfVector2.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         HalfVector2 a,
         HalfVector2 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2.op_Inequality Method

HalfVector2.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         HalfVector2 a,
         HalfVector2 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2.ToString Method

HalfVector2.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2.ToVector2 Method

HalfVector2.ToVector2 Method

Expands the HalfVector2 to a Vector2.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 ToVector2 ()

Return Value

The expanded HalfVector2.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector2 Properties

HalfVector2 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

HalfVector2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfVector2.PackedValue Property

HalfVector2.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public uint PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4 Structure

HalfVector4 Structure

Packed vector type containing four 16-bit floating-point values.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct HalfVector4 : IPackedVector<ulong>, IEquatable<HalfVector4>, IPackedVector

Expand image See Also

Reference

HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4 Members

HalfVector4 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the HalfVector4 type.

Expand image Public Constructors

 | Name | Description
Public Method | HalfVector4 | Overloaded. Initializes a new instance of the HalfVector4 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

HalfVector4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfVector4 Constructor

HalfVector4 Constructor

Initializes a new instance of the HalfVector4 class.

Expand image Overload List

Name | Description
HalfVector4 (Single, Single, Single, Single) | Initializes a new instance of the HalfVector4 class.
HalfVector4 (Vector4) | Initializes a new instance of the HalfVector4 structure.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfVector4 Constructor (Single, Single, Single, Single)

HalfVector4 Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of the HalfVector4 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public HalfVector4 (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4 Constructor (Vector4)

HalfVector4 Constructor (Vector4)
See Also
CollapseAll image

Initializes a new instance of the HalfVector4 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public HalfVector4 (
         Vector4 vector
)

Parameters

vector
A vector containing the initial values for the components of the HalfVector4 structure.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4 Methods

HalfVector4 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

HalfVector4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfVector4.Equals Method

HalfVector4.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
HalfVector4.Equals (HalfVector4) | Returns a value that indicates whether the current instance is equal to a specified object.
HalfVector4.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfVector4.Equals Method (HalfVector4)

HalfVector4.Equals Method (HalfVector4)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         HalfVector4 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4.Equals Method (Object)

HalfVector4.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4.GetHashCode Method

HalfVector4.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4.op_Equality Method

HalfVector4.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         HalfVector4 a,
         HalfVector4 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4.op_Inequality Method

HalfVector4.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         HalfVector4 a,
         HalfVector4 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4.ToString Method

HalfVector4.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4.ToVector4 Method

HalfVector4.ToVector4 Method

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


HalfVector4 Properties

HalfVector4 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

HalfVector4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


HalfVector4.PackedValue Property

HalfVector4.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public ulong PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IPackedVector Generic Interface

IPackedVector Generic Interface

Converts packed vector types to and from Vector4 values.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public interface IPackedVector<TPacked> : IPackedVector

Expand image See Also

Reference

IPackedVector Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IPackedVector Members

IPackedVector Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the IPackedVector type.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | PackFromVector4 | (Inherited from IPackedVector.)
Public Method | ToVector4 | (Inherited from IPackedVector.)

Expand image See Also

Reference

IPackedVector Generic Interface
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


IPackedVector Properties

IPackedVector Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

IPackedVector Generic Interface
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


IPackedVector.PackedValue Property

IPackedVector.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TPacked PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

IPackedVector Generic Interface
IPackedVector Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IPackedVector Interface

IPackedVector Interface

Interface that converts packed vector types to and from Vector4 values, allowing multiple encodings to be manipulated in a generic way.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public interface IPackedVector
C#

Expand image See Also

Reference

IPackedVector Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IPackedVector Members

IPackedVector Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the IPackedVector type.

Expand image Public Methods

 | Name | Description
Public Method | PackFromVector4 | Sets the packed representation from a Vector4.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

IPackedVector Interface
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


IPackedVector Methods

IPackedVector Methods

Expand image Public Methods

 | Name | Description
Public Method | PackFromVector4 | Sets the packed representation from a Vector4.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

IPackedVector Interface
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


IPackedVector.PackFromVector4 Method

IPackedVector.PackFromVector4 Method

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

IPackedVector Interface
IPackedVector Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


IPackedVector.ToVector4 Method

IPackedVector.ToVector4 Method

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

IPackedVector Interface
IPackedVector Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2 Structure

NormalizedByte2 Structure

Packed vector type containing two 8-bit signed normalized values, ranging from −1 to 1.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct NormalizedByte2 : IPackedVector<UInt16>, IEquatable<NormalizedByte2>, IPackedVector

Expand image See Also

Reference

NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2 Members

NormalizedByte2 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the NormalizedByte2 type.

Expand image Public Constructors

 | Name | Description
Public Method | NormalizedByte2 | Overloaded. Initializes a new instance of the NormalizedByte2 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector2 | Expands the packed representation to a vector.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

NormalizedByte2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedByte2 Constructor

NormalizedByte2 Constructor

Initializes a new instance of the NormalizedByte2 class.

Expand image Overload List

Name | Description
NormalizedByte2 (Single, Single) | Initializes a new instance of the NormalizedByte2 class.
NormalizedByte2 (Vector2) | Initializes a new instance of the NormalizedByte2 structure.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedByte2 Constructor (Single, Single)

NormalizedByte2 Constructor (Single, Single)
See Also
CollapseAll image

Initializes a new instance of the NormalizedByte2 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NormalizedByte2 (
         float x,
         float y
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2 Constructor (Vector2)

NormalizedByte2 Constructor (Vector2)
See Also
CollapseAll image

Initializes a new instance of the NormalizedByte2 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NormalizedByte2 (
         Vector2 vector
)

Parameters

vector
A vector containing the initial values for the components of the NormalizedByte2 structure.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2 Methods

NormalizedByte2 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector2 | Expands the packed representation to a vector.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

NormalizedByte2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedByte2.Equals Method

NormalizedByte2.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
NormalizedByte2.Equals (NormalizedByte2) | Returns a value that indicates whether the current instance is equal to a specified object.
NormalizedByte2.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedByte2.Equals Method (NormalizedByte2)

NormalizedByte2.Equals Method (NormalizedByte2)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         NormalizedByte2 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2.Equals Method (Object)

NormalizedByte2.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2.GetHashCode Method

NormalizedByte2.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method
See Also
CollapseAll image

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2.op_Equality Method

NormalizedByte2.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         NormalizedByte2 a,
         NormalizedByte2 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2.op_Inequality Method

NormalizedByte2.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         NormalizedByte2 a,
         NormalizedByte2 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2.ToString Method

NormalizedByte2.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2.ToVector2 Method

NormalizedByte2.ToVector2 Method

Expands the packed representation to a vector.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 ToVector2 ()

Return Value

The expanded NormalizedByte2.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte2 Properties

NormalizedByte2 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

NormalizedByte2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedByte2.PackedValue Property

NormalizedByte2.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public UInt16 PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4 Structure

NormalizedByte4 Structure

Packed vector type containing four 8-bit signed normalized values, ranging from −1 to 1.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct NormalizedByte4 : IPackedVector<uint>, IEquatable<NormalizedByte4>, IPackedVector

Expand image See Also

Reference

NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4 Members

NormalizedByte4 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the NormalizedByte4 type.

Expand image Public Constructors

 | Name | Description
Public Method | NormalizedByte4 | Overloaded. Initializes a new instance of the NormalizedByte4 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

NormalizedByte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedByte4 Constructor

NormalizedByte4 Constructor

Initializes a new instance of the NormalizedByte4 class.

Expand image Overload List

Name | Description
NormalizedByte4 (Single, Single, Single, Single) | Initializes a new instance of the NormalizedByte4 class.
NormalizedByte4 (Vector4) | Initializes a new instance of the NormalizedByte4 structure.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedByte4 Constructor (Single, Single, Single, Single)

NormalizedByte4 Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of the NormalizedByte4 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NormalizedByte4 (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4 Constructor (Vector4)

NormalizedByte4 Constructor (Vector4)
See Also
CollapseAll image

Initializes a new instance of the NormalizedByte4 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NormalizedByte4 (
         Vector4 vector
)

Parameters

vector
A vector containing the initial values for the components of the NormalizedByte4 structure.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4 Methods

NormalizedByte4 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

NormalizedByte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedByte4.Equals Method

NormalizedByte4.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
NormalizedByte4.Equals (NormalizedByte4) | Returns a value that indicates whether the current instance is equal to a specified object.
NormalizedByte4.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedByte4.Equals Method (NormalizedByte4)

NormalizedByte4.Equals Method (NormalizedByte4)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         NormalizedByte4 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4.Equals Method (Object)

NormalizedByte4.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4.GetHashCode Method

NormalizedByte4.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4.op_Equality Method

NormalizedByte4.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         NormalizedByte4 a,
         NormalizedByte4 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4.op_Inequality Method

NormalizedByte4.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         NormalizedByte4 a,
         NormalizedByte4 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4.ToString Method

NormalizedByte4.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4.ToVector4 Method

NormalizedByte4.ToVector4 Method

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedByte4 Properties

NormalizedByte4 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

NormalizedByte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedByte4.PackedValue Property

NormalizedByte4.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public uint PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2 Structure

NormalizedShort2 Structure

Packed vector type containing two 16-bit signed normalized values, ranging from −1 to 1.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct NormalizedShort2 : IPackedVector<uint>, IEquatable<NormalizedShort2>, IPackedVector

Expand image See Also

Reference

NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2 Members

NormalizedShort2 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the NormalizedShort2 type.

Expand image Public Constructors

 | Name | Description
Public Method | NormalizedShort2 | Overloaded. Initializes a new instance of the NormalizedShort2 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector2 | Expands the packed representation to a vector.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

NormalizedShort2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedShort2 Constructor

NormalizedShort2 Constructor

Initializes a new instance of the NormalizedShort2 class.

Expand image Overload List

Name | Description
NormalizedShort2 (Single, Single) | Initializes a new instance of the NormalizedShort2 class.
NormalizedShort2 (Vector2) | Initializes a new instance of the NormalizedShort2 structure.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedShort2 Constructor (Single, Single)

NormalizedShort2 Constructor (Single, Single)
See Also
CollapseAll image

Initializes a new instance of the NormalizedShort2 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NormalizedShort2 (
         float x,
         float y
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2 Constructor (Vector2)

NormalizedShort2 Constructor (Vector2)
See Also
CollapseAll image

Initializes a new instance of the NormalizedShort2 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NormalizedShort2 (
         Vector2 vector
)

Parameters

vector
A vector containing the initial values for the components of the NormalizedShort2 structure.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2 Methods

NormalizedShort2 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector2 | Expands the packed representation to a vector.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

NormalizedShort2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedShort2.Equals Method

NormalizedShort2.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
NormalizedShort2.Equals (NormalizedShort2) | Returns a value that indicates whether the current instance is equal to a specified object.
NormalizedShort2.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedShort2.Equals Method (NormalizedShort2)

NormalizedShort2.Equals Method (NormalizedShort2)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         NormalizedShort2 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2.Equals Method (Object)

NormalizedShort2.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2.GetHashCode Method

NormalizedShort2.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method
See Also
CollapseAll image

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2.op_Equality Method

NormalizedShort2.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         NormalizedShort2 a,
         NormalizedShort2 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2.op_Inequality Method

NormalizedShort2.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         NormalizedShort2 a,
         NormalizedShort2 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2.ToString Method

NormalizedShort2.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2.ToVector2 Method

NormalizedShort2.ToVector2 Method

Expands the packed representation to a vector.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 ToVector2 ()

Return Value

The expanded NormalizedShort2.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort2 Properties

NormalizedShort2 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

NormalizedShort2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedShort2.PackedValue Property

NormalizedShort2.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public uint PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4 Structure

NormalizedShort4 Structure

Packed vector type containing four 16-bit signed normalized values, ranging from −1 to 1.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct NormalizedShort4 : IPackedVector<ulong>, IEquatable<NormalizedShort4>, IPackedVector

Expand image See Also

Reference

NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4 Members

NormalizedShort4 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the NormalizedShort4 type.

Expand image Public Constructors

 | Name | Description
Public Method | NormalizedShort4 | Overloaded. Initializes a new instance of the NormalizedShort4 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

NormalizedShort4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedShort4 Constructor

NormalizedShort4 Constructor

Initializes a new instance of the NormalizedShort4 class.

Expand image Overload List

Name | Description
NormalizedShort4 (Single, Single, Single, Single) | Initializes a new instance of the NormalizedShort4 class.
NormalizedShort4 (Vector4) | Initializes a new instance of the NormalizedShort4 structure.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedShort4 Constructor (Single, Single, Single, Single)

NormalizedShort4 Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of the NormalizedShort4 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NormalizedShort4 (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4 Constructor (Vector4)

NormalizedShort4 Constructor (Vector4)
See Also
CollapseAll image

Initializes a new instance of the NormalizedShort4 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public NormalizedShort4 (
         Vector4 vector
)

Parameters

vector
A vector containing the initial values for the components of the NormalizedShort4 structure.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4 Methods

NormalizedShort4 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

NormalizedShort4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedShort4.Equals Method

NormalizedShort4.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
NormalizedShort4.Equals (NormalizedShort4) | Returns a value that indicates whether the current instance is equal to a specified object.
NormalizedShort4.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedShort4.Equals Method (NormalizedShort4)

NormalizedShort4.Equals Method (NormalizedShort4)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         NormalizedShort4 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4.Equals Method (Object)

NormalizedShort4.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4.GetHashCode Method

NormalizedShort4.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4.op_Equality Method

NormalizedShort4.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         NormalizedShort4 a,
         NormalizedShort4 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4.op_Inequality Method

NormalizedShort4.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         NormalizedShort4 a,
         NormalizedShort4 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4.ToString Method

NormalizedShort4.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4.ToVector4 Method

NormalizedShort4.ToVector4 Method

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


NormalizedShort4 Properties

NormalizedShort4 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

NormalizedShort4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


NormalizedShort4.PackedValue Property

NormalizedShort4.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public ulong PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32 Structure

Rg32 Structure

Packed vector type containing two 16-bit unsigned normalized values, ranging from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct Rg32 : IPackedVector<uint>, IEquatable<Rg32>, IPackedVector

Expand image See Also

Reference

Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32 Members

Rg32 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Rg32 type.

Expand image Public Constructors

 | Name | Description
Public Method | Rg32 | Overloaded. Initializes a new instance of the Rg32 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector2 | Expands the packed vector representation into a Vector2.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

Rg32 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rg32 Constructor

Rg32 Constructor

Initializes a new instance of the Rg32 class.

Expand image Overload List

Name | Description
Rg32 (Single, Single) | Initializes a new instance of the Rg32 structure.
Rg32 (Vector2) | Initializes a new instance of the Rg32 structure.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rg32 Constructor (Single, Single)

Rg32 Constructor (Single, Single)
See Also
CollapseAll image

Initializes a new instance of the Rg32 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Rg32 (
         float x,
         float y
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32 Constructor (Vector2)

Rg32 Constructor (Vector2)
See Also
CollapseAll image

Initializes a new instance of the Rg32 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Rg32 (
         Vector2 vector
)

Parameters

vector
The vector containing the initial values for the components of the Rg32 structure.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32 Methods

Rg32 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector2 | Expands the packed vector representation into a Vector2.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

Rg32 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rg32.Equals Method

Rg32.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Rg32.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.
Rg32.Equals (Rg32) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rg32.Equals Method (Object)

Rg32.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32.Equals Method (Rg32)

Rg32.Equals Method (Rg32)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Rg32 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32.GetHashCode Method

Rg32.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create packed representation from.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method
See Also
CollapseAll image

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32.op_Equality Method

Rg32.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Rg32 a,
         Rg32 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32.op_Inequality Method

Rg32.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Rg32 a,
         Rg32 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32.ToString Method

Rg32.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32.ToVector2 Method

Rg32.ToVector2 Method

Expands the packed vector representation into a Vector2.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 ToVector2 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rg32 Properties

Rg32 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

Rg32 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rg32.PackedValue Property

Rg32.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public uint PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102 Structure

Rgba1010102 Structure

Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 10 bits each for x, y, and z, and 2 bits for w.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct Rgba1010102 : IPackedVector<uint>, IEquatable<Rgba1010102>, IPackedVector

Expand image See Also

Reference

Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102 Members

Rgba1010102 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Rgba1010102 type.

Expand image Public Constructors

 | Name | Description
Public Method | Rgba1010102 | Overloaded. Initializes a new instance of the Rgba1010102 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4

Expand image See Also

Reference

Rgba1010102 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rgba1010102 Constructor

Rgba1010102 Constructor

Initializes a new instance of the Rgba1010102 class.

Expand image Overload List

Name | Description
Rgba1010102 (Single, Single, Single, Single) | Initializes a new instance of the Rgba1010102 class.
Rgba1010102 (Vector4) | Initializes a new instance of the Rgba1010102 structure.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rgba1010102 Constructor (Single, Single, Single, Single)

Rgba1010102 Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of the Rgba1010102 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Rgba1010102 (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102 Constructor (Vector4)

Rgba1010102 Constructor (Vector4)
See Also
CollapseAll image

Initializes a new instance of the Rgba1010102 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Rgba1010102 (
         Vector4 vector
)

Parameters

vector
A vector containing the initial values for the components of the Rgba1010102 structure.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102 Methods

Rgba1010102 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4

Expand image See Also

Reference

Rgba1010102 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rgba1010102.Equals Method

Rgba1010102.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Rgba1010102.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.
Rgba1010102.Equals (Rgba1010102) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rgba1010102.Equals Method (Object)

Rgba1010102.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102.Equals Method (Rgba1010102)

Rgba1010102.Equals Method (Rgba1010102)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Rgba1010102 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102.GetHashCode Method

Rgba1010102.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102.op_Equality Method

Rgba1010102.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Rgba1010102 a,
         Rgba1010102 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the left of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102.op_Inequality Method

Rgba1010102.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Rgba1010102 a,
         Rgba1010102 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102.ToString Method

Rgba1010102.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102.ToVector4 Method

Rgba1010102.ToVector4 Method

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba1010102 Properties

Rgba1010102 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

Rgba1010102 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rgba1010102.PackedValue Property

Rgba1010102.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public uint PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64 Structure

Rgba64 Structure

Packed vector type containing four 16-bit unsigned normalized values, ranging from 0 to 1.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct Rgba64 : IPackedVector<ulong>, IEquatable<Rgba64>, IPackedVector

Expand image See Also

Reference

Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64 Members

Rgba64 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Rgba64 type.

Expand image Public Constructors

 | Name | Description
Public Method | Rgba64 | Overloaded. Initializes a new instance of the Rgba64 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

Rgba64 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rgba64 Constructor

Rgba64 Constructor

Initializes a new instance of the Rgba64 class.

Expand image Overload List

Name | Description
Rgba64 (Single, Single, Single, Single) | Initializes a new instance of the Rgba64 structure.
Rgba64 (Vector4) | Initializes a new instance of the Rgba64 structure.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rgba64 Constructor (Single, Single, Single, Single)

Rgba64 Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of the Rgba64 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Rgba64 (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64 Constructor (Vector4)

Rgba64 Constructor (Vector4)
See Also
CollapseAll image

Initializes a new instance of the Rgba64 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Rgba64 (
         Vector4 vector
)

Parameters

vector
A vector containing the initial values for the components of the Rgba64 structure.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64 Methods

Rgba64 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

Rgba64 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rgba64.Equals Method

Rgba64.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Rgba64.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.
Rgba64.Equals (Rgba64) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rgba64.Equals Method (Object)

Rgba64.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64.Equals Method (Rgba64)

Rgba64.Equals Method (Rgba64)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Rgba64 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64.GetHashCode Method

Rgba64.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64.op_Equality Method

Rgba64.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Rgba64 a,
         Rgba64 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64.op_Inequality Method

Rgba64.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Rgba64 a,
         Rgba64 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64.ToString Method

Rgba64.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64.ToVector4 Method

Rgba64.ToVector4 Method

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Rgba64 Properties

Rgba64 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

Rgba64 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Rgba64.PackedValue Property

Rgba64.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public ulong PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2 Structure

Short2 Structure

Packed vector type containing two 16-bit signed integer values.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct Short2 : IPackedVector<uint>, IEquatable<Short2>, IPackedVector

Expand image See Also

Reference

Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2 Members

Short2 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Short2 type.

Expand image Public Constructors

 | Name | Description
Public Method | Short2 | Overloaded. Initializes a new instance of the Short2 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector2 | Expands the packed representation to a vector.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

Short2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Short2 Constructor

Short2 Constructor

Initializes a new instance of the Short2 class.

Expand image Overload List

Name | Description
Short2 (Single, Single) | Initializes a new instance of the Short2 class.
Short2 (Vector2) | Initializes a new instance of the Short2 structure.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Short2 Constructor (Single, Single)

Short2 Constructor (Single, Single)
See Also
CollapseAll image

Initializes a new instance of the Short2 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Short2 (
         float x,
         float y
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2 Constructor (Vector2)

Short2 Constructor (Vector2)
See Also
CollapseAll image

Initializes a new instance of the Short2 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Short2 (
         Vector2 vector
)

Parameters

vector
A vector containing the initial values for the components of the Short2 structure.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2 Methods

Short2 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector2 | Expands the packed representation to a vector.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 | Expands the packed representation into a Vector4.

Expand image See Also

Reference

Short2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Short2.Equals Method

Short2.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Short2.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.
Short2.Equals (Short2) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Short2.Equals Method (Object)

Short2.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2.Equals Method (Short2)

Short2.Equals Method (Short2)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Short2 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2.GetHashCode Method

Short2.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Method
See Also
CollapseAll image

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2.op_Equality Method

Short2.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Short2 a,
         Short2 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2.op_Inequality Method

Short2.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Short2 a,
         Short2 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2.ToString Method

Short2.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2.ToVector2 Method

Short2.ToVector2 Method

Expands the packed representation to a vector.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 ToVector2 ()

Return Value

The expanded Short2.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short2 Properties

Short2 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

Short2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Short2.PackedValue Property

Short2.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public uint PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4 Structure

Short4 Structure

Packed vector type containing four 16-bit signed integer values.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct Short4 : IPackedVector<ulong>, IEquatable<Short4>, IPackedVector

Expand image See Also

Reference

Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4 Members

Short4 Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the Short4 type.

Expand image Public Constructors

 | Name | Description
Public Method | Short4 | Overloaded. Initializes a new instance of the Short4 class.

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

Short4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Short4 Constructor

Short4 Constructor

Initializes a new instance of the Short4 class.

Expand image Overload List

Name | Description
Short4 (Single, Single, Single, Single) | Initializes a new instance of the Short4 class.
Short4 (Vector4) | Initializes a new instance of the Short4 structure.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Short4 Constructor (Single, Single, Single, Single)

Short4 Constructor (Single, Single, Single, Single)
See Also
CollapseAll image

Initializes a new instance of the Short4 class.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Short4 (
         float x,
         float y,
         float z,
         float w
)

Parameters

x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4 Constructor (Vector4)

Short4 Constructor (Vector4)
See Also
CollapseAll image

Initializes a new instance of the Short4 structure.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Short4 (
         Vector4 vector
)

Parameters

vector
A vector containing the initial values for the components of the Short4 structure.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4 Methods

Short4 Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for the current instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Compares the current instance of a class to another instance to determine whether they are the same.
 | op_Inequality | Compares the current instance of a class to another instance to determine whether they are different.
Public Method | ToString | Returns a string representation of the current instance.
Public Method | ToVector4 | Expands the packed representation into a Vector4.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 | Sets the packed representation from a Vector4.

Expand image See Also

Reference

Short4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Short4.Equals Method

Short4.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Expand image Overload List

Name | Description
Short4.Equals (Object) | Returns a value that indicates whether the current instance is equal to a specified object.
Short4.Equals (Short4) | Returns a value that indicates whether the current instance is equal to a specified object.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Short4.Equals Method (Object)

Short4.Equals Method (Object)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4.Equals Method (Short4)

Short4.Equals Method (Short4)
See Also
CollapseAll image

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Short4 other
)

Parameters

other
The object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4.GetHashCode Method

Short4.GetHashCode Method

Gets the hash code for the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for the instance.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method

Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Method
See Also
CollapseAll image

Sets the packed representation from a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
         Vector4 vector
)

Parameters

vector
The vector to create the packed representation from.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4.op_Equality Method

Short4.op_Equality Method

Compares the current instance of a class to another instance to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Short4 a,
         Short4 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4.op_Inequality Method

Short4.op_Inequality Method

Compares the current instance of a class to another instance to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Short4 a,
         Short4 b
)

Parameters

a
The object to the left of the equality operator.
b
The object to the right of the equality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4.ToString Method

Short4.ToString Method

Returns a string representation of the current instance.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String that represents the object.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4.ToVector4 Method

Short4.ToVector4 Method

Expands the packed representation into a Vector4.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector4 ToVector4 ()

Return Value

The expanded vector.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Short4 Properties

Short4 Properties

Expand image Public Properties

 | Name | Description
Public Property | PackedValue | Directly gets or sets the packed representation of the value.

Expand image See Also

Reference

Short4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace


Short4.PackedValue Property

Short4.PackedValue Property

Directly gets or sets the packed representation of the value.

Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[CLSCompliantAttribute(false)]
public ulong PackedValue { get; set; }

Property Value

The packed representation of the value.

Expand image See Also

Reference

Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Input Namespace

Microsoft.Xna.Framework.Input Namespace

Contains classes to receive input from keyboard, mouse, and Xbox 360 Controller devices.

Expand image Classes

 | Name | Description
Public Class | GamePad | Allows retrieval of user interaction with an Xbox 360 Controller and setting of controller vibration motors.
Public Class | Keyboard | Allows retrieval of keystrokes from a keyboard input device.
Public Class | Mouse | Allows retrieval of position and button clicks from a mouse input device.

Expand image Structures

 | Name | Description
Public Structure | GamePadButtons | Identifies whether buttons on an Xbox 360 Controller are pressed or released.
Public Structure | GamePadCapabilities | Describes the capabilities of an Xbox 360 Controller, including controller type, and identifies if the controller supports voice.
Public Structure | GamePadDPad | Identifies which directions on the directional pad of an Xbox 360 Controller are being pressed.
Public Structure | GamePadState | Represents specific information about the state of an Xbox 360 Controller, including the current state of buttons and sticks.
Public Structure | GamePadThumbSticks | Structure that represents the position of left and right sticks (thumbsticks) on an Xbox 360 Controller.
Public Structure | GamePadTriggers | Structure that defines the position of the left and right triggers on an Xbox 360 Controller.
Public Structure | KeyboardState | Represents a state of keystrokes recorded by a keyboard input device.
Public Structure | MouseState | Represents the state of a mouse input device, including mouse cursor position and buttons pressed.

Expand image Enumerations

 | Name | Description
Public Enumeration | Buttons | Enumerates input device buttons.
Public Enumeration | ButtonState | Identifies the state of a controller button.
Public Enumeration | GamePadDeadZone | Specifies a type of dead zone processing to apply to Xbox 360 Controller analog sticks when calling GetState.
Public Enumeration | GamePadType | Describes the type of a specified Xbox 360 Controller.
Public Enumeration | Keys | Identifies a particular key on a keyboard.
Public Enumeration | KeyState | Identifies the state of a keyboard key.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)
Getting the Mouse Position (Windows, Windows Phone)
Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices
Input Content Catalog at XNA Creators Club Online


Buttons Enumeration

Buttons Enumeration

Enumerates input device buttons.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[FlagsAttribute]
public enum Buttons

Expand image Members

Member name | Description
A | A button
B | B button
Back | BACK button
BigButton | Big button
DPadDown | Directional pad up
DPadLeft | Directional pad left
DPadRight | Directional pad right
DPadUp | Directional pad down
LeftShoulder | Left bumper (shoulder) button
LeftStick | Left stick button (pressing the left stick)
LeftThumbstickDown | Left stick is toward down
LeftThumbstickLeft | Left stick is toward the left
LeftThumbstickRight | Left stick is toward the right
LeftThumbstickUp | Left stick is toward up
LeftTrigger | Left trigger
RightShoulder | Right bumper (shoulder) button
RightStick | Right stick button (pressing the right stick)
RightThumbstickDown | Right stick is toward down
RightThumbstickLeft | Right stick is toward the left
RightThumbstickRight | Right stick is toward the right
RightThumbstickUp | Right stick is toward up
RightTrigger | Right trigger
Start | START button
X | X button
Y | Y button

Expand image See Also

Reference

Microsoft.Xna.Framework.Input Namespace
GamePadState.IsButtonDown Method
GamePadState.IsButtonUp Method

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ButtonState Enumeration

ButtonState Enumeration

Identifies the state of a controller button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum ButtonState

Expand image Members

Member name | Description
Pressed | The button is pressed.
Released | The button is released.

Expand image See Also

Reference

Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePad Class

GamePad Class
See Also Members
CollapseAll image

Allows retrieval of user interaction with an Xbox 360 Controller and setting of controller vibration motors.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static class GamePad

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

GamePad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePad Members

GamePad Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the GamePad type.

Expand image Public Methods

Name | Description
GetCapabilities | Retrieves the capabilities of an Xbox 360 Controller.
GetState | Overloaded. Gets the current state of a game pad controller. As an option, it specifies a dead zone processing method for the analog sticks.
SetVibration | Sets the vibration motor speeds on an Xbox 360 Controller.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

GamePad Class
Microsoft.Xna.Framework.Input Namespace


GamePad Methods

GamePad Methods

Expand image Public Methods

Name | Description
GetCapabilities | Retrieves the capabilities of an Xbox 360 Controller.
GetState | Overloaded. Gets the current state of a game pad controller. As an option, it specifies a dead zone processing method for the analog sticks.
SetVibration | Sets the vibration motor speeds on an Xbox 360 Controller.

Expand image See Also

Reference

GamePad Class
Microsoft.Xna.Framework.Input Namespace


GamePad.GetCapabilities Method

GamePad.GetCapabilities Method

Retrieves the capabilities of an Xbox 360 Controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static GamePadCapabilities GetCapabilities (
         PlayerIndex playerIndex
)

Parameters

playerIndex
Index of the controller to query.

Return Value

The capabilities of the controller.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | An unknown error has occurred. Verify that the correct playerIndex is being requested.

Expand image See Also

Reference

GamePad Class
GamePad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePad.GetState Method

GamePad.GetState Method

Gets the current state of a game pad controller. As an option, it specifies a dead zone processing method for the analog sticks.

Expand image Overload List

Name | Description
GamePad.GetState (PlayerIndex) | Gets the current state of a game pad controller.
GamePad.GetState (PlayerIndex, GamePadDeadZone) | Gets the current state of a game pad controller, using a specified dead zone on analog stick positions.

Expand image Remarks

When you call GetState, check the returned structure's IsConnected property value. If the controller has been disconnected, this value will be false. When a controller is disconnected, values for its state will not be valid. Also, the controller will not receive any new vibration settings.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

GamePad Class
GamePad Members
Microsoft.Xna.Framework.Input Namespace


GamePad.GetState Method (PlayerIndex)

GamePad.GetState Method (PlayerIndex)
See Also
CollapseAll image

Gets the current state of a game pad controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static GamePadState GetState (
         PlayerIndex playerIndex
)

Parameters

playerIndex
Player index for the controller you want to query.

Return Value

The current state of the controller.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | An unknown error has occurred. Verify that the correct playerIndex is being requested.

Expand image Remarks

Best Practice

  • On the first menu presented by the game, consider asking the player to sign in by pressing A or Start. This enables the game to detect the correct controller in use for each player in the game.

  • When processing player input, you can examine SignedInGamer.GameDefaults to determine a player's preferences for how the Xbox 360 controller is used to send input to the game.

When you call GetState, check the returned structure's IsConnected property value. If the controller has been disconnected, this value will be false. When a controller is disconnected, values for its state will not be valid. Also, the controller will not receive any new vibration settings.

This method uses the GamePadDeadZone.IndependentAxes dead zone to smooth the values of the analog sticks. To specify a different dead zone type, or to specify no-dead-zone processing, pass a GamePadDeadZone value to this method.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

SignedInGamer.PlayerIndex Property
SignedInGamer.GameDefaults
GamePad Class
GamePad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePad.GetState Method (PlayerIndex, GamePadDeadZone)

GamePad.GetState Method (PlayerIndex, GamePadDeadZone)
See Also
CollapseAll image

Gets the current state of a game pad controller, using a specified dead zone on analog stick positions.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static GamePadState GetState (
         PlayerIndex playerIndex,
         GamePadDeadZone deadZoneMode
)

Parameters

playerIndex
Player index for the controller you want to query.
deadZoneMode
Enumerated value that specifies what dead zone type to use.

Return Value

The current state of the controller.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | An unknown error has occurred. Verify that the correct playerIndex is being requested.

Expand image Remarks

Best Practice

  • On the first menu presented by the game, consider asking the player to sign in by pressing A or Start. This enables the game to detect the correct controller in use for each player in the game.

  • When processing player input, you can examine SignedInGamer.GameDefaults to determine a player's preferences for how the Xbox 360 controller is used to send input to the game.

When you call GetState, check the returned structure's IsConnected property value. If the controller has been disconnected, this value will be false. When a controller is disconnected, values for its state will not be valid. Also, the controller will not receive any new vibration settings.

The deadZoneMode parameter specifies the type of dead-zone processing to apply to the analog sticks on the controller. By applying a dead zone, controller inputs will report values near the center and edges of their ranges more accurately. If you wish to do your own dead-zone processing, use GamePadDeadZone.None.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

SignedInGamer.PlayerIndex Property
SignedInGamer.GameDefaults
GamePad Class
GamePad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePad.SetVibration Method

GamePad.SetVibration Method

Sets the vibration motor speeds on an Xbox 360 Controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool SetVibration (
         PlayerIndex playerIndex,
         float leftMotor,
         float rightMotor
)

Parameters

playerIndex
Player index that identifies the controller to set.
leftMotor
The speed of the left motor, between 0.0 and 1.0. This motor is a low-frequency motor.
rightMotor
The speed of the right motor, between 0.0 and 1.0. This motor is a high-frequency motor.

Return Value

true if the vibration motors were successfully set; false if the controller was unable to process the request.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | An unknown error has occurred. Verify that the correct playerIndex is being requested.

Expand image Remarks

If this method returns false, it means that the controller is either disconnected or too busy to accept the new vibration settings. It is not advisable to loop in wait for this method to return true.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)

Reference

GamePad Class
GamePad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons Structure

GamePadButtons Structure

Identifies whether buttons on an Xbox 360 Controller are pressed or released.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct GamePadButtons

Expand image Remarks

Best Practice
  • If your game allows the player to control acceleration using the Xbox 360 Controller, you may check GameDefaults.AccelerateWithButtons to determine whether the player prefers using gamepad buttons or triggers to control acceleration.
  • If your game allows the player to control braking using the Xbox 360 Controller, you may check GameDefaults.BrakeWithButtons to determine if the player prefers using gamepad buttons or triggers to control braking.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons Members

GamePadButtons Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the GamePadButtons type.

Expand image Public Constructors

 | Name | Description
Public Method | GamePadButtons | Initializes a new instance of the GamePadButtons class, setting the specified buttons to pressed in.

Expand image Public Properties

 | Name | Description
Public Property | A | Identifies if the A button on the Xbox 360 Controller is pressed.
Public Property | B | Identifies if the B button on the Xbox 360 Controller is pressed.
Public Property | Back | Identifies if the BACK button on the Xbox 360 Controller is pressed.
Public Property | BigButton | Identifies if the BigButton button is pressed.
Public Property | LeftShoulder | Identifies if the left shoulder (bumper) button on the Xbox 360 Controller is pressed.
Public Property | LeftStick | Identifies if the left stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).
Public Property | RightShoulder | Identifies if the right shoulder (bumper) button on the Xbox 360 Controller is pressed.
Public Property | RightStick | Identifies if the right stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).
Public Property | Start | Identifies if the START button on the Xbox 360 Controller is pressed.
Public Property | X | Identifies if the X button on the Xbox 360 Controller is pressed.
Public Property | Y | Identifies if the Y button on the Xbox 360 Controller is pressed.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates if the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Indicates if the two GamePadButton objects are equal.
 | op_Inequality | Determines whether two GamePadButtons instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

GamePadButtons Structure
Microsoft.Xna.Framework.Input Namespace


GamePadButtons Constructor

GamePadButtons Constructor

Initializes a new instance of the GamePadButtons class, setting the specified buttons to pressed in.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadButtons (
         Buttons buttons
)

Parameters

buttons
Buttons to initialize as pressed. Specify a single button or combine multiple buttons using a bitwise OR operation.

Expand image Remarks

Note that GamePadButtons only stores the state of digital buttons—such as A or right bumper— that are pressed in or not pressed in. Trigger or stick values specified in the buttons argument are ignored.

Games normally use GetState to get the true gamepad state. This constructor is used instead to simulate gamepad input for passing within the game's own input subsystem.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons Methods

GamePadButtons Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates if the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Indicates if the two GamePadButton objects are equal.
 | op_Inequality | Determines whether two GamePadButtons instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamePadButtons Structure
Microsoft.Xna.Framework.Input Namespace


GamePadButtons.Equals Method

GamePadButtons.Equals Method

Returns a value that indicates if the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The object with which to make the comparison.

Return Value

Returns true if the objects are equal; false otherwise.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.GetHashCode Method

GamePadButtons.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.op_Equality Method

GamePadButtons.op_Equality Method

Indicates if the two GamePadButton objects are equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         GamePadButtons left,
         GamePadButtons right
)

Parameters

left
The GamePadButtons instance on the left side of the equality.
right
The GamePadButtons instance on the right side of the equality.

Return Value

Returns true if the objects are equal; false otherwise.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.op_Inequality Method

GamePadButtons.op_Inequality Method

Determines whether two GamePadButtons instances are not equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         GamePadButtons left,
         GamePadButtons right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.ToString Method

GamePadButtons.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons Properties

GamePadButtons Properties

Expand image Public Properties

 | Name | Description
Public Property | A | Identifies if the A button on the Xbox 360 Controller is pressed.
Public Property | B | Identifies if the B button on the Xbox 360 Controller is pressed.
Public Property | Back | Identifies if the BACK button on the Xbox 360 Controller is pressed.
Public Property | BigButton | Identifies if the BigButton button is pressed.
Public Property | LeftShoulder | Identifies if the left shoulder (bumper) button on the Xbox 360 Controller is pressed.
Public Property | LeftStick | Identifies if the left stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).
Public Property | RightShoulder | Identifies if the right shoulder (bumper) button on the Xbox 360 Controller is pressed.
Public Property | RightStick | Identifies if the right stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).
Public Property | Start | Identifies if the START button on the Xbox 360 Controller is pressed.
Public Property | X | Identifies if the X button on the Xbox 360 Controller is pressed.
Public Property | Y | Identifies if the Y button on the Xbox 360 Controller is pressed.

Expand image See Also

Reference

GamePadButtons Structure
Microsoft.Xna.Framework.Input Namespace


GamePadButtons.A Property

GamePadButtons.A Property

Identifies if the A button on the Xbox 360 Controller is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState A { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image Remarks

Best Practice
The A button typically is used to confirm selection of an item.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.B Property

GamePadButtons.B Property

Identifies if the B button on the Xbox 360 Controller is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState B { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image Remarks

Best Practice
The B button typically is used to cancel or back out of a menu in a game.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.Back Property

GamePadButtons.Back Property

Identifies if the BACK button on the Xbox 360 Controller is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState Back { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image Remarks

Best Practice
During gameplay, the Back button might be used to bring up a scoreboard or other contextual information such as a map.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.BigButton Property

GamePadButtons.BigButton Property

Identifies if the BigButton button is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState BigButton { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.LeftShoulder Property

GamePadButtons.LeftShoulder Property

Identifies if the left shoulder (bumper) button on the Xbox 360 Controller is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState LeftShoulder { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.LeftStick Property

GamePadButtons.LeftStick Property

Identifies if the left stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState LeftStick { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.RightShoulder Property

GamePadButtons.RightShoulder Property

Identifies if the right shoulder (bumper) button on the Xbox 360 Controller is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState RightShoulder { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.RightStick Property

GamePadButtons.RightStick Property

Identifies if the right stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState RightStick { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.Start Property

GamePadButtons.Start Property

Identifies if the START button on the Xbox 360 Controller is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState Start { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image Remarks

Best Practice
During gameplay, the Start button typically is used to pause the game.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.X Property

GamePadButtons.X Property

Identifies if the X button on the Xbox 360 Controller is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState X { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadButtons.Y Property

GamePadButtons.Y Property

Identifies if the Y button on the Xbox 360 Controller is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState Y { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities Structure

GamePadCapabilities Structure

Describes the capabilities of an Xbox 360 Controller, including controller type, and identifies if the controller supports voice.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct GamePadCapabilities

Expand image See Also

Reference

GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities Members

GamePadCapabilities Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the GamePadCapabilities type.

Expand image Public Properties

 | Name | Description
Public Property | GamePadType | Gets the type of controller.
Public Property | HasAButton | Indicates whether the controller has an A button.
Public Property | HasBackButton | Indicates whether the controller has a BACK button.
Public Property | HasBButton | Indicates whether the controller has a B button.
Public Property | HasBigButton | Indicates whether the controller has a BigButton button.
Public Property | HasDPadDownButton | Indicates whether the controller has a directional pad DOWN button.
Public Property | HasDPadLeftButton | Indicates whether the controller has a directional pad LEFT button.
Public Property | HasDPadRightButton | Indicates whether the controller has a directional pad RIGHT button.
Public Property | HasDPadUpButton | Indicates whether the controller has a directional pad UP button.
Public Property | HasLeftShoulderButton | Indicates whether the controller has a left bumper button.
Public Property | HasLeftStickButton | Indicates whether the controller has a digital button control on the left analog stick.
Public Property | HasLeftTrigger | Indicates whether the controller has a left analog trigger.
Public Property | HasLeftVibrationMotor | Indicates whether the controller has a low-frequency vibration motor.
Public Property | HasLeftXThumbStick | Indicates whether the controller supports a left analog control with horizontal movement.
Public Property | HasLeftYThumbStick | Indicates whether the controller supports a left analog control with vertical movement.
Public Property | HasRightShoulderButton | Indicates whether the controller has a right bumper button.
Public Property | HasRightStickButton | Indicates whether the controller has a digital button control on the right analog stick.
Public Property | HasRightTrigger | Indicates whether the controller has a right analog trigger.
Public Property | HasRightVibrationMotor | Indicates whether the controller has a high-frequency vibration motor.
Public Property | HasRightXThumbStick | Indicates whether the controller supports a right analog control with horizontal movement.
Public Property | HasRightYThumbStick | Indicates whether the controller supports a right analog control with vertical movement.
Public Property | HasStartButton | Indicates whether the controller has a START button.
Public Property | HasVoiceSupport | Indicates whether the controller supports voice.
Public Property | HasXButton | Indicates whether the controller has an X button.
Public Property | HasYButton | Indicates whether the controller has a Y button.
Public Property | IsConnected | Indicates whether the Xbox 360 Controller is connected.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamePadCapabilities Structure
Microsoft.Xna.Framework.Input Namespace


GamePadCapabilities Methods

GamePadCapabilities Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamePadCapabilities Structure
Microsoft.Xna.Framework.Input Namespace


GamePadCapabilities Properties

GamePadCapabilities Properties

Expand image Public Properties

 | Name | Description
Public Property | GamePadType | Gets the type of controller.
Public Property | HasAButton | Indicates whether the controller has an A button.
Public Property | HasBackButton | Indicates whether the controller has a BACK button.
Public Property | HasBButton | Indicates whether the controller has a B button.
Public Property | HasBigButton | Indicates whether the controller has a BigButton button.
Public Property | HasDPadDownButton | Indicates whether the controller has a directional pad DOWN button.
Public Property | HasDPadLeftButton | Indicates whether the controller has a directional pad LEFT button.
Public Property | HasDPadRightButton | Indicates whether the controller has a directional pad RIGHT button.
Public Property | HasDPadUpButton | Indicates whether the controller has a directional pad UP button.
Public Property | HasLeftShoulderButton | Indicates whether the controller has a left bumper button.
Public Property | HasLeftStickButton | Indicates whether the controller has a digital button control on the left analog stick.
Public Property | HasLeftTrigger | Indicates whether the controller has a left analog trigger.
Public Property | HasLeftVibrationMotor | Indicates whether the controller has a low-frequency vibration motor.
Public Property | HasLeftXThumbStick | Indicates whether the controller supports a left analog control with horizontal movement.
Public Property | HasLeftYThumbStick | Indicates whether the controller supports a left analog control with vertical movement.
Public Property | HasRightShoulderButton | Indicates whether the controller has a right bumper button.
Public Property | HasRightStickButton | Indicates whether the controller has a digital button control on the right analog stick.
Public Property | HasRightTrigger | Indicates whether the controller has a right analog trigger.
Public Property | HasRightVibrationMotor | Indicates whether the controller has a high-frequency vibration motor.
Public Property | HasRightXThumbStick | Indicates whether the controller supports a right analog control with horizontal movement.
Public Property | HasRightYThumbStick | Indicates whether the controller supports a right analog control with vertical movement.
Public Property | HasStartButton | Indicates whether the controller has a START button.
Public Property | HasVoiceSupport | Indicates whether the controller supports voice.
Public Property | HasXButton | Indicates whether the controller has an X button.
Public Property | HasYButton | Indicates whether the controller has a Y button.
Public Property | IsConnected | Indicates whether the Xbox 360 Controller is connected.

Expand image See Also

Reference

GamePadCapabilities Structure
Microsoft.Xna.Framework.Input Namespace


GamePadCapabilities.GamePadType Property

GamePadCapabilities.GamePadType Property

Gets the type of controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadType GamePadType { get; }

Property Value

Enumerated value describing the controller type.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasAButton Property

GamePadCapabilities.HasAButton Property

Indicates whether the controller has an A button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasAButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasBackButton Property

GamePadCapabilities.HasBackButton Property

Indicates whether the controller has a BACK button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasBackButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasBButton Property

GamePadCapabilities.HasBButton Property

Indicates whether the controller has a B button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasBButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasBigButton Property

GamePadCapabilities.HasBigButton Property

Indicates whether the controller has a BigButton button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasBigButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasDPadDownButton Property

GamePadCapabilities.HasDPadDownButton Property

Indicates whether the controller has a directional pad DOWN button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasDPadDownButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasDPadLeftButton Property

GamePadCapabilities.HasDPadLeftButton Property

Indicates whether the controller has a directional pad LEFT button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasDPadLeftButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasDPadRightButton Property

GamePadCapabilities.HasDPadRightButton Property

Indicates whether the controller has a directional pad RIGHT button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasDPadRightButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasDPadUpButton Property

GamePadCapabilities.HasDPadUpButton Property

Indicates whether the controller has a directional pad UP button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasDPadUpButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasLeftShoulderButton Property

GamePadCapabilities.HasLeftShoulderButton Property

Indicates whether the controller has a left bumper button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasLeftShoulderButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasLeftStickButton Property

GamePadCapabilities.HasLeftStickButton Property

Indicates whether the controller has a digital button control on the left analog stick.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasLeftStickButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasLeftTrigger Property

GamePadCapabilities.HasLeftTrigger Property

Indicates whether the controller has a left analog trigger.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasLeftTrigger { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasLeftVibrationMotor Property

GamePadCapabilities.HasLeftVibrationMotor Property

Indicates whether the controller has a low-frequency vibration motor.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasLeftVibrationMotor { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasLeftXThumbStick Property

GamePadCapabilities.HasLeftXThumbStick Property

Indicates whether the controller supports a left analog control with horizontal movement.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasLeftXThumbStick { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasLeftYThumbStick Property

GamePadCapabilities.HasLeftYThumbStick Property

Indicates whether the controller supports a left analog control with vertical movement.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasLeftYThumbStick { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasRightShoulderButton Property

GamePadCapabilities.HasRightShoulderButton Property

Indicates whether the controller has a right bumper button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasRightShoulderButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasRightStickButton Property

GamePadCapabilities.HasRightStickButton Property

Indicates whether the controller has a digital button control on the right analog stick.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasRightStickButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasRightTrigger Property

GamePadCapabilities.HasRightTrigger Property

Indicates whether the controller has a right analog trigger.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasRightTrigger { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasRightVibrationMotor Property

GamePadCapabilities.HasRightVibrationMotor Property

Indicates whether the controller has a high-frequency vibration motor.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasRightVibrationMotor { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasRightXThumbStick Property

GamePadCapabilities.HasRightXThumbStick Property

Indicates whether the controller supports a right analog control with horizontal movement.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasRightXThumbStick { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasRightYThumbStick Property

GamePadCapabilities.HasRightYThumbStick Property

Indicates whether the controller supports a right analog control with vertical movement.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasRightYThumbStick { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasStartButton Property

GamePadCapabilities.HasStartButton Property

Indicates whether the controller has a START button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasStartButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasVoiceSupport Property

GamePadCapabilities.HasVoiceSupport Property

Indicates whether the controller supports voice.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasVoiceSupport { get; }

Property Value

true if the controller supports voice; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasXButton Property

GamePadCapabilities.HasXButton Property

Indicates whether the controller has an X button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasXButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.HasYButton Property

GamePadCapabilities.HasYButton Property

Indicates whether the controller has a Y button.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasYButton { get; }

Property Value

true if the controller has this capability; false otherwise.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadCapabilities.IsConnected Property

GamePadCapabilities.IsConnected Property

Indicates whether the Xbox 360 Controller is connected.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsConnected { get; }

Property Value

true if the controller is connected; false otherwise.

Expand image Remarks

When calling GetState or GetCapabilities, check the returned structure's IsConnected property value. If the controller has been disconnected, this value will be false. When a controller is disconnected, values for its state and/or capabilities will not be valid. The controller will also not be able to receive new vibration settings.

Expand image See Also

Reference

GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDeadZone Enumeration

GamePadDeadZone Enumeration

Specifies a type of dead zone processing to apply to Xbox 360 Controller analog sticks when calling GetState.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum GamePadDeadZone

Expand image Members

Member name | Description
Circular | The combined X and Y position of each stick is compared to the dead zone. This provides better control than IndependentAxes when the stick is used as a two-dimensional control surface, such as when controlling a character's view in a first-person game.
IndependentAxes | The X and Y positions of each stick are compared against the dead zone independently. This setting is the default when calling GetState.
None | The values of each stick are not processed and are returned by GetState as "raw" values. This is best if you intend to implement your own dead zone processing.

Expand image See Also

Reference

Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad Structure

GamePadDPad Structure

Identifies which directions on the directional pad of an Xbox 360 Controller are being pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct GamePadDPad

Expand image Remarks

Best Practice
Many games allow movement to be controlled with either the left thumbstick or the directional pad (D-pad). The left thumbstick can be accessed with ThumbSticks, and the directional pad is available through DPad.

Expand image See Also

Reference

GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad Members

GamePadDPad Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the GamePadDPad type.

Expand image Public Constructors

 | Name | Description
Public Method | GamePadDPad | Initializes a new instance of the GamePadDPad class.

Expand image Public Properties

 | Name | Description
Public Property | Down | Identifies whether the Down direction on the Xbox 360 Controller directional pad is pressed.
Public Property | Left | Identifies whether the Left direction on the Xbox 360 Controller directional pad is pressed.
Public Property | Right | Identifies whether the Right direction on the Xbox 360 Controller directional pad is pressed.
Public Property | Up | Identifies whether the Up direction on the Xbox 360 Controller directional pad is pressed.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two GamePadDPad instances are equal.
 | op_Inequality | Determines whether two GamePadDPad instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamePadDPad Structure
Microsoft.Xna.Framework.Input Namespace


GamePadDPad Constructor

GamePadDPad Constructor

Initializes a new instance of the GamePadDPad class.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadDPad (
         ButtonState upValue,
         ButtonState downValue,
         ButtonState leftValue,
         ButtonState rightValue
)

Parameters

upValue
Directional pad up button state.
downValue
Directional pad down button state.
leftValue
Directional pad left button state.
rightValue
Directional pad right button state.

Expand image Remarks

Games normally use GetState to get the true gamepad state. This constructor is used instead to simulate gamepad input for passing within the game's own input subsystem.

Expand image See Also

Reference

GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad Methods

GamePadDPad Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two GamePadDPad instances are equal.
 | op_Inequality | Determines whether two GamePadDPad instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamePadDPad Structure
Microsoft.Xna.Framework.Input Namespace


GamePadDPad.Equals Method

GamePadDPad.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad.GetHashCode Method

GamePadDPad.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad.op_Equality Method

GamePadDPad.op_Equality Method

Determines whether two GamePadDPad instances are equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         GamePadDPad left,
         GamePadDPad right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the instances are equal; false otherwise.

Expand image See Also

Reference

GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad.op_Inequality Method

GamePadDPad.op_Inequality Method

Determines whether two GamePadDPad instances are not equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         GamePadDPad left,
         GamePadDPad right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad.ToString Method

GamePadDPad.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad Properties

GamePadDPad Properties

Expand image Public Properties

 | Name | Description
Public Property | Down | Identifies whether the Down direction on the Xbox 360 Controller directional pad is pressed.
Public Property | Left | Identifies whether the Left direction on the Xbox 360 Controller directional pad is pressed.
Public Property | Right | Identifies whether the Right direction on the Xbox 360 Controller directional pad is pressed.
Public Property | Up | Identifies whether the Up direction on the Xbox 360 Controller directional pad is pressed.

Expand image See Also

Reference

GamePadDPad Structure
Microsoft.Xna.Framework.Input Namespace


GamePadDPad.Down Property

GamePadDPad.Down Property

Identifies whether the Down direction on the Xbox 360 Controller directional pad is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState Down { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad.Left Property

GamePadDPad.Left Property

Identifies whether the Left direction on the Xbox 360 Controller directional pad is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState Left { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad.Right Property

GamePadDPad.Right Property

Identifies whether the Right direction on the Xbox 360 Controller directional pad is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState Right { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadDPad.Up Property

GamePadDPad.Up Property

Identifies whether the Up direction on the Xbox 360 Controller directional pad is pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState Up { get; }

Property Value

ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.

Expand image See Also

Reference

GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState Structure

GamePadState Structure

Represents specific information about the state of an Xbox 360 Controller, including the current state of buttons and sticks.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct GamePadState

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState Members

GamePadState Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the GamePadState type.

Expand image Public Constructors

 | Name | Description
Public Method | GamePadState | Overloaded. Initializes a new instance of the GamePadState class.

Expand image Public Properties

 | Name | Description
Public Property | Buttons | Returns a structure that identifies what buttons on the Xbox 360 controller are pressed.
Public Property | DPad | Returns a structure that identifies what directions of the directional pad on the Xbox 360 Controller are pressed.
Public Property | IsConnected | Indicates whether the Xbox 360 Controller is connected.
Public Property | PacketNumber | Gets the packet number associated with this state.
Public Property | ThumbSticks | Returns a structure that indicates the position of the Xbox 360 Controller sticks (thumbsticks).
Public Property | Triggers | Returns a structure that identifies the position of triggers on the Xbox 360 controller.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
Public Method | IsButtonDown | Determines whether specified input device buttons are pressed in this GamePadState.
Public Method | IsButtonUp | Determines whether specified input device buttons are up (not pressed) in this GamePadState.
 | op_Equality | Determines whether two GamePadState instances are equal.
 | op_Inequality | Determines whether two GamePadState instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

GamePadState Structure
Microsoft.Xna.Framework.Input Namespace


GamePadState Constructor

GamePadState Constructor

Initializes a new instance of the GamePadState class.

Expand image Overload List

Name | Description
GamePadState (GamePadThumbSticks, GamePadTriggers, GamePadButtons, GamePadDPad) | Initializes a new instance of the GamePadState class using the specified GamePadThumbSticks, GamePadTriggers, GamePadButtons, and GamePadDPad.
GamePadState (Vector2, Vector2, Single, Single, Buttons[]) | Initializes a new instance of the GamePadState class with the specified stick, trigger, and button values.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace


GamePadState Constructor (GamePadThumbSticks, GamePadTriggers, GamePadButtons, GamePadDPad)

GamePadState Constructor (GamePadThumbSticks, GamePadTriggers, GamePadButtons, GamePadDPad)
See Also
CollapseAll image

Initializes a new instance of the GamePadState class using the specified GamePadThumbSticks, GamePadTriggers, GamePadButtons, and GamePadDPad.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadState (
         GamePadThumbSticks thumbSticks,
         GamePadTriggers triggers,
         GamePadButtons buttons,
         GamePadDPad dPad
)

Parameters

thumbSticks
Initial thumbstick state.
triggers
Initial trigger state.
buttons
Initial button state.
dPad
Initial directional pad state.

Expand image Remarks

Games normally use GetState to get the true gamepad state. This constructor is used instead to simulate gamepad input for passing within the game's own input subsystem.

Thumbstick state is different from the state indicated by the GamePadButtons.LeftStick Property or the GamePadButtons.RightStick Property. Thumbstick state refers to the position of the thumbstick, while the LeftStick or RightStick properties indicate if the stick is "clicked" in.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState Constructor (Vector2, Vector2, Single, Single, Buttons[])

GamePadState Constructor (Vector2, Vector2, Single, Single, Buttons[])
See Also
CollapseAll image

Initializes a new instance of the GamePadState class with the specified stick, trigger, and button values.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadState (
         Vector2 leftThumbStick,
         Vector2 rightThumbStick,
         float leftTrigger,
         float rightTrigger,
         params Buttons[] buttons
)

Parameters

leftThumbStick
Left stick value. Each axis is clamped between −1.0 and 1.0.
rightThumbStick
Right stick value. Each axis is clamped between −1.0 and 1.0.
leftTrigger
Left trigger value. This value is clamped between 0.0 and 1.0.
rightTrigger
Right trigger value. This value is clamped between 0.0 and 1.0.
buttons
Array or parameter list of Buttons to initialize as pressed.

Expand image Remarks

Games normally use GetState to get the true gamepad state. This constructor is used instead to simulate gamepad input for passing within the game's own input subsystem.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState Methods

GamePadState Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
Public Method | IsButtonDown | Determines whether specified input device buttons are pressed in this GamePadState.
Public Method | IsButtonUp | Determines whether specified input device buttons are up (not pressed) in this GamePadState.
 | op_Equality | Determines whether two GamePadState instances are equal.
 | op_Inequality | Determines whether two GamePadState instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamePadState Structure
Microsoft.Xna.Framework.Input Namespace


GamePadState.Equals Method

GamePadState.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.GetHashCode Method

GamePadState.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.IsButtonDown Method

GamePadState.IsButtonDown Method

Determines whether specified input device buttons are pressed in this GamePadState.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsButtonDown (
         Buttons button
)

Parameters

button
Buttons to query. Specify a single button, or combine multiple buttons using a bitwise OR operation.

Return Value

true if all specified buttons are pressed; false otherwise.

Expand image Remarks

For digital buttons (such as A, START, and right bumper) the return value indicates whether the button is pressed.

For analog inputs (triggers and thumbsticks), the return value indicates whether the input exceeds dead zone values. For example, a trigger will not be reported as pressed until it is pulled about 12% of its full range. IsButtonDown always uses the default dead zone processing mode, GamePadDeadZone.IndependentAxes.

If multiple buttons are specified (by combining them using the bitwise OR operator), then all must be pressed (or exceed dead zone values) in order for IsButtonDown to return true.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
GamePadState.IsButtonDown Method
GamePad.GetState Method
GamePadDeadZone

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.IsButtonUp Method

GamePadState.IsButtonUp Method

Determines whether specified input device buttons are up (not pressed) in this GamePadState.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsButtonUp (
         Buttons button
)

Parameters

button
Buttons to query. Specify a single button, or combine multiple buttons using a bitwise OR operation.

Return Value

true if any specified buttons are up; false otherwise.

Expand image Remarks

For digital buttons (such as A, START, and right bumper) the return value indicates whether the button is up (not pressed).

For analog inputs (triggers and thumbsticks), the return value indicates whether the input exceeds dead zone values. For example, a trigger will be reported as not pressed until it is pulled about 12% of its full range. IsButtonUp always uses the default dead zone processing mode, GamePadDeadZone.IndependentAxes.

If multiple buttons are specified (by combining them using the bitwise OR operator), IsButtonUp returns true if any of the specified buttons are not pressed (or do not exceed dead zone values).

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
GamePadState.IsButtonDown Method
GamePad.GetState Method
GamePadDeadZone

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.op_Equality Method

GamePadState.op_Equality Method

Determines whether two GamePadState instances are equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         GamePadState left,
         GamePadState right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the instances are equal; false otherwise.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.op_Inequality Method

GamePadState.op_Inequality Method

Determines whether two GamePadState instances are not equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         GamePadState left,
         GamePadState right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.ToString Method

GamePadState.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState Properties

GamePadState Properties

Expand image Public Properties

 | Name | Description
Public Property | Buttons | Returns a structure that identifies what buttons on the Xbox 360 controller are pressed.
Public Property | DPad | Returns a structure that identifies what directions of the directional pad on the Xbox 360 Controller are pressed.
Public Property | IsConnected | Indicates whether the Xbox 360 Controller is connected.
Public Property | PacketNumber | Gets the packet number associated with this state.
Public Property | ThumbSticks | Returns a structure that indicates the position of the Xbox 360 Controller sticks (thumbsticks).
Public Property | Triggers | Returns a structure that identifies the position of triggers on the Xbox 360 controller.

Expand image See Also

Reference

GamePadState Structure
Microsoft.Xna.Framework.Input Namespace


GamePadState.Buttons Property

GamePadState.Buttons Property

Returns a structure that identifies what buttons on the Xbox 360 controller are pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadButtons Buttons { get; }

Property Value

A structure that identifies buttons pressed on the controller.

Expand image Remarks

Best Practice

  • If your game allows the player to control acceleration using the Xbox 360 controller, you may check GameDefaults.AccelerateWithButtons to determine if the player prefers using the gamepad buttons or triggers to control acceleration.

  • If your game allows the player to control braking using the Xbox 360 controller, you may check GameDefaults.BrakeWithButtons to determine if the player prefers using the gamepad buttons or triggers to control braking.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

GameDefaults.AccelerateWithButtons Property
GameDefaults.BrakeWithButtons Property
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.DPad Property

GamePadState.DPad Property

Returns a structure that identifies what directions of the directional pad on the Xbox 360 Controller are pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadDPad DPad { get; }

Property Value

Structure that identifies what directional pad directions are pressed.

Expand image Remarks

Best Practice
Many games allow movement to be controlled with either the left thumbstick or the directional pad (d-pad). The left thumbstick may be accessed with GamePadState.ThumbSticks.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.IsConnected Property

GamePadState.IsConnected Property

Indicates whether the Xbox 360 Controller is connected.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsConnected { get; }

Property Value

true if the controller is connected; false otherwise.

Expand image Remarks

When calling GetState or GetCapabilities, check the returned structure's IsConnected property value. If the controller has been disconnected, this value will be false. When a controller is disconnected, values for its state and/or capabilities will not be valid. The controller will also not be able to receive new vibration settings.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.PacketNumber Property

GamePadState.PacketNumber Property

Gets the packet number associated with this state.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int PacketNumber { get; }

Property Value

The packet number associated with this state.

Expand image Remarks

You can use PacketNumber to determine whether input state has changed. If the value of PacketNumber remains the same between two sequential calls to GetState, then there has been no change in input.

Expand image See Also

Tasks

Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)

Concepts

Overview of User Input and Input Devices

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.ThumbSticks Property

GamePadState.ThumbSticks Property

Returns a structure that indicates the position of the Xbox 360 Controller sticks (thumbsticks).

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadThumbSticks ThumbSticks { get; }

Property Value

Structure that indicates the position of the sticks.

Expand image Remarks

Best Practice

You can check GameDefaults.MoveWithRightThumbStick to determine if the player prefers using the right or left thumbstick to control movement.

Many games allow movement to be controlled with either the left thumbstick or the directional pad (d-pad). The directional pad is available through GamePadState.DPad.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadState.Triggers Property

GamePadState.Triggers Property

Returns a structure that identifies the position of triggers on the Xbox 360 controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadTriggers Triggers { get; }

Property Value

Structure that identifies the position of the triggers.

Expand image Remarks

Best Practice

  • If your game allows the player to control acceleration using the Xbox 360 controller, you may check GameDefaults.AccelerateWithButtons to determine if the player prefers using the gamepad buttons or triggers to control acceleration.

  • If your game allows the player to control braking using the Xbox 360 controller, you may check GameDefaults.BrakeWithButtons to determine if the player prefers using the gamepad buttons or triggers to control braking.

Expand image See Also

Reference

GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadThumbSticks Structure

GamePadThumbSticks Structure

Structure that represents the position of left and right sticks (thumbsticks) on an Xbox 360 Controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct GamePadThumbSticks

Expand image Remarks

Best Practice
You can check GameDefaults.MoveWithRightThumbStick to determine if the player prefers using the right or left thumbstick to control movement.

Expand image See Also

Reference

GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadThumbSticks Members

GamePadThumbSticks Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the GamePadThumbSticks type.

Expand image Public Constructors

 | Name | Description
Public Method | GamePadThumbSticks | Initializes a new instance of the GamePadThumbSticks class.

Expand image Public Properties

 | Name | Description
Public Property | Left | Returns the position of the left Xbox 360 Controller stick (thumbstick) as a 2D vector.
Public Property | Right | Returns the position of the right Xbox 360 Controller stick (thumbstick) as a 2D vector.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two GamePadThumbSticks instances are equal.
 | op_Inequality | Determines whether two GamePadThumbSticks instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamePadThumbSticks Structure
Microsoft.Xna.Framework.Input Namespace


GamePadThumbSticks Constructor

GamePadThumbSticks Constructor

Initializes a new instance of the GamePadThumbSticks class.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadThumbSticks (
         Vector2 leftThumbstick,
         Vector2 rightThumbstick
)

Parameters

leftThumbstick
Left stick value. Each axis is clamped between −1.0 and 1.0.
rightThumbstick
Right stick value. Each axis is clamped between −1.0 and 1.0.

Expand image Remarks

Games normally use GetState to get the true gamepad state. This constructor is used instead to simulate gamepad input for passing within the game's own input subsystem.

Expand image See Also

Reference

GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadThumbSticks Methods

GamePadThumbSticks Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two GamePadThumbSticks instances are equal.
 | op_Inequality | Determines whether two GamePadThumbSticks instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamePadThumbSticks Structure
Microsoft.Xna.Framework.Input Namespace


GamePadThumbSticks.Equals Method

GamePadThumbSticks.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadThumbSticks.GetHashCode Method

GamePadThumbSticks.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadThumbSticks.op_Equality Method

GamePadThumbSticks.op_Equality Method

Determines whether two GamePadThumbSticks instances are equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         GamePadThumbSticks left,
         GamePadThumbSticks right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the instances are equal; false otherwise.

Expand image See Also

Reference

GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadThumbSticks.op_Inequality Method

GamePadThumbSticks.op_Inequality Method

Determines whether two GamePadThumbSticks instances are not equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         GamePadThumbSticks left,
         GamePadThumbSticks right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadThumbSticks.ToString Method

GamePadThumbSticks.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadThumbSticks Properties

GamePadThumbSticks Properties

Expand image Public Properties

 | Name | Description
Public Property | Left | Returns the position of the left Xbox 360 Controller stick (thumbstick) as a 2D vector.
Public Property | Right | Returns the position of the right Xbox 360 Controller stick (thumbstick) as a 2D vector.

Expand image See Also

Reference

GamePadThumbSticks Structure
Microsoft.Xna.Framework.Input Namespace


GamePadThumbSticks.Left Property

GamePadThumbSticks.Left Property
See Also Example
CollapseAll image

Returns the position of the left Xbox 360 Controller stick (thumbstick) as a 2D vector.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 Left { get; }

Property Value

Two-dimensional vector that identifies the position of the left stick. Each axis is represented as a floating-point value from −1.0 to 1.0.

Expand image Remarks

Best Practice
You can check GameDefaults.MoveWithRightThumbStick to determine if the player prefers using the right or left thumbstick to control movement.

Each of the thumbstick axis members is a signed value describing the position of the thumbstick. A value of 0 is centered. Negative values signify down or to the left. Positive values signify up or to the right. The controller typically does not generate thumbstick values within a dead zone, or marginal input region around the center position.

Expand image Example

if (GamePad.GetState( PlayerIndex.One ).ThumbSticks.Left.Y == 1.0f)
{
// Player one has pressed the left thumbstick up.
}

Expand image See Also

Reference

GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadThumbSticks.Right Property

GamePadThumbSticks.Right Property

Returns the position of the right Xbox 360 Controller stick (thumbstick) as a 2D vector.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 Right { get; }

Property Value

Two-dimensional vector that identifies the position of the right stick. Each axis is represented as a floating-point value from −1.0 to 1.0.

Expand image Remarks

Best Practice
You can check GameDefaults.MoveWithRightThumbStick to determine if the player prefers using the right or left thumbstick to control movement.

Expand image See Also

Reference

GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadTriggers Structure

GamePadTriggers Structure

Structure that defines the position of the left and right triggers on an Xbox 360 Controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct GamePadTriggers

Expand image Remarks

Best Practice

  • If your game allows the player to control acceleration using the Xbox 360 Controller, you may check GameDefaults.AccelerateWithButtons to determine if the player prefers using gamepad buttons or triggers to control acceleration.

  • If your game allows the player to control braking using the Xbox 360 Controller, you may check GameDefaults.BrakeWithButtons to determine if the player prefers using gamepad buttons or triggers to control braking.

Expand image See Also

Reference

GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadTriggers Members

GamePadTriggers Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the GamePadTriggers type.

Expand image Public Constructors

 | Name | Description
Public Method | GamePadTriggers | Initializes a new instance of the GamePadTriggers class.

Expand image Public Properties

 | Name | Description
Public Property | Left | Identifies the position of the left trigger on the Xbox 360 Controller.
Public Property | Right | Identifies the position of the right trigger on the Xbox 360 Controller.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two GamePadTriggers instances are equal.
 | op_Inequality | Determines whether two GamePadTriggers instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamePadTriggers Structure
Microsoft.Xna.Framework.Input Namespace


GamePadTriggers Constructor

GamePadTriggers Constructor

Initializes a new instance of the GamePadTriggers class.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GamePadTriggers (
         float leftTrigger,
         float rightTrigger
)

Parameters

leftTrigger
Left trigger value. This value is clamped between 0.0 and 1.0.
rightTrigger
Right trigger value. This value is clamped between 0.0 and 1.0.

Expand image Remarks

Games normally use GetState to get the true gamepad state. This constructor is used instead to simulate gamepad input for passing within the game's own input subsystem.

Expand image See Also

Reference

GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadTriggers Methods

GamePadTriggers Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two GamePadTriggers instances are equal.
 | op_Inequality | Determines whether two GamePadTriggers instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamePadTriggers Structure
Microsoft.Xna.Framework.Input Namespace


GamePadTriggers.Equals Method

GamePadTriggers.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadTriggers.GetHashCode Method

GamePadTriggers.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadTriggers.op_Equality Method

GamePadTriggers.op_Equality Method

Determines whether two GamePadTriggers instances are equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         GamePadTriggers left,
         GamePadTriggers right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the instances are equal; false otherwise.

Expand image See Also

Reference

GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadTriggers.op_Inequality Method

GamePadTriggers.op_Inequality Method

Determines whether two GamePadTriggers instances are not equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         GamePadTriggers left,
         GamePadTriggers right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadTriggers.ToString Method

GamePadTriggers.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadTriggers Properties

GamePadTriggers Properties

Expand image Public Properties

 | Name | Description
Public Property | Left | Identifies the position of the left trigger on the Xbox 360 Controller.
Public Property | Right | Identifies the position of the right trigger on the Xbox 360 Controller.

Expand image See Also

Reference

GamePadTriggers Structure
Microsoft.Xna.Framework.Input Namespace


GamePadTriggers.Left Property

GamePadTriggers.Left Property

Identifies the position of the left trigger on the Xbox 360 Controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Left { get; }

Property Value

Position of the left trigger, as a value between 0.0 and 1.0.

Expand image Remarks

Best Practice

  • If your game allows the player to control acceleration using the Xbox 360 controller, you may check GameDefaults.AccelerateWithButtons to determine if the player prefers using the gamepad buttons or triggers to control acceleration.

  • If your game allows the player to control braking using the Xbox 360 controller, you may check GameDefaults.BrakeWithButtons to determine if the player prefers using the gamepad buttons or triggers to control braking.

Expand image See Also

Reference

GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadTriggers.Right Property

GamePadTriggers.Right Property

Identifies the position of the right trigger on the Xbox 360 Controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Right { get; }

Property Value

Position of the right trigger, as a value between 0.0 and 1.0.

Expand image Remarks

Best Practice

  • If your game allows the player to control acceleration using the Xbox 360 controller, you may check GameDefaults.AccelerateWithButtons to determine if the player prefers using the gamepad buttons or triggers to control acceleration.

  • If your game allows the player to control braking using the Xbox 360 controller, you may check GameDefaults.BrakeWithButtons to determine if the player prefers using the gamepad buttons or triggers to control braking.

Expand image See Also

Reference

GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GamePadType Enumeration

GamePadType Enumeration

Describes the type of a specified Xbox 360 Controller.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum GamePadType

Expand image Members

Member name | Description
AlternateGuitar | Controller is an alternate guitar
ArcadeStick | Controller is an Arcade stick
BigButtonPad | Controller is a big button pad
DancePad | Controller is a dance pad
DrumKit | Controller is a drum kit
FlightStick | Controller is a flight stick
GamePad | Controller is the Xbox 360 Controller
Guitar | Controller is a guitar
Unknown | Controller is an unknown type
Wheel | Controller is a wheel

Expand image See Also

Reference

Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Keyboard Class

Keyboard Class
See Also Members
CollapseAll image

Allows retrieval of keystrokes from a keyboard input device.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static class Keyboard

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

Keyboard Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Keyboard Members

Keyboard Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the Keyboard type.

Expand image Public Methods

Name | Description
GetState | Overloaded. Returns the current keyboard or Chatpad state.

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

Keyboard Class
Microsoft.Xna.Framework.Input Namespace


Keyboard Methods

Keyboard Methods

Expand image Public Methods

Name | Description
GetState | Overloaded. Returns the current keyboard or Chatpad state.

Expand image See Also

Reference

Keyboard Class
Microsoft.Xna.Framework.Input Namespace


Keyboard.GetState Method

Keyboard.GetState Method

Returns the current keyboard or Chatpad state.

Expand image Overload List

Name | Description
Keyboard.GetState () | Returns the current keyboard state.
Keyboard.GetState (PlayerIndex) | Returns the current Chatpad state for the specified player.

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

Keyboard Class
Keyboard Members
Microsoft.Xna.Framework.Input Namespace


Keyboard.GetState Method ()

Keyboard.GetState Method ()
See Also
CollapseAll image

Returns the current keyboard state.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static KeyboardState GetState ()

Return Value

Current keyboard state.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | An invalid operation occurred when querying the keyboard state.

Expand image Remarks

This method queries an attached USB keyboard. To query a Chatpad instead, use Keyboard.GetState (PlayerIndex).

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

Keyboard Class
Keyboard Members
Microsoft.Xna.Framework.Input Namespace
Keyboard.GetState Method

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Keyboard.GetState Method (PlayerIndex)

Keyboard.GetState Method (PlayerIndex)
See Also
CollapseAll image

Returns the current Chatpad state for the specified player.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static KeyboardState GetState (
         PlayerIndex playerIndex
)

Parameters

playerIndex
Player index of the Chatpad to query.

Return Value

Current Chatpad state.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | An invalid operation occurred when querying the Chatpad state.

Expand image Remarks

Each player can have his or her own Chatpad, which is queried as a keyboard. To query an attached USB keyboard instead, use the GetState method that does not require a player index.

This method works on Xbox 360 platforms only. Windows does not include driver support for the ChatPad.

This method is included in the assemblies for Windows, but it is effectively a null function on that platform. Calls to Keyboard.GetState(playerIndex) from a Windows application are accepted, but will never return a ChatPad state change (key press or release).

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

Keyboard Class
Keyboard Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyboardState Structure

KeyboardState Structure

Represents a state of keystrokes recorded by a keyboard input device.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct KeyboardState

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyboardState Members

KeyboardState Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the KeyboardState type.

Expand image Public Constructors

 | Name | Description
Public Method | KeyboardState | Initializes a new instance of the KeyboardState class.

Expand image Public Properties

 | Name | Description
Public Property | Item | Returns the state of a particular key.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetPressedKeys | Gets an array of values that correspond to the keyboard keys that are currently being pressed.
Public Method | GetType | (Inherited from Object.)
Public Method | IsKeyDown | Returns whether a specified key is currently being pressed.
Public Method | IsKeyUp | Returns whether a specified key is currently not pressed.
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

KeyboardState Structure
Microsoft.Xna.Framework.Input Namespace


KeyboardState Constructor

KeyboardState Constructor

Initializes a new instance of the KeyboardState class.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public KeyboardState (
         params Keys[] keys
)

Parameters

keys
Array or parameter list of Keys to initialize as pressed.

Expand image Remarks

Games normally use GetState to get the true keyboard state. This constructor is used instead to simulate keyboard input for passing within the game's own input subsystem.

Expand image See Also

Reference

KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyboardState Methods

KeyboardState Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetPressedKeys | Gets an array of values that correspond to the keyboard keys that are currently being pressed.
Public Method | GetType | (Inherited from Object.)
Public Method | IsKeyDown | Returns whether a specified key is currently being pressed.
Public Method | IsKeyUp | Returns whether a specified key is currently not pressed.
 | op_Equality | Compares two objects to determine whether they are the same.
 | op_Inequality | Compares two objects to determine whether they are different.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

KeyboardState Structure
Microsoft.Xna.Framework.Input Namespace


KeyboardState.Equals Method

KeyboardState.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to compare this object to.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyboardState.GetHashCode Method

KeyboardState.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyboardState.GetPressedKeys Method

KeyboardState.GetPressedKeys Method

Gets an array of values that correspond to the keyboard keys that are currently being pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Keys[] GetPressedKeys ()

Return Value

The keys that are currently pressed.

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyboardState.IsKeyDown Method

KeyboardState.IsKeyDown Method

Returns whether a specified key is currently being pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsKeyDown (
         Keys key
)

Parameters

key
Enumerated value that specifies the key to query.

Return Value

true if the key specified by key is being held down; false otherwise.

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyboardState.IsKeyUp Method

KeyboardState.IsKeyUp Method

Returns whether a specified key is currently not pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsKeyUp (
         Keys key
)

Parameters

key
Enumerated value that specifies the key to query.

Return Value

true if the key specified by key is not pressed; false otherwise.

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyboardState.op_Equality Method

KeyboardState.op_Equality Method

Compares two objects to determine whether they are the same.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         KeyboardState a,
         KeyboardState b
)

Parameters

a
Object to the left of the equality operator.
b
Object to the right of the equality operator.

Return Value

true if the objects are the same; false otherwise.

Expand image See Also

Reference

KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyboardState.op_Inequality Method

KeyboardState.op_Inequality Method

Compares two objects to determine whether they are different.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         KeyboardState a,
         KeyboardState b
)

Parameters

a
Object to the left of the inequality operator.
b
Object to the right of the inequality operator.

Return Value

true if the objects are different; false otherwise.

Expand image See Also

Reference

KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyboardState Properties

KeyboardState Properties

Expand image Public Properties

 | Name | Description
Public Property | Item | Returns the state of a particular key.

Expand image See Also

Reference

KeyboardState Structure
Microsoft.Xna.Framework.Input Namespace


KeyboardState.Item Property

KeyboardState.Item Property

Returns the state of a particular key.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public KeyState this [
         Keys key
] { get; }

Property Value

The state of the key specified by key.

Expand image See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Keys Enumeration

Keys Enumeration

Identifies a particular key on a keyboard.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum Keys

Expand image Members

Member name | Description
A | A key
Add | Add key
Apps | Applications key
Attn | Attn key
B | B key
Back | BACKSPACE key
BrowserBack | Windows 2000/XP: Browser Back key
BrowserFavorites | Windows 2000/XP: Browser Favorites key
BrowserForward | Windows 2000/XP: Browser Forward key
BrowserHome | Windows 2000/XP: Browser Start and Home key
BrowserRefresh | Windows 2000/XP: Browser Refresh key
BrowserSearch | Windows 2000/XP: Browser Search key
BrowserStop | Windows 2000/XP: Browser Stop key
C | C key
CapsLock | CAPS LOCK key
ChatPadGreen | Green ChatPad key
ChatPadOrange | Orange ChatPad key
Crsel | CrSel key
D | D key
D0 | Used for miscellaneous characters; it can vary by keyboard.
D1 | Used for miscellaneous characters; it can vary by keyboard.
D2 | Used for miscellaneous characters; it can vary by keyboard.
D3 | Used for miscellaneous characters; it can vary by keyboard.
D4 | Used for miscellaneous characters; it can vary by keyboard.
D5 | Used for miscellaneous characters; it can vary by keyboard.
D6 | Used for miscellaneous characters; it can vary by keyboard.
D7 | Used for miscellaneous characters; it can vary by keyboard.
D8 | Used for miscellaneous characters; it can vary by keyboard.
D9 | Used for miscellaneous characters; it can vary by keyboard.
Decimal | Decimal key
Delete | DEL key
Divide | Divide key
Down | DOWN ARROW key
E | E key
End | END key
Enter | ENTER key
EraseEof | Erase EOF key
Escape | ESC key
Execute | EXECUTE key
Exsel | ExSel key
F | F key
F1 | F1 key
F10 | F10 key
F11 | F11 key
F12 | F12 key
F13 | F13 key
F14 | F14 key
F15 | F15 key
F16 | F16 key
F17 | F17 key
F18 | F18 key
F19 | F19 key
F2 | F2 key
F20 | F20 key
F21 | F21 key
F22 | F22 key
F23 | F23 key
F24 | F24 key
F3 | F3 key
F4 | F4 key
F5 | F5 key
F6 | F6 key
F7 | F7 key
F8 | F8 key
F9 | F9 key
G | G key
H | H key
Help | HELP key
Home | HOME key
I | I key
ImeConvert | IME Convert key
ImeNoConvert | IME NoConvert key
Insert | INS key
J | J key
K | K key
Kana | Kana key on Japanese keyboards
Kanji | Kanji key on Japanese keyboards
L | L key
LaunchApplication1 | Windows 2000/XP: Start Application 1 key
LaunchApplication2 | Windows 2000/XP: Start Application 2 key
LaunchMail | Windows 2000/XP: Start Mail key
Left | LEFT ARROW key
LeftAlt | Left ALT key
LeftControl | Left CONTROL key
LeftShift | Left SHIFT key
LeftWindows | Left Windows key
M | M key
MediaNextTrack | Windows 2000/XP: Next Track key
MediaPlayPause | Windows 2000/XP: Play/Pause Media key
MediaPreviousTrack | Windows 2000/XP: Previous Track key
MediaStop | Windows 2000/XP: Stop Media key
Multiply | Multiply key
N | N key
None | Reserved
NumLock | NUM LOCK key
NumPad0 | Numeric keypad 0 key
NumPad1 | Numeric keypad 1 key
NumPad2 | Numeric keypad 2 key
NumPad3 | Numeric keypad 3 key
NumPad4 | Numeric keypad 4 key
NumPad5 | Numeric keypad 5 key
NumPad6 | Numeric keypad 6 key
NumPad7 | Numeric keypad 7 key
NumPad8 | Numeric keypad 8 key
NumPad9 | Numeric keypad 9 key
O | O key
Oem8 | Used for miscellaneous characters; it can vary by keyboard.
OemAuto | OEM Auto key
OemBackslash | Windows 2000/XP: The OEM angle bracket or backslash key on the RT 102 key keyboard
OemClear | CLEAR key
OemCloseBrackets | Windows 2000/XP: The OEM close bracket key on a US standard keyboard
OemComma | Windows 2000/XP: For any country/region, the ',' key
OemCopy | OEM Copy key
OemEnlW | OEM Enlarge Window key
OemMinus | Windows 2000/XP: For any country/region, the '-' key
OemOpenBrackets | Windows 2000/XP: The OEM open bracket key on a US standard keyboard
OemPeriod | Windows 2000/XP: For any country/region, the '.' key
OemPipe | Windows 2000/XP: The OEM pipe key on a US standard keyboard
OemPlus | Windows 2000/XP: For any country/region, the '+' key
OemQuestion | Windows 2000/XP: The OEM question mark key on a US standard keyboard
OemQuotes | Windows 2000/XP: The OEM singled/double quote key on a US standard keyboard
OemSemicolon | Windows 2000/XP: The OEM Semicolon key on a US standard keyboard
OemTilde | Windows 2000/XP: The OEM tilde key on a US standard keyboard
P | P key
Pa1 | PA1 key
PageDown | PAGE DOWN key
PageUp | PAGE UP key
Pause | PAUSE key
Play | Play key
Print | PRINT key
PrintScreen | PRINT SCREEN key
ProcessKey | Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
Q | Q key
R | R key
Right | RIGHT ARROW key
RightAlt | Right ALT key
RightControl | Right CONTROL key
RightShift | Right SHIFT key
RightWindows | Right Windows key
S | S key
Scroll | SCROLL LOCK key
Select | SELECT key
SelectMedia | Windows 2000/XP: Select Media key
Separator | Separator key
Sleep | Computer Sleep key
Space | SPACEBAR
Subtract | Subtract key
T | T key
Tab | TAB key
U | U key
Up | UP ARROW key
V | V key
VolumeDown | Windows 2000/XP: Volume Down key
VolumeMute | Windows 2000/XP: Volume Mute key
VolumeUp | Windows 2000/XP: Volume Up key
W | W key
X | X key
Y | Y key
Z | Z key
Zoom | Zoom key

Expand image See Also

Reference

Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


KeyState Enumeration

KeyState Enumeration

Identifies the state of a keyboard key.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum KeyState

Expand image Members

Member name | Description
Down | Key is pressed.
Up | Key is released.

Expand image See Also

Reference

Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Mouse Class

Mouse Class
See Also Members
CollapseAll image

Allows retrieval of position and button clicks from a mouse input device.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static class Mouse
Xbox 360 Specific Information

Mouse functionality is not supported, but mouse-related code will compile and execute. Values returned by these calls are inaccurate.

Expand image See Also

Tasks

Getting the Mouse Position (Windows, Windows Phone)

Concepts

Overview of User Input and Input Devices

Reference

Mouse Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Mouse Members

Mouse Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Mouse type.

Expand image Public Properties

Name | Description
WindowHandle | Gets or sets the window used for mouse processing. Mouse coordinates returned by GetState are relative to the upper-left corner of this window.

Expand image Public Methods

Name | Description
GetState | Gets the current state of the mouse, including mouse position and buttons pressed.
SetPosition | Sets the position of the mouse cursor relative to the upper-left corner of the window.

Expand image See Also

Tasks

Getting the Mouse Position (Windows, Windows Phone)

Concepts

Overview of User Input and Input Devices

Reference

Mouse Class
Microsoft.Xna.Framework.Input Namespace


Mouse Methods

Mouse Methods

Expand image Public Methods

Name | Description
GetState | Gets the current state of the mouse, including mouse position and buttons pressed.
SetPosition | Sets the position of the mouse cursor relative to the upper-left corner of the window.

Expand image See Also

Reference

Mouse Class
Microsoft.Xna.Framework.Input Namespace


Mouse.GetState Method

Mouse.GetState Method

Gets the current state of the mouse, including mouse position and buttons pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static MouseState GetState ()

Return Value

Current state of the mouse.

Expand image See Also

Tasks

Getting the Mouse Position (Windows, Windows Phone)

Concepts

Overview of User Input and Input Devices

Reference

Mouse Class
Mouse Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Mouse.SetPosition Method

Mouse.SetPosition Method

Sets the position of the mouse cursor relative to the upper-left corner of the window.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void SetPosition (
         int x,
         int y
)

Parameters

x
The horizontal position of the mouse cursor, relative to the left edge of the game window.
y
The vertical position of the mouse cursor, relative to the upper edge of the game window.

Expand image Remarks

When using this method to take relative input, such as in a first-person game, set the position of the mouse to the center of your game window each frame. This will allow you to read mouse movement on both axes with the greatest amount of granularity.

Expand image See Also

Reference

Mouse Class
Mouse Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Mouse Properties

Mouse Properties

Expand image Public Properties

Name | Description
WindowHandle | Gets or sets the window used for mouse processing. Mouse coordinates returned by GetState are relative to the upper-left corner of this window.

Expand image See Also

Reference

Mouse Class
Microsoft.Xna.Framework.Input Namespace


Mouse.WindowHandle Property

Mouse.WindowHandle Property

Gets or sets the window used for mouse processing. Mouse coordinates returned by GetState are relative to the upper-left corner of this window.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static IntPtr WindowHandle { get; set; }

Property Value

Handle to a window.

Expand image Remarks

By default, this property is set to the game window (Game.Window Property). To select a different window as the coordinate reference, set WindowHandle to that window.

If the mouse is above or to the left of the reference window, the returned coordinates are negative. If the mouse is below or to the right of the reference window, the returned coordinates are greater than the window's client area.

Expand image See Also

Tasks

Getting the Mouse Position (Windows, Windows Phone)

Concepts

Overview of User Input and Input Devices

Reference

Mouse Class
Mouse Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState Structure

MouseState Structure

Represents the state of a mouse input device, including mouse cursor position and buttons pressed.
Xbox 360 Specific Information
The state of any mouse button is always ButtonState.Released, and the current mouse position and scrollwheel value are always 0.
Xbox 360 Specific Information
The state of any mouse button is always ButtonState.Released and the current mouse position and scrollwheel values are always 0.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[SerializableAttribute]
public struct MouseState

Expand image See Also

Tasks

Getting the Mouse Position (Windows, Windows Phone)

Concepts

Overview of User Input and Input Devices

Reference

MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState Members

MouseState Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the MouseState type.

Expand image Public Constructors

 | Name | Description
Public Method | MouseState | Initializes a new instance of the MouseState class.

Expand image Public Properties

 | Name | Description
Public Property | LeftButton | Returns the state of the left mouse button.
Public Property | MiddleButton | Returns the state of the middle mouse button.
Public Property | RightButton | Returns the state of the right mouse button.
Public Property | ScrollWheelValue | Gets the cumulative mouse scroll wheel value since the game was started.
Public Property | X | Specifies the horizontal position of the mouse cursor.
Public Property | XButton1 | Returns the state of XBUTTON1.
Public Property | XButton2 | Returns the state of XBUTTON2.
Public Property | Y | Specifies the vertical position of the mouse cursor.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two MouseState instances are equal.
 | op_Inequality | Determines whether two MouseState instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Getting the Mouse Position (Windows, Windows Phone)

Concepts

Overview of User Input and Input Devices

Reference

MouseState Structure
Microsoft.Xna.Framework.Input Namespace


MouseState Constructor

MouseState Constructor

Initializes a new instance of the MouseState class.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public MouseState (
         int x,
         int y,
         int scrollWheel,
         ButtonState leftButton,
         ButtonState middleButton,
         ButtonState rightButton,
         ButtonState xButton1,
         ButtonState xButton2
)

Parameters

x
Horizontal mouse position.
y
Vertical mouse position.
scrollWheel
Mouse scroll wheel value.
leftButton
Left mouse button state.
middleButton
Middle mouse button state.
rightButton
Right mouse button state.
xButton1
XBUTTON1 state.
xButton2
XBUTTON2 state.

Expand image Remarks

Games normally use GetState to get the true mouse state. This constructor is used instead to simulate mouse input for passing within the game's own input subsystem.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState Methods

MouseState Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Returns a value that indicates whether the current instance is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two MouseState instances are equal.
 | op_Inequality | Determines whether two MouseState instances are not equal.
Public Method | ToString | Retrieves a string representation of this object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MouseState Structure
Microsoft.Xna.Framework.Input Namespace


MouseState.Equals Method

MouseState.Equals Method

Returns a value that indicates whether the current instance is equal to a specified object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object with which to make the comparison.

Return Value

true if the current instance is equal to the specified object; false otherwise.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.GetHashCode Method

MouseState.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.op_Equality Method

MouseState.op_Equality Method

Determines whether two MouseState instances are equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         MouseState left,
         MouseState right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the instances are equal; false otherwise.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.op_Inequality Method

MouseState.op_Inequality Method

Determines whether two MouseState instances are not equal.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         MouseState left,
         MouseState right
)

Parameters

left
Object on the left of the equal sign.
right
Object on the right of the equal sign.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.ToString Method

MouseState.ToString Method

Retrieves a string representation of this object.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState Properties

MouseState Properties

Expand image Public Properties

 | Name | Description
Public Property | LeftButton | Returns the state of the left mouse button.
Public Property | MiddleButton | Returns the state of the middle mouse button.
Public Property | RightButton | Returns the state of the right mouse button.
Public Property | ScrollWheelValue | Gets the cumulative mouse scroll wheel value since the game was started.
Public Property | X | Specifies the horizontal position of the mouse cursor.
Public Property | XButton1 | Returns the state of XBUTTON1.
Public Property | XButton2 | Returns the state of XBUTTON2.
Public Property | Y | Specifies the vertical position of the mouse cursor.

Expand image See Also

Reference

MouseState Structure
Microsoft.Xna.Framework.Input Namespace


MouseState.LeftButton Property

MouseState.LeftButton Property

Returns the state of the left mouse button.
Xbox 360 Specific Information
The value of this property is always ButtonState.Released.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState LeftButton { get; }

Property Value

State of the left mouse button.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.MiddleButton Property

MouseState.MiddleButton Property

Returns the state of the middle mouse button.
Xbox 360 Specific Information
The value of this property is always ButtonState.Released.
Zune Specific Information
The value of this property is always ButtonState.Released.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState MiddleButton { get; }

Property Value

State of the middle mouse button.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.RightButton Property

MouseState.RightButton Property

Returns the state of the right mouse button.
Xbox 360 Specific Information
The value of this property is always ButtonState.Released.
Zune Specific Information
The value of this property is always ButtonState.Released.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState RightButton { get; }

Property Value

State of the right mouse button.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.ScrollWheelValue Property

MouseState.ScrollWheelValue Property

Gets the cumulative mouse scroll wheel value since the game was started.
Xbox 360 Specific Information
The value of this property is always 0.
Zune Specific Information
The value of this property is always 0.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int ScrollWheelValue { get; }

Property Value

The scroll wheel value.

Expand image Remarks

Unlike standard Windows and WinForms mouse messages, which report a relative value for the scroll wheel, XNA reports the total scroll wheel value accumulated over the length of a game's execution. To process a wheel movement, you must compare the previous frame's wheel value to the current wheel value.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.X Property

MouseState.X Property

Specifies the horizontal position of the mouse cursor.
Xbox 360 Specific Information
The value of this property is always 0.
Zune Specific Information
The value of this property is always 0.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int X { get; }

Property Value

Horizontal position of the mouse cursor in relation to the upper-left corner of the game window.

Expand image Remarks

If the mouse is to the left of the client area (the inside portion of the game window, excluding the borders), the returned coordinate is negative. If the mouse is to the right of the client area, the returned coordinate is greater than the window's client area width.

Expand image See Also

Tasks

Getting the Mouse Position (Windows, Windows Phone)

Concepts

Overview of User Input and Input Devices

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.XButton1 Property

MouseState.XButton1 Property

Returns the state of XBUTTON1.
Xbox 360 Specific Information
The value of this property is always ButtonState.Released.
Zune Specific Information
The value of this property is always ButtonState.Released.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState XButton1 { get; }

Property Value

The state of XBUTTON1.

Expand image Remarks

XBUTTON1 and XBUTTON2 are additional buttons used on many mouse devices, often for forward and backward navigation in Web browsers. They return the same data as standard mouse buttons.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.XButton2 Property

MouseState.XButton2 Property

Returns the state of XBUTTON2.
Xbox 360 Specific Information
The value of this property is always ButtonState.Released.
Zune Specific Information
The value of this property is always ButtonState.Released.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ButtonState XButton2 { get; }

Property Value

The state of XBUTTON2.

Expand image Remarks

XBUTTON1 and XBUTTON2 are additional buttons used on many mouse devices, often for forward and backward navigation in Web browsers. They return the same data as standard mouse buttons.

Expand image See Also

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MouseState.Y Property

MouseState.Y Property

Specifies the vertical position of the mouse cursor.
Xbox 360 Specific Information
The value of this property is always 0.
Zune Specific Information
The value of this property is always 0.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Y { get; }

Property Value

Vertical position of the mouse cursor in relation to the upper-left corner of the game window.

Expand image Remarks

If the mouse is above the client area (the inside portion of the game window, excluding the borders), the returned coordinate is negative. If the mouse is below the client area, the returned coordinate is greater than the window's client area height.

Expand image See Also

Tasks

Getting the Mouse Position (Windows, Windows Phone)

Concepts

Overview of User Input and Input Devices

Reference

MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Input.Touch Namespace

Microsoft.Xna.Framework.Input.Touch Namespace

Contains classes that enable access to touch-based input on devices that support it.

Expand image Classes

 | Name | Description
Public Class | TouchPanel | Provides methods for retrieving touch panel device information.

Expand image Structures

 | Name | Description
Public Structure | GestureSample | A representation of data from a multitouch gesture over a span of time.
Public Structure | TouchCollection | Provides methods and properties for accessing state information for the touch screen of a touch-enabled device.
Public Structure | TouchCollection.Enumerator | Provides the ability to iterate through the touch locations in a TouchCollection.
Public Structure | TouchLocation | Provides methods and properties for interacting with a touch location on a touch screen device.
Public Structure | TouchPanelCapabilities | Provides access to information about the capabilities of the touch input device.

Expand image Enumerations

 | Name | Description
Public Enumeration | GestureType | Contains values that represent different multitouch gestures that can be detected by TouchPanel.ReadGesture.
Public Enumeration | TouchLocationState | Defines the possible states of a touch location.


GestureSample Structure

GestureSample Structure

A representation of data from a multitouch gesture over a span of time.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct GestureSample

Expand image See Also

Reference

GestureSample Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GestureSample Members

GestureSample Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the GestureSample type.

Expand image Public Properties

 | Name | Description
Public Property | Delta | Holds delta information about the first touchpoint in a multitouch gesture.
Public Property | Delta2 | Holds delta information about the second touchpoint in a multitouch gesture.
Public Property | GestureType | The type of gesture in a multitouch gesture sample.
Public Property | Position | Holds the current position of the first touchpoint in this gesture sample.
Public Property | Position2 | Holds the current position of the the second touchpoint in this gesture sample.
Public Property | Timestamp | Holds the starting time for this touch gesture sample.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GestureSample Structure
Microsoft.Xna.Framework.Input.Touch Namespace


GestureSample Methods

GestureSample Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GestureSample Structure
Microsoft.Xna.Framework.Input.Touch Namespace


GestureSample Properties

GestureSample Properties

Expand image Public Properties

 | Name | Description
Public Property | Delta | Holds delta information about the first touchpoint in a multitouch gesture.
Public Property | Delta2 | Holds delta information about the second touchpoint in a multitouch gesture.
Public Property | GestureType | The type of gesture in a multitouch gesture sample.
Public Property | Position | Holds the current position of the first touchpoint in this gesture sample.
Public Property | Position2 | Holds the current position of the the second touchpoint in this gesture sample.
Public Property | Timestamp | Holds the starting time for this touch gesture sample.

Expand image See Also

Reference

GestureSample Structure
Microsoft.Xna.Framework.Input.Touch Namespace


GestureSample.Delta Property

GestureSample.Delta Property

Holds delta information about the first touchpoint in a multitouch gesture.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 Delta { get; }

Property Value

A vector that represents the difference between the location of the first touchpoint provided by this sample and the last sample with the same GestureType.

Expand image See Also

Reference

GestureSample Structure
GestureSample Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GestureSample.Delta2 Property

GestureSample.Delta2 Property

Holds delta information about the second touchpoint in a multitouch gesture.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 Delta2 { get; }

Property Value

A vector representing the difference between the location of the second touchpoint provided by this sample and the last sample with the same GestureType.

Expand image See Also

Reference

GestureSample Structure
GestureSample Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GestureSample.GestureType Property

GestureSample.GestureType Property

The type of gesture in a multitouch gesture sample.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GestureType GestureType { get; }

Property Value

The gesture type represented by this sample data.

Expand image See Also

Reference

GestureSample Structure
GestureSample Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GestureSample.Position Property

GestureSample.Position Property

Holds the current position of the first touchpoint in this gesture sample.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 Position { get; }

Property Value

A vector representing the current position of the first touchpoint in this gesture sample.

Expand image See Also

Reference

GestureSample Structure
GestureSample Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GestureSample.Position2 Property

GestureSample.Position2 Property

Holds the current position of the the second touchpoint in this gesture sample.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 Position2 { get; }

Property Value

A vector that represents the current position of the the second touchpoint in this gesture sample.

Remarks

This data is only valid for a Pinch gesture, currently the only gesture that tracks more than one finger.

Expand image See Also

Reference

GestureSample Structure
GestureSample Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GestureSample.Timestamp Property

GestureSample.Timestamp Property

Holds the starting time for this touch gesture sample.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TimeSpan Timestamp { get; }

Property Value

The starting time for this gesture sample.

Expand image Remarks

The Timestamp is useful primarily for determining the difference between two gestures. It is not related to the game time.

Expand image See Also

Reference

GestureSample Structure
GestureSample Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GestureType Enumeration

GestureType Enumeration

Contains values that represent different multitouch gestures that can be detected by TouchPanel.ReadGesture.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[FlagsAttribute]
public enum GestureType

Expand image Members

Member name | Description
None | Represents no gestures.
Tap | The user briefly touched a single point on the screen.
DoubleTap | The user tapped the screen twice in quick succession. This always is preceded by a Tap gesture. If the time between taps is too great to be considered a DoubleTap, two Tap gestures will be generated instead.
Hold | The user touched a single point on the screen for approximately one second. This is a single event, and not continuously generated while the user is holding the touchpoint.
HorizontalDrag | The user touched the screen, and then performed a horizontal (left to right or right to left) gesture.
VerticalDrag | The user touched the screen, and then performed a vertical (top to bottom or bottom to top) gesture.
FreeDrag | The user touched the screen, and then performed a free-form drag gesture.
Pinch | The user touched two points on the screen, and then converged or diverged them. Pinch behaves like a two-finger drag. When this gesture is enabled, it takes precedence over drag gestures while two fingers are down.
Flick | The user performed a touch combined with a quick swipe of the screen. Flicks are positionless. The velocity of the flick can be retrieved by reading the Delta member of GestureSample.
DragComplete | A drag gesture (VerticalDrag, HorizontalDrag, or FreeDrag) was completed. This signals only completion. No position or delta data is valid for this sample.
PinchComplete | A pinch operation was completed. This signals only completion. No position or delta data is valid for this sample.

Expand image Remarks

These values can be combined when reading them from, or writing them to, TouchPanel.EnabledGestures.

Expand image See Also

Tasks

Detecting Gestures on a Multitouch Screen (Windows Phone)
Working with Touch Input (Windows Phone)

Reference

TouchPanel.ReadGesture Method
TouchPanel.IsGestureAvailable Property
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection Structure

TouchCollection Structure

Provides methods and properties for accessing state information for the touch screen of a touch-enabled device.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct TouchCollection : IList<TouchLocation>, ICollection<TouchLocation>, IEnumerable<TouchLocation>, IEnumerable

Expand image See Also

Tasks

Working with Touch Input (Windows Phone)

Reference

TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection Members

TouchCollection Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the TouchCollection type.

Expand image Public Constructors

 | Name | Description
Public Method | TouchCollection | Initializes a new instance of the TouchCollection structure with a set of touch locations.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the current number of touch locations for the touch screen.
Public Property | IsConnected | Indicates if the touch screen is available for use.
Public Property | IsReadOnly | Determines if the touch location array is read-only.
Public Property | Item | Gets or sets the information of the specified touch location.

Expand image Public Methods

 | Name | Description
Public Method | Add | Adds a TouchLocation to the collection.
Public Method | Clear | Removes all TouchLocation objects from the collection.
Public Method | Contains | Checks if the current touch collection contains the specified touch location.
Public Method | CopyTo | Copies the touch location to the collection at the specified index.
Public Method | Equals | (Inherited from ValueType.)
Public Method | FindById | Retrieves the touch location matching the specified ID.
Public Method | GetEnumerator | Returns an enumerator that iterates through the TouchCollection.
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Determines the index of a TouchLocation in the TouchCollection.
Public Method | Insert | Inserts a new TouchLocation into the TouchCollection at a specified index.
Public Method | Remove | Removes the specified TouchLocation from the TouchCollection.
Public Method | RemoveAt | Removes a TouchLocation at the specified index in the TouchCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the TouchCollection.

Expand image See Also

Reference

TouchCollection Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchCollection Constructor

TouchCollection Constructor

Initializes a new instance of the TouchCollection structure with a set of touch locations.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TouchCollection (
         TouchLocation[] touches
)

Parameters

touches
Array of touch locations.

Expand image See Also

Tasks

Working with Touch Input (Windows Phone)

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection Methods

TouchCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | Adds a TouchLocation to the collection.
Public Method | Clear | Removes all TouchLocation objects from the collection.
Public Method | Contains | Checks if the current touch collection contains the specified touch location.
Public Method | CopyTo | Copies the touch location to the collection at the specified index.
Public Method | Equals | (Inherited from ValueType.)
Public Method | FindById | Retrieves the touch location matching the specified ID.
Public Method | GetEnumerator | Returns an enumerator that iterates through the TouchCollection.
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Determines the index of a TouchLocation in the TouchCollection.
Public Method | Insert | Inserts a new TouchLocation into the TouchCollection at a specified index.
Public Method | Remove | Removes the specified TouchLocation from the TouchCollection.
Public Method | RemoveAt | Removes a TouchLocation at the specified index in the TouchCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the TouchCollection.

Expand image See Also

Reference

TouchCollection Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchCollection.Add Method

TouchCollection.Add Method

Adds a TouchLocation to the collection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Add (
         TouchLocation item
)

Parameters

item
TouchLocation to add.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.Clear Method

TouchCollection.Clear Method

Removes all TouchLocation objects from the collection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Clear ()

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.Contains Method

TouchCollection.Contains Method

Checks if the current touch collection contains the specified touch location.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Contains (
         TouchLocation item
)

Parameters

item
Touch location to be checked against the current collection.

Return Value

The value is true if the item is present in the collection; otherwise it is false.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.CopyTo Method

TouchCollection.CopyTo Method

Copies the touch location to the collection at the specified index.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void CopyTo (
         TouchLocation[] array,
         int arrayIndex
)

Parameters

array
Array receiving the copied touch location.
arrayIndex
Target index of the collection.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.FindById Method

TouchCollection.FindById Method

Retrieves the touch location matching the specified ID.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool FindById (
         int id,
         out TouchLocation touchLocation
)

Parameters

id
ID of touch location sought.
touchLocation
[OutAttribute] Touch location item matching the specified ID.

Return Value

The return value is true if the item was found; otherwise it is false.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.GetEnumerator Method

TouchCollection.GetEnumerator Method

Returns an enumerator that iterates through the TouchCollection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Enumerator GetEnumerator ()

Return Value

An TouchCollection.Enumerator for the touch collection.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.IndexOf Method

TouchCollection.IndexOf Method

Determines the index of a TouchLocation in the TouchCollection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int IndexOf (
         TouchLocation item
)

Parameters

item
TouchLocation to locate in the collection.

Return Value

The index of the specified touch location; -1 if the touch location could not be found.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.Insert Method

TouchCollection.Insert Method

Inserts a new TouchLocation into the TouchCollection at a specified index.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Insert (
         int index,
         TouchLocation item
)

Parameters

index
Index in the touch collection for the new item.
item
TouchLocation to be inserted.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.Remove Method

TouchCollection.Remove Method

Removes the specified TouchLocation from the TouchCollection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Remove (
         TouchLocation item
)

Parameters

item
TouchLocation to be removed.

Return Value

The return value is true if the item was successfully removed; otherwise it is false.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.RemoveAt Method

TouchCollection.RemoveAt Method

Removes a TouchLocation at the specified index in the TouchCollection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void RemoveAt (
         int index
)

Parameters

index
Index of the TouchLocation to remove.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the TouchCollection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

An IEnumerator for the touch collection.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection Properties

TouchCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the current number of touch locations for the touch screen.
Public Property | IsConnected | Indicates if the touch screen is available for use.
Public Property | IsReadOnly | Determines if the touch location array is read-only.
Public Property | Item | Gets or sets the information of the specified touch location.

Expand image See Also

Reference

TouchCollection Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchCollection.Count Property

TouchCollection.Count Property

Gets the current number of touch locations for the touch screen.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of current locations. Eight is the maximum number of trackable locations.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.IsConnected Property

TouchCollection.IsConnected Property

Indicates if the touch screen is available for use.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsConnected { get; }

Property Value

The value is true if the touch screen is available; otherwise it is false.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.IsReadOnly Property

TouchCollection.IsReadOnly Property

Determines if the touch location array is read-only.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsReadOnly { get; }

Property Value

The value is true if the array is read-only; otherwise it is false.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.Item Property

TouchCollection.Item Property

Gets or sets the information of the specified touch location.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TouchLocation this [
         int index
] { get; set; }

Property Value

Touch location.

Expand image See Also

Reference

TouchCollection Structure
TouchCollection Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.Enumerator Structure

TouchCollection.Enumerator Structure

Provides the ability to iterate through the touch locations in a TouchCollection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct TouchCollection.Enumerator : IEnumerator<TouchLocation>, IDisposable, IEnumerator

Expand image See Also

Reference

TouchCollection.Enumerator Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.Enumerator Members

TouchCollection.Enumerator Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the TouchCollection.Enumerator type.

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the TouchCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the TouchCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the TouchCollection as an object.
Explicit Interface Implementation | System.Collections.IEnumerator.Reset | Sets the enumerator to its initial position, which is before the first element in the TouchCollection.

Expand image See Also

Reference

TouchCollection.Enumerator Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchCollection.Enumerator Methods

TouchCollection.Enumerator Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveNext | Advances the enumerator to the next element of the TouchCollection.
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerator.Current | Gets the current element in the TouchCollection as an object.
Explicit Interface Implementation | System.Collections.IEnumerator.Reset | Sets the enumerator to its initial position, which is before the first element in the TouchCollection.

Expand image See Also

Reference

TouchCollection.Enumerator Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchCollection.Enumerator.Dispose Method

TouchCollection.Enumerator.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

TouchCollection.Enumerator Structure
TouchCollection.Enumerator Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.Enumerator.MoveNext Method

TouchCollection.Enumerator.MoveNext Method

Advances the enumerator to the next element of the TouchCollection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool MoveNext ()

Return Value

true if the enumerator has successfully advanced to the next element; false if the enumerator has passed the end of the collection.

Expand image See Also

Reference

TouchCollection.Enumerator Structure
TouchCollection.Enumerator Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerator.Reset Method

System.Collections.IEnumerator.Reset Method

Sets the enumerator to its initial position, which is before the first element in the TouchCollection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private void System.Collections.IEnumerator.Reset ()

Expand image See Also

Reference

TouchCollection.Enumerator Structure
TouchCollection.Enumerator Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.Enumerator Properties

TouchCollection.Enumerator Properties

Expand image Public Properties

 | Name | Description
Public Property | Current | Gets the current element in the TouchCollection.

Expand image See Also

Reference

TouchCollection.Enumerator Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchCollection.Enumerator.Current Property

TouchCollection.Enumerator.Current Property

Gets the current element in the TouchCollection.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TouchLocation Current { get; }

Property Value

The current TouchLocation in the collection.

Expand image See Also

Reference

TouchCollection.Enumerator Structure
TouchCollection.Enumerator Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchCollection.Enumerator.System.Collections.IEnumerator.Current Property

TouchCollection.Enumerator.System.Collections.IEnumerator.Current Property
See Also
CollapseAll image

Gets the current element in the TouchCollection as an object.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private Object System.Collections.IEnumerator.Current { get; }

Property Value

The current touch location in the collection as an Object.

Expand image See Also

Reference

TouchCollection.Enumerator Structure
TouchCollection.Enumerator Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation Structure

TouchLocation Structure

Provides methods and properties for interacting with a touch location on a touch screen device.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct TouchLocation : IEquatable<TouchLocation>

Expand image Remarks

The TouchLocation structure contains information, such as screen location, current state, and amount of pressure for a registered touch location item. A collection of current touch locations is stored in the TouchCollection object of the touch screen device.

Expand image See Also

Tasks

Working with Touch Input (Windows Phone)

Reference

TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation Members

TouchLocation Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the TouchLocation type.

Expand image Public Constructors

 | Name | Description
Public Method | TouchLocation | Overloaded. Initializes a new instance of the TouchLocation structure.

Expand image Public Properties

 | Name | Description
Public Property | Id | Gets the ID of the touch location.
Public Property | Position | Gets the position of the touch location.
Public Property | State | Gets the state of the touch location.

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Determines whether the TouchLocation is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this TouchLocation.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two TouchLocation instances are equal.
 | op_Inequality | Determines whether two TouchLocation instances are unequal.
Public Method | ToString | Gets a string representation of the TouchLocation.
Public Method | TryGetPreviousLocation | Attempts to get the previous location of this touch location object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TouchLocation Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchLocation Constructor

TouchLocation Constructor

Initializes a new instance of the TouchLocation structure.

Expand image Overload List

Name | Description
TouchLocation (Int32, TouchLocationState, Vector2) | Initializes a new TouchLocation with an ID, state, position, and pressure.
TouchLocation (Int32, TouchLocationState, Vector2, TouchLocationState, Vector2) | Initializes a new TouchLocation with an ID, and a set of both current and previous state, position, and pressure values.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace


TouchLocation Constructor (Int32, TouchLocationState, Vector2)

TouchLocation Constructor (Int32, TouchLocationState, Vector2)
See Also
CollapseAll image

Initializes a new TouchLocation with an ID, state, position, and pressure.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TouchLocation (
         int id,
         TouchLocationState state,
         Vector2 position
)

Parameters

id
ID of the new touch location.
state
State of the new touch location.
position
Position, in screen coordinates, of the new touch location.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation Constructor (Int32, TouchLocationState, Vector2, TouchLocationState, Vector2)

TouchLocation Constructor (Int32, TouchLocationState, Vector2, TouchLocationState, Vector2)
See Also
CollapseAll image

Initializes a new TouchLocation with an ID, and a set of both current and previous state, position, and pressure values.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TouchLocation (
         int id,
         TouchLocationState state,
         Vector2 position,
         TouchLocationState previousState,
         Vector2 previousPosition
)

Parameters

id
ID of the new touch location.
state
State of the new touch location.
position
Position, in screen coordinates, of the new touch location.
previousState
Previous state for the new touch location.
previousPosition
Previous position for the new touch location.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation Methods

TouchLocation Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | Overloaded. Determines whether the TouchLocation is equal to a specified object.
Public Method | GetHashCode | Gets the hash code for this TouchLocation.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether two TouchLocation instances are equal.
 | op_Inequality | Determines whether two TouchLocation instances are unequal.
Public Method | ToString | Gets a string representation of the TouchLocation.
Public Method | TryGetPreviousLocation | Attempts to get the previous location of this touch location object.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TouchLocation Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchLocation.Equals Method

TouchLocation.Equals Method

Determines whether the TouchLocation is equal to a specified object.

Expand image Overload List

Name | Description
TouchLocation.Equals (Object) | Determines whether the current TouchLocation is equal to the specified object.
TouchLocation.Equals (TouchLocation) | Determines whether the current TouchLocation is equal to the specified TouchLocation.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace


TouchLocation.Equals Method (Object)

TouchLocation.Equals Method (Object)
See Also
CollapseAll image

Determines whether the current TouchLocation is equal to the specified object.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
The Object to compare with the touch location.

Return Value

true if the current TouchLocation is equal to the specified object; otherwise false.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation.Equals Method (TouchLocation)

TouchLocation.Equals Method (TouchLocation)
See Also
CollapseAll image

Determines whether the current TouchLocation is equal to the specified TouchLocation.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         TouchLocation other
)

Parameters

other
The TouchLocation to compare with this instance.

Return Value

true if the current TouchLocation is equal to the specified TouchLocation; otherwise false.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation.GetHashCode Method

TouchLocation.GetHashCode Method

Gets the hash code for this TouchLocation.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation.op_Equality Method

TouchLocation.op_Equality Method

Determines whether two TouchLocation instances are equal.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         TouchLocation value1,
         TouchLocation value2
)

Parameters

value1
The TouchLocation to compare with the second.
value2
The TouchLocation to compare with the first.

Return Value

true if the touch locations are equal; otherwise false.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation.op_Inequality Method

TouchLocation.op_Inequality Method

Determines whether two TouchLocation instances are unequal.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         TouchLocation value1,
         TouchLocation value2
)

Parameters

value1
The TouchLocation to compare with the second.
value2
The TouchLocation to compare with the first.

Return Value

true if the touch locations are not equal; otherwise false.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation.ToString Method

TouchLocation.ToString Method

Gets a string representation of the TouchLocation.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

The string representation of this TouchLocation.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation.TryGetPreviousLocation Method

TouchLocation.TryGetPreviousLocation Method

Attempts to get the previous location of this touch location object.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool TryGetPreviousLocation (
         out TouchLocation previousLocation
)

Parameters

previousLocation
[OutAttribute] Previous location data, as a TouchLocation.

Return Value

true if a previous location was retrrieved; otherwise false.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation Properties

TouchLocation Properties

Expand image Public Properties

 | Name | Description
Public Property | Id | Gets the ID of the touch location.
Public Property | Position | Gets the position of the touch location.
Public Property | State | Gets the state of the touch location.

Expand image See Also

Reference

TouchLocation Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchLocation.Id Property

TouchLocation.Id Property

Gets the ID of the touch location.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Id { get; }

Property Value

ID of the touch location.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation.Position Property

TouchLocation.Position Property

Gets the position of the touch location.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Vector2 Position { get; }

Property Value

Posiiton, in screen coordinates, of the touch location.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocation.State Property

TouchLocation.State Property

Gets the state of the touch location.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TouchLocationState State { get; }

Property Value

State of the touch location, as a TouchLocationState.

Expand image See Also

Reference

TouchLocation Structure
TouchLocation Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchLocationState Enumeration

TouchLocationState Enumeration

Defines the possible states of a touch location.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum TouchLocationState

Expand image Members

Member name | Description
Invalid | This touch location position is invalid. Typically, you will encounter this state when a new touch location attempts to get the previous state of itself.
Moved | This touch location position was updated or pressed at the same position.
Pressed | This touch location position is new.
Released | This touch location position was released.

Expand image See Also

Tasks

Working with Touch Input (Windows Phone)

Reference

Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanel Class

TouchPanel Class
See Also Members
CollapseAll image

Provides methods for retrieving touch panel device information.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static class TouchPanel

Expand image See Also

Tasks

Working with Touch Input (Windows Phone)

Reference

TouchPanel Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanel Members

TouchPanel Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the TouchPanel type.

Expand image Public Properties

Name | Description
DisplayHeight | Gets or sets the display height of the touch panel.
DisplayOrientation | Gets or sets the display orientation of the touch panel.
DisplayWidth | Gets or sets the display width of the touch panel.
EnabledGestures | Gets or sets the gestures that are enabled for the touch panel.
IsGestureAvailable | Used to determine if a touch gesture is available.
WindowHandle | The window handle of the touch panel.

Expand image Public Methods

Name | Description
GetCapabilities | Gets the touch panel capabilities for an available device.
GetState | Gets the current state of the touch panel.
ReadGesture | Reads an available gesture on the touch panel.

Expand image See Also

Reference

TouchPanel Class
Microsoft.Xna.Framework.Input.Touch Namespace


TouchPanel Methods

TouchPanel Methods

Expand image Public Methods

Name | Description
GetCapabilities | Gets the touch panel capabilities for an available device.
GetState | Gets the current state of the touch panel.
ReadGesture | Reads an available gesture on the touch panel.

Expand image See Also

Reference

Tasks
Working with Touch Input (Windows Phone)
TouchPanel Class
Microsoft.Xna.Framework.Input.Touch Namespace


TouchPanel.GetCapabilities Method

TouchPanel.GetCapabilities Method

Gets the touch panel capabilities for an available device.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static TouchPanelCapabilities GetCapabilities ()

Return Value

Information about the capabilities of the touch panel device.

Expand image See Also

Tasks

Working with Touch Input (Windows Phone)

Reference

TouchPanel Class
TouchPanel Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanel.GetState Method

TouchPanel.GetState Method

Gets the current state of the touch panel.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static TouchCollection GetState ()

Return Value

State of the touch panel and any existing touch locations.

Expand image See Also

Tasks

Working with Touch Input (Windows Phone)

Reference

TouchPanel Class
TouchPanel Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanel.ReadGesture Method

TouchPanel.ReadGesture Method

Reads an available gesture on the touch panel.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static GestureSample ReadGesture ()

Return Value

A GestureSample that represents the next gesture to read.

Remarks

After reading a gesture, TouchPanel.IsGestureAvailable is true if there are more gestures to read.

Expand image See Also

Tasks

Detecting Gestures on a Multitouch Screen (Windows Phone)
Working with Touch Input (Windows Phone)

Reference

TouchPanel Class
TouchPanel Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanel Properties

TouchPanel Properties

Expand image Public Properties

Name | Description
DisplayHeight | Gets or sets the display height of the touch panel.
DisplayOrientation | Gets or sets the display orientation of the touch panel.
DisplayWidth | Gets or sets the display width of the touch panel.
EnabledGestures | Gets or sets the gestures that are enabled for the touch panel.
IsGestureAvailable | Used to determine if a touch gesture is available.
WindowHandle | The window handle of the touch panel.

Expand image See Also

Reference

TouchPanel Class
Microsoft.Xna.Framework.Input.Touch Namespace


TouchPanel.DisplayHeight Property

TouchPanel.DisplayHeight Property

Gets or sets the display height of the touch panel.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static int DisplayHeight { get; set; }

Property Value

The display height of the touch panel.

Expand image See Also

Reference

TouchPanel Class
TouchPanel Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanel.DisplayOrientation Property

TouchPanel.DisplayOrientation Property

Gets or sets the display orientation of the touch panel.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static DisplayOrientation DisplayOrientation { get; set; }

Property Value

The display orientation of the touch panel.

Expand image See Also

Reference

TouchPanel Class
TouchPanel Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanel.DisplayWidth Property

TouchPanel.DisplayWidth Property

Gets or sets the display width of the touch panel.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static int DisplayWidth { get; set; }

Property Value

The display width of the touch panel.

Expand image See Also

Reference

TouchPanel Class
TouchPanel Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanel.EnabledGestures Property

TouchPanel.EnabledGestures Property

Gets or sets the gestures that are enabled for the touch panel.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static GestureType EnabledGestures { get; set; }

Property Value

A single gesture, or a combination of gestures, as listed in the GestureType enumeration.

Expand image See Also

Tasks

Detecting Gestures on a Multitouch Screen (Windows Phone)
Working with Touch Input (Windows Phone)

Reference

TouchPanel Class
TouchPanel Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanel.IsGestureAvailable Property

TouchPanel.IsGestureAvailable Property

Used to determine if a touch gesture is available.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool IsGestureAvailable { get; }

Property Value

true if there are any touch gestures available to read; false otherwise.

Expand image Remarks

Before gestures can become available, they first must be set with the TouchPanel.EnabledGestures property.

If IsGestureAvailable is true, TouchPanel.ReadGesture can be used to read the gesture data.

Expand image See Also

Tasks

Detecting Gestures on a Multitouch Screen (Windows Phone)
Working with Touch Input (Windows Phone)

Reference

TouchPanel Class
TouchPanel Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanel.WindowHandle Property

TouchPanel.WindowHandle Property

The window handle of the touch panel.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static IntPtr WindowHandle { get; set; }

Property Value

The window handle of the touch panel.

Expand image See Also

Reference

TouchPanel Class
TouchPanel Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanelCapabilities Structure

TouchPanelCapabilities Structure

Provides access to information about the capabilities of the touch input device.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public struct TouchPanelCapabilities

Expand image See Also

Tasks

Working with Touch Input (Windows Phone)

Reference

TouchPanelCapabilities Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanelCapabilities Members

TouchPanelCapabilities Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the TouchPanelCapabilities type.

Expand image Public Properties

 | Name | Description
Public Property | IsConnected | Indicates if the touch panel device is available for use.
Public Property | MaximumTouchCount | Gets the maximum number of touch locations that can be tracked by the touch pad device.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TouchPanelCapabilities Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchPanelCapabilities Methods

TouchPanelCapabilities Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TouchPanelCapabilities Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchPanelCapabilities Properties

TouchPanelCapabilities Properties

Expand image Public Properties

 | Name | Description
Public Property | IsConnected | Indicates if the touch panel device is available for use.
Public Property | MaximumTouchCount | Gets the maximum number of touch locations that can be tracked by the touch pad device.

Expand image See Also

Reference

TouchPanelCapabilities Structure
Microsoft.Xna.Framework.Input.Touch Namespace


TouchPanelCapabilities.IsConnected Property

TouchPanelCapabilities.IsConnected Property

Indicates if the touch panel device is available for use.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsConnected { get; set; }

Property Value

true if the touch input device is available; false otherwise.

Expand image See Also

Reference

TouchPanelCapabilities Structure
TouchPanelCapabilities Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


TouchPanelCapabilities.MaximumTouchCount Property

TouchPanelCapabilities.MaximumTouchCount Property

Gets the maximum number of touch locations that can be tracked by the touch pad device.

Namespace: Microsoft.Xna.Framework.Input.Touch
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int MaximumTouchCount { get; set; }

Property Value

The maximum number of touch locations that can be tracked by the touch pad device.

Expand image See Also

Reference

TouchPanelCapabilities Structure
TouchPanelCapabilities Members
Microsoft.Xna.Framework.Input.Touch Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Media Namespace

Microsoft.Xna.Framework.Media Namespace

Contains classes to enumerate, play, and view songs, albums, playlists, and pictures.

Expand image Classes

 | Name | Description
Public Class | Album | Provides access to an album in the media library.
Public Class | AlbumCollection | A collection of albums in the media library.
Public Class | Artist | Provides access to artist information in the media library.
Public Class | ArtistCollection | The collection of all artists in the media library.
Public Class | Genre | Provides access to genre information in the media library.
Public Class | GenreCollection | The collection of all genres in the media library.
Public Class | MediaLibrary | Provides access to songs, playlists, and pictures in the device's media library.
Public Class | MediaPlayer | Provides methods and properties to play, pause, resume, and stop songs. MediaPlayer also exposes shuffle, repeat, volume, play position, and visualization capabilities.
Public Class | MediaQueue | Provides methods and properties to access and control the queue of playing songs.
Public Class | MediaSource | Provides methods and properties to access the source or sources from which the media will be read.
Public Class | Picture | Provides access to a picture in the media library.
Public Class | PictureAlbum | Provides access to a picture album in the media library.
Public Class | PictureAlbumCollection | A collection of picture albums in the media library.
Public Class | PictureCollection | A collection of pictures in the media library.
Public Class | Playlist | Provides access to a playlist in the media library.
Public Class | PlaylistCollection | A collection of playlists in the media library.
Public Class | Song | Provides access to a song in the song library.
Public Class | SongCollection | A collection of songs in the song library.
Public Class | Video | Represents a video.
Public Class | VideoPlayer | Provides methods and properties to play back, pause, resume, and stop video. VideoPlayer also exposes repeat, volume, and play position information.
Public Class | VisualizationData | Encapsulates visualization (frequency and sample) data for the currently-playing song.

Expand image Enumerations

 | Name | Description
Public Enumeration | MediaSourceType | Type of the media source.
Public Enumeration | MediaState | Media playback state (playing, paused, or stopped).
Public Enumeration | VideoSoundtrackType | Type of sounds in a video


Album Class

Album Class
See Also Members
CollapseAll image

Provides access to an album in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class Album : IEquatable<Album>, IDisposable

Expand image Remarks

The Album class provides information about an album, including the album's Name, Artist, and Songs.

You can obtain an Album object through the AlbumCollection.Item indexer and the Song.Album property.

Expand image See Also

Reference

AlbumCollection.Item Property
Song.Album Property
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album Members

Album Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Album type.

Expand image Public Properties

 | Name | Description
Public Property | Artist | Gets the Artist of the Album.
Public Property | Duration | Gets the duration of the Album.
Public Property | Genre | Gets the Genre of the Album.
Public Property | HasArt | Gets a value indicating whether the Album has associated album art.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the Album.
Public Property | Songs | Gets a SongCollection that contains the songs on the album.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Album are equal.
Public Method | GetAlbumArt | Returns the stream that contains the album art image data.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetThumbnail | Returns the stream that contains the album thumbnail image data.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Album instances are equal.
 | op_Inequality | Determines whether the specified Album instances are not equal.
Public Method | ToString | Returns a String representation of this Album.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Album Class
Microsoft.Xna.Framework.Media Namespace


Album Methods

Album Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Album are equal.
Public Method | GetAlbumArt | Returns the stream that contains the album art image data.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetThumbnail | Returns the stream that contains the album thumbnail image data.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Album instances are equal.
 | op_Inequality | Determines whether the specified Album instances are not equal.
Public Method | ToString | Returns a String representation of this Album.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Album Class
Microsoft.Xna.Framework.Media Namespace


Album.Dispose Method

Album.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.Equals Method

Album.Equals Method

Determines whether two instances of Album are equal.

Expand image Overload List

Name | Description
Album.Equals (Album) | Determines whether the specified Album is equal to this Album.
Album.Equals (Object) | Determines whether the specified Object is equal to this Album.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace


Album.Equals Method (Album)

Album.Equals Method (Album)
See Also
CollapseAll image

Determines whether the specified Album is equal to this Album.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Album other
)

Parameters

other
Album to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.Equals Method (Object)

Album.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to this Album.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.GetAlbumArt Method

Album.GetAlbumArt Method

Returns the stream that contains the album art image data.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Stream GetAlbumArt ()

Return Value

Stream object that contains the album art image data.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.GetHashCode Method

Album.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.GetThumbnail Method

Album.GetThumbnail Method

Returns the stream that contains the album thumbnail image data.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Stream GetThumbnail ()

Return Value

Stream object that contains the thumbnail image data for the album.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.op_Equality Method

Album.op_Equality Method

Determines whether the specified Album instances are equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Album first,
         Album second
)

Parameters

first
Object to the left of the equality operator.
second
Object to the right of the equality operator.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.op_Inequality Method

Album.op_Inequality Method

Determines whether the specified Album instances are not equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Album first,
         Album second
)

Parameters

first
Object to the left of the inequality operator.
second
Object to the right of the inequality operator.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.ToString Method

Album.ToString Method

Returns a String representation of this Album.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album Properties

Album Properties

Expand image Public Properties

 | Name | Description
Public Property | Artist | Gets the Artist of the Album.
Public Property | Duration | Gets the duration of the Album.
Public Property | Genre | Gets the Genre of the Album.
Public Property | HasArt | Gets a value indicating whether the Album has associated album art.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the Album.
Public Property | Songs | Gets a SongCollection that contains the songs on the album.

Expand image See Also

Reference

Album Class
Microsoft.Xna.Framework.Media Namespace


Album.Artist Property

Album.Artist Property

Gets the Artist of the Album.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Artist Artist { get; }

Property Value

Artist of this Album.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.Duration Property

Album.Duration Property

Gets the duration of the Album.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TimeSpan Duration { get; }

Property Value

Duration of the album, as a TimeSpan structure.

Expand image Remarks

The duration is the total duration of all of the album's songs that are present on the device. This may be less than the duration attributed to the entire album.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.Genre Property

Album.Genre Property

Gets the Genre of the Album.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Genre Genre { get; }

Property Value

Genre of this Album.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.HasArt Property

Album.HasArt Property

Gets a value indicating whether the Album has associated album art.
Windows Specific Information

Album information is not supported. This property is always set to false.

Xbox 360 Specific Information

Album information is not supported. This property is always set to false.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool HasArt { get; }

Property Value

true if this Album has associated album art, false otherwise.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.IsDisposed Property

Album.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.Name Property

Album.Name Property

Gets the name of the Album.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this Album.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Album.Songs Property

Album.Songs Property

Gets a SongCollection that contains the songs on the album.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public SongCollection Songs { get; }

Property Value

SongCollection containing the songs on this album.

Expand image See Also

Reference

Album Class
Album Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlbumCollection Class

AlbumCollection Class
See Also Members
CollapseAll image

A collection of albums in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class AlbumCollection : IEnumerable<Album>, IEnumerable, IDisposable

Expand image Remarks

The AlbumCollection class provides access to albums in the device's media library.

Use the MediaLibrary.Albums property to obtain a collection of all albums in the media library, the Artist.Albums property to obtain a collection of albums associated with a particular artist, and the Genre.Albums property to obtain a collection of albums associated with a particular genre.

The AlbumCollection does not immediately instantiate instances of all albums in the collection. Instead, individual Album objects are created each time an album is accessed through the collection's Item indexer. See the Remarks section of Item for the resource implications of maintaining references to multiple Album objects.

Expand image See Also

Reference

MediaLibrary.Albums Property
Artist.Albums Property
Genre.Albums Property
Album Class
AlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlbumCollection Members

AlbumCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the AlbumCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Album objects in the AlbumCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Album at the specified index in the AlbumCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the AlbumCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

AlbumCollection Class
Microsoft.Xna.Framework.Media Namespace


AlbumCollection Methods

AlbumCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the AlbumCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

AlbumCollection Class
Microsoft.Xna.Framework.Media Namespace


AlbumCollection.Dispose Method

AlbumCollection.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

AlbumCollection Class
AlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlbumCollection.GetEnumerator Method

AlbumCollection.GetEnumerator Method

Returns an enumerator that iterates through the AlbumCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public IEnumerator<Album> GetEnumerator ()

Return Value

IEnumerator for the AlbumCollection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until MoveNext is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. You cannot set Current to the first element of the collection again; you must create a new enumerator instance instead.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

AlbumCollection Class
AlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the collection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

IEnumerator that iterates through the collection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. Reset also brings the enumerator back to this position. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until either MoveNext or Reset is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. To set Current to the first element of the collection again, you can call Reset followed by MoveNext.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

AlbumCollection Class
AlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlbumCollection Properties

AlbumCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Album objects in the AlbumCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Album at the specified index in the AlbumCollection.

Expand image See Also

Reference

AlbumCollection Class
Microsoft.Xna.Framework.Media Namespace


AlbumCollection.Count Property

AlbumCollection.Count Property

Gets the number of Album objects in the AlbumCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of Album objects in this AlbumCollection.

Expand image See Also

Reference

AlbumCollection Class
AlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlbumCollection.IsDisposed Property

AlbumCollection.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

AlbumCollection Class
AlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


AlbumCollection.Item Property

AlbumCollection.Item Property

Gets the Album at the specified index in the AlbumCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Album this [
         int index
] { get; }

Property Value

A new Album representing the album at the specified index in this AlbumCollection.

Expand image Remarks

Each call returns a new Album instance.

Album resources such as art and thumbnails are cached in each Album instance. Retrieving and maintaining references to multiple instances of the same album, and accessing art or thumbnails on each of those instances, creates multiple copies of the art or thumbnails.

Expand image See Also

Reference

AlbumCollection Class
AlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist Class

Artist Class
See Also Members
CollapseAll image

Provides access to artist information in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class Artist : IEquatable<Artist>, IDisposable

Expand image Remarks

The Artist class provides information about an artist, including the artist's Name, Albums, and Songs.

You can obtain an Artist object through the ArtistCollection.Item indexer and the Album.Artist and Song.Artist properties.

Expand image See Also

Reference

ArtistCollection.Item Property
Album.Artist Property
Song.Artist Property
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist Members

Artist Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Artist type.

Expand image Public Properties

 | Name | Description
Public Property | Albums | Gets the AlbumCollection for the Artist.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the Artist.
Public Property | Songs | Gets the SongCollection for the Artist.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Artist are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Artist instances are equal.
 | op_Inequality | Determines whether the specified Artist instances are not equal.
Public Method | ToString | Returns a String representation of the Artist.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Artist Class
Microsoft.Xna.Framework.Media Namespace


Artist Methods

Artist Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Artist are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Artist instances are equal.
 | op_Inequality | Determines whether the specified Artist instances are not equal.
Public Method | ToString | Returns a String representation of the Artist.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Artist Class
Microsoft.Xna.Framework.Media Namespace


Artist.Dispose Method

Artist.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist.Equals Method

Artist.Equals Method

Determines whether two instances of Artist are equal.

Expand image Overload List

Name | Description
Artist.Equals (Artist) | Determines whether the specified Artist is equal to this Artist.
Artist.Equals (Object) | Determines whether the specified Object is equal to this Artist.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace


Artist.Equals Method (Artist)

Artist.Equals Method (Artist)
See Also
CollapseAll image

Determines whether the specified Artist is equal to this Artist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Artist other
)

Parameters

other
Artist to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist.Equals Method (Object)

Artist.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to this Artist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist.GetHashCode Method

Artist.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist.op_Equality Method

Artist.op_Equality Method

Determines whether the specified Artist instances are equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Artist first,
         Artist second
)

Parameters

first
Object to the left of the equality operator.
second
Object to the right of the equality operator.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist.op_Inequality Method

Artist.op_Inequality Method

Determines whether the specified Artist instances are not equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Artist first,
         Artist second
)

Parameters

first
Object to the left of the inequality operator.
second
Object to the right of the inequality operator.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist.ToString Method

Artist.ToString Method

Returns a String representation of the Artist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist Properties

Artist Properties

Expand image Public Properties

 | Name | Description
Public Property | Albums | Gets the AlbumCollection for the Artist.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the Artist.
Public Property | Songs | Gets the SongCollection for the Artist.

Expand image See Also

Reference

Artist Class
Microsoft.Xna.Framework.Media Namespace


Artist.Albums Property

Artist.Albums Property

Gets the AlbumCollection for the Artist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public AlbumCollection Albums { get; }

Property Value

AlbumCollection for this Artist.

Expand image Remarks

The returned AlbumCollection contains all albums in the device's media library that are associated with this Artist.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist.IsDisposed Property

Artist.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist.Name Property

Artist.Name Property

Gets the name of the Artist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this Artist.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Artist.Songs Property

Artist.Songs Property

Gets the SongCollection for the Artist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public SongCollection Songs { get; }

Property Value

SongCollection for this Artist.

Expand image Remarks

The returned SongCollection contains all songs in the device's media library that are associated with this Artist.

Expand image See Also

Reference

Artist Class
Artist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ArtistCollection Class

ArtistCollection Class
See Also Members
CollapseAll image

The collection of all artists in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class ArtistCollection : IEnumerable<Artist>, IEnumerable, IDisposable

Expand image Remarks

The ArtistCollection class provides access to all artists in the device's media library.

Use the MediaLibrary.Artists property to obtain the artist collection.

The ArtistCollection does not immediately instantiate instances of all artists in the collection. Instead, individual Artist objects are created each time an artist is accessed through the collection's Item indexer.

Expand image See Also

Reference

MediaLibrary.Artists Property
Artist Class
ArtistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ArtistCollection Members

ArtistCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the ArtistCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Artist objects in the ArtistCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Artist at the specified index in the ArtistCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the ArtistCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

ArtistCollection Class
Microsoft.Xna.Framework.Media Namespace


ArtistCollection Methods

ArtistCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the ArtistCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

ArtistCollection Class
Microsoft.Xna.Framework.Media Namespace


ArtistCollection.Dispose Method

ArtistCollection.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

ArtistCollection Class
ArtistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ArtistCollection.GetEnumerator Method

ArtistCollection.GetEnumerator Method

Returns an enumerator that iterates through the ArtistCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public IEnumerator<Artist> GetEnumerator ()

Return Value

IEnumerator for the ArtistCollection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until MoveNext is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. You cannot set Current to the first element of the collection again; you must create a new enumerator instance instead.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

ArtistCollection Class
ArtistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the collection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

IEnumerator that iterates through the collection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. Reset also brings the enumerator back to this position. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until either MoveNext or Reset is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. To set Current to the first element of the collection again, you can call Reset followed by MoveNext.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

ArtistCollection Class
ArtistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ArtistCollection Properties

ArtistCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Artist objects in the ArtistCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Artist at the specified index in the ArtistCollection.

Expand image See Also

Reference

ArtistCollection Class
Microsoft.Xna.Framework.Media Namespace


ArtistCollection.Count Property

ArtistCollection.Count Property

Gets the number of Artist objects in the ArtistCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of Artist objects in this ArtistCollection.

Expand image See Also

Reference

ArtistCollection Class
ArtistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ArtistCollection.IsDisposed Property

ArtistCollection.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

ArtistCollection Class
ArtistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


ArtistCollection.Item Property

ArtistCollection.Item Property

Gets the Artist at the specified index in the ArtistCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Artist this [
         int index
] { get; }

Property Value

A new Artist representing the artist at the specified index in this ArtistCollection.

Expand image Remarks

Each call returns a new Artist instance.

Artist resources such as the song and album collections for that artist are cached in each Artist instance. Retrieving and maintaining references to multiple instances of the same artist, and accessing the Songs or Albums collections on each of those instances, creates multiple copies of the song or album collections.

Expand image See Also

Reference

Artist Class
ArtistCollection Class
ArtistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre Class

Genre Class
See Also Members
CollapseAll image

Provides access to genre information in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class Genre : IEquatable<Genre>, IDisposable

Expand image Remarks

The Genre class provides information about a genre, including the genre's Name, and the Albums and Songs in that genre that are on the device.

You can obtain a Genre object through the GenreCollection.Item indexer and the Album.Genre and Song.Genre properties.

Expand image See Also

Reference

GenreCollection.Item Property
Album.Genre Property
Song.Genre Property
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre Members

Genre Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Genre type.

Expand image Public Properties

 | Name | Description
Public Property | Albums | Gets the AlbumCollection for the Genre.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the Genre.
Public Property | Songs | Gets the SongCollection for the Genre.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Genre are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Genre instances are equal.
 | op_Inequality | Determines whether the specified Genre instances are not equal.
Public Method | ToString | Returns a String representation of the Genre.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Genre Class
Microsoft.Xna.Framework.Media Namespace


Genre Methods

Genre Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Genre are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Genre instances are equal.
 | op_Inequality | Determines whether the specified Genre instances are not equal.
Public Method | ToString | Returns a String representation of the Genre.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Genre Class
Microsoft.Xna.Framework.Media Namespace


Genre.Dispose Method

Genre.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre.Equals Method

Genre.Equals Method

Determines whether two instances of Genre are equal.

Expand image Overload List

Name | Description
Genre.Equals (Genre) | Determines whether the specified Genre is equal to this Genre.
Genre.Equals (Object) | Determines whether the specified Object is equal to this Genre.

Expand image See Also

Reference

Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace


Genre.Equals Method (Genre)

Genre.Equals Method (Genre)
See Also
CollapseAll image

Determines whether the specified Genre is equal to this Genre.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Genre other
)

Parameters

other
Genre to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre.Equals Method (Object)

Genre.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to this Genre.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre.GetHashCode Method

Genre.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre.op_Equality Method

Genre.op_Equality Method

Determines whether the specified Genre instances are equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Genre first,
         Genre second
)

Parameters

first
Object to the left of the equality operator.
second
Object to the right of the equality operator.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre.op_Inequality Method

Genre.op_Inequality Method

Determines whether the specified Genre instances are not equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Genre first,
         Genre second
)

Parameters

first
Object to the left of the inequality operator.
second
Object to the right of the inequality operator.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre.ToString Method

Genre.ToString Method

Returns a String representation of the Genre.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre Properties

Genre Properties

Expand image Public Properties

 | Name | Description
Public Property | Albums | Gets the AlbumCollection for the Genre.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the Genre.
Public Property | Songs | Gets the SongCollection for the Genre.

Expand image See Also

Reference

Genre Class
Microsoft.Xna.Framework.Media Namespace


Genre.Albums Property

Genre.Albums Property

Gets the AlbumCollection for the Genre.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public AlbumCollection Albums { get; }

Property Value

AlbumCollection for this Genre.

Expand image Remarks

The returned AlbumCollection contains all albums in the device's media library that are associated with this Genre.

Expand image See Also

Reference

AlbumCollection Class
Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre.IsDisposed Property

Genre.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre.Name Property

Genre.Name Property

Gets the name of the Genre.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this Genre.

Expand image See Also

Reference

Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Genre.Songs Property

Genre.Songs Property

Gets the SongCollection for the Genre.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public SongCollection Songs { get; }

Property Value

SongCollection for this Genre.

Expand image Remarks

The returned SongCollection contains all songs in the device's media library that are associated with this Genre.

Expand image See Also

Reference

SongCollection Class
Genre Class
Genre Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GenreCollection Class

GenreCollection Class
See Also Members
CollapseAll image

The collection of all genres in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class GenreCollection : IEnumerable<Genre>, IEnumerable, IDisposable

Expand image Remarks

The GenreCollection class provides access to all genres in the device's media library.

Use the MediaLibrary.Genres property to obtain the genre collection.

The GenreCollection does not immediately instantiate instances of all genres in the collection. Instead, individual Genre objects are created each time a genre is accessed through the collection's Item indexer.

Expand image See Also

Reference

MediaLibrary.Genres Property
Genre Class
GenreCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GenreCollection Members

GenreCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the GenreCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Genre objects in the GenreCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Genre at the specified index in the GenreCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the GenreCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

GenreCollection Class
Microsoft.Xna.Framework.Media Namespace


GenreCollection Methods

GenreCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the GenreCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

GenreCollection Class
Microsoft.Xna.Framework.Media Namespace


GenreCollection.Dispose Method

GenreCollection.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

GenreCollection Class
GenreCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GenreCollection.GetEnumerator Method

GenreCollection.GetEnumerator Method

Returns an enumerator that iterates through the GenreCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public IEnumerator<Genre> GetEnumerator ()

Return Value

IEnumerator for the GenreCollection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until MoveNext is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. You cannot set Current to the first element of the collection again; you must create a new enumerator instance instead.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

GenreCollection Class
GenreCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the collection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

IEnumerator that iterates through the collection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. Reset also brings the enumerator back to this position. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until either MoveNext or Reset is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. To set Current to the first element of the collection again, you can call Reset followed by MoveNext.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

GenreCollection Class
GenreCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GenreCollection Properties

GenreCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Genre objects in the GenreCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Genre at the specified index in the GenreCollection.

Expand image See Also

Reference

GenreCollection Class
Microsoft.Xna.Framework.Media Namespace


GenreCollection.Count Property

GenreCollection.Count Property

Gets the number of Genre objects in the GenreCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of Genre objects in this GenreCollection.

Expand image See Also

Reference

GenreCollection Class
GenreCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GenreCollection.IsDisposed Property

GenreCollection.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

GenreCollection Class
GenreCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


GenreCollection.Item Property

GenreCollection.Item Property

Gets the Genre at the specified index in the GenreCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Genre this [
         int index
] { get; }

Property Value

A new Genre representing the genre at the specified index in this GenreCollection.

Expand image Remarks

Each call returns a new Genre instance.

Genre resources such as the song and album collections for that genre are cached in each Genre instance. Retrieving and maintaining references to multiple instances of the same genre, and accessing the Songs or Albums collections on each of those instances, creates multiple copies of the song or album collections.

Expand image See Also

Reference

Genre Class
GenreCollection Class
GenreCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary Class

MediaLibrary Class
See Also Members Example
CollapseAll image

Provides access to songs, playlists, and pictures in the device's media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class MediaLibrary : IDisposable

Expand image Remarks

MediaLibrary provides the following properties that return media collections: Albums, Artists, Genres, Pictures, Playlists, and Songs. Each property returns a collection object that can be enumerated and indexed. The collection object represents all media of that type in the device's media library.

The media collections do not retrieve or instantiate all media objects immediately. Instead, you can use the collections when needed to retrieve individual media objects such as Song and Artist objects.

On Windows, MediaLibrary can find songs only if the Windows Media Player previously found songs on the system. This means that Windows Media Player first must search the system for music before any songs can be accessed through MediaLibrary.

Expand image Example

The following sample fragment demonstrates how to use MediaLibrary to retrieve and play a song.

C#
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace ZuneSimpleSongPlay
{
    static class Program
    {
        static void Main(string[] args)
        {
            MediaLibrary library = new MediaLibrary();
            SongCollection songs = library.Songs;
            Song song = songs[0];
            MediaPlayer.Play(song);

            while (!GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.Back))
            {
                ;
            }
        }
    }
}
Note
You may get an exception when you try to play DRM protected music.

Expand image See Also

Tasks

Accessing Pictures from a Picture Album

Reference

MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary Members

MediaLibrary Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the MediaLibrary type.

Expand image Public Constructors

 | Name | Description
Public Method | MediaLibrary | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | Albums | Gets the AlbumCollection that contains all albums in the media library.
Public Property | Artists | Gets the ArtistCollection that contains all artists in the media library.
Public Property | Genres | Gets the GenreCollection that contains all genres in the media library.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | MediaSource | Gets the MediaSource with which this media library was constructed.
Public Property | Pictures | Gets the PictureCollection that contains all pictures in the media library.
Public Property | Playlists | Gets the PlaylistCollection that contains all playlists in the media library.
Public Property | RootPictureAlbum | Gets the root PictureAlbum for all pictures in the media library.
Public Property | SavedPictures | Returns the collection of all saved pictures in the device's media library.
Public Property | Songs | Gets the SongCollection that contains all songs in the media library.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Releases the resources used by the MediaLibrary.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPictureFromToken | Retrieves a picture from the device's media library based on a picture token.
Public Method | GetType | (Inherited from Object.)
Public Method | SavePicture | Overloaded. Saves the image to the media library.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MediaLibrary Class
Microsoft.Xna.Framework.Media Namespace


MediaLibrary Constructor

MediaLibrary Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
MediaLibrary () | Initializes a new instance of the MediaLibrary class.
MediaLibrary (MediaSource) | Initializes a new instance of the MediaLibrary class, using a specific media source to create the new media library.

Expand image See Also

Reference

MediaLibrary Class
MediaLibrary Members
MediaSource Class
Microsoft.Xna.Framework.Media Namespace


MediaLibrary Constructor ()

MediaLibrary Constructor ()
See Also
CollapseAll image

Initializes a new instance of the MediaLibrary class.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public MediaLibrary ()

Expand image See Also

Reference

MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary Constructor (MediaSource)

MediaLibrary Constructor (MediaSource)
See Also Example
CollapseAll image

Initializes a new instance of the MediaLibrary class, using a specific media source to create the new media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public MediaLibrary (
         MediaSource mediaSource
)

Parameters

mediaSource
A media source that will be the source for the media library.

Expand image Example

The following example demonstrates creating a new MediaLibrary class using a MediaSource.

C#
GraphicsDevice.Clear(Color.CornflowerBlue);
Vector2 pos = Vector2.Zero;
SpriteFont font = Content.Load<SpriteFont>("Font");

spriteBatch.Begin();
spriteBatch.DrawString(font, "media library stats:",
    pos, Color.White);

ICollection<MediaSource> mediaSources =
    MediaSource.GetAvailableMediaSources();
foreach (MediaSource source in mediaSources)
{
    MediaLibrary ml = new MediaLibrary(source);

    // display some data about this media library
    pos.Y += font.LineSpacing;
    spriteBatch.DrawString(font, "Album count: " + ml.Albums.Count,
        pos, Color.White);
}

spriteBatch.End();

Expand image See Also

Reference

MediaLibrary Class
MediaSource Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary Methods

MediaLibrary Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Releases the resources used by the MediaLibrary.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPictureFromToken | Retrieves a picture from the device's media library based on a picture token.
Public Method | GetType | (Inherited from Object.)
Public Method | SavePicture | Overloaded. Saves the image to the media library.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MediaLibrary Class
Microsoft.Xna.Framework.Media Namespace


MediaLibrary.Dispose Method

MediaLibrary.Dispose Method

Releases the resources used by the MediaLibrary.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image Remarks

Call Dispose only when you are finished using the MediaLibrary. The Dispose method leaves the MediaLibrary in an unusable state. After calling Dispose, you must release all references to the MediaLibrary in order for the garbage collector to reclaim the memory that the MediaLibrary was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

Expand image See Also

Reference

MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.GetPictureFromToken Method

MediaLibrary.GetPictureFromToken Method

Retrieves a picture from the device's media library based on a picture token.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Picture GetPictureFromToken (
         string token
)

Parameters

token
The picture token. This cannot be null

Return Value

The Picture object that matches the supplied picture token.

Expand image See Also

Concepts

Media Overview
Accessing Pictures from a Picture Album

Reference

MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.SavePicture Method

MediaLibrary.SavePicture Method

Saves the image to the media library.

Expand image Overload List

Name | Description
MediaLibrary.SavePicture (String, Byte[]) | Saves the image to the media library, and then returns that saved image as a picture object.
MediaLibrary.SavePicture (String, Stream) | Saves the image contained in the stream object to the media library, and then returns that saved image as a picture object.

Expand image Exceptions

Exception type | Condition
NotSupportedException | SavePicture was used on a unsupported platform. SavePicture is not supported on Windows or Xbox 360.
InvalidOperationException | Exception that is thrown if SavePicture is called using the Windows Phone Emulator.

Expand image Remarks

SavePicture is only supported on Windows Phone. However, SavePicture is not supported using Windows Phone Emulator.

Expand image See Also

Reference

MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace


MediaLibrary.SavePicture Method (String, Byte[])

MediaLibrary.SavePicture Method (String, Byte[])
See Also
CollapseAll image

Saves the image to the media library, and then returns that saved image as a picture object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Picture SavePicture (
         string name,
         byte[] imageBuffer
)

Parameters

name
Name of the image file saved to the media library.
imageBuffer
Buffer that contains the image in the required JPEG file format.

Return Value

The Picture object that represents the saved image.

Expand image Exceptions

Exception type | Condition
NotSupportedException | SavePicture was used on a unsupported platform. SavePicture is not supported on Windows or Xbox 360.

Expand image Remarks

SavePicture is only supported on Windows Phone.

Image data that is passed in must be in a JPEG file format. Additionally, SavePicture always saves the image in a JPEG file format.

Expand image See Also

Concepts

Media Overview
Accessing Pictures from a Picture Album

Reference

MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.SavePicture Method (String, Stream)

MediaLibrary.SavePicture Method (String, Stream)
See Also
CollapseAll image

Saves the image contained in the stream object to the media library, and then returns that saved image as a picture object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
[SecuritySafeCriticalAttribute]
public Picture SavePicture (
         string name,
         Stream source
)

Parameters

name
Name of the image file that is saved to the media library.
source
Stream object that contains the image information in the required JPEG file format.

Return Value

The Picture object that represents the saved image.

Expand image Exceptions

Exception type | Condition
NotSupportedException | SavePicture was used on a unsupported platform. SavePicture is not supported on Windows or Xbox 360.

Expand image Remarks

SavePicture is only supported on Windows Phone.

Image data that is passed in must be in a JPEG file format. SavePicture always saves the image in a JPEG file format.

Expand image See Also

Concepts

Media Overview
Accessing Pictures from a Picture Album

Reference

MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary Properties

MediaLibrary Properties

Expand image Public Properties

 | Name | Description
Public Property | Albums | Gets the AlbumCollection that contains all albums in the media library.
Public Property | Artists | Gets the ArtistCollection that contains all artists in the media library.
Public Property | Genres | Gets the GenreCollection that contains all genres in the media library.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | MediaSource | Gets the MediaSource with which this media library was constructed.
Public Property | Pictures | Gets the PictureCollection that contains all pictures in the media library.
Public Property | Playlists | Gets the PlaylistCollection that contains all playlists in the media library.
Public Property | RootPictureAlbum | Gets the root PictureAlbum for all pictures in the media library.
Public Property | SavedPictures | Returns the collection of all saved pictures in the device's media library.
Public Property | Songs | Gets the SongCollection that contains all songs in the media library.

Expand image See Also

Reference

MediaLibrary Class
Microsoft.Xna.Framework.Media Namespace


MediaLibrary.Albums Property

MediaLibrary.Albums Property

Gets the AlbumCollection that contains all albums in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public AlbumCollection Albums { get; }

Property Value

AlbumCollection that contains all albums in the device's media library.

Expand image See Also

Reference

AlbumCollection Class
Album Class
MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.Artists Property

MediaLibrary.Artists Property

Gets the ArtistCollection that contains all artists in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ArtistCollection Artists { get; }

Property Value

ArtistCollection that contains all artists in the device's media library.

Expand image See Also

Reference

ArtistCollection Class
Artist Class
MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.Genres Property

MediaLibrary.Genres Property

Gets the GenreCollection that contains all genres in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public GenreCollection Genres { get; }

Property Value

GenreCollection that contains all genres in the device's media library.

Expand image See Also

Reference

GenreCollection Class
Genre Class
MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.IsDisposed Property

MediaLibrary.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.MediaSource Property

MediaLibrary.MediaSource Property

Gets the MediaSource with which this media library was constructed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public MediaSource MediaSource { get; }

Property Value

The MediaSource with which this media library was constructed.

Expand image See Also

Reference

MediaLibrary Class
MediaLibrary Members
MediaSource Class
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.Pictures Property

MediaLibrary.Pictures Property

Gets the PictureCollection that contains all pictures in the media library.
Windows Specific Information
Picture collections are not supported. This property always returns an empty collection.
Xbox 360 Specific Information
Picture collections are not supported. This property always returns an empty collection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PictureCollection Pictures { get; }

Property Value

PictureCollection that contains all pictures in the device's media library.

Expand image See Also

Reference

PictureCollection Class
Picture Class
MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.Playlists Property

MediaLibrary.Playlists Property

Gets the PlaylistCollection that contains all playlists in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PlaylistCollection Playlists { get; }

Property Value

PlaylistCollection that contains all playlists in the device's media library.

Expand image See Also

Reference

PlaylistCollection Class
Playlist Class
MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.RootPictureAlbum Property

MediaLibrary.RootPictureAlbum Property

Gets the root PictureAlbum for all pictures in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PictureAlbum RootPictureAlbum { get; }

Property Value

The root PictureAlbum for all pictures in the device's media library.

Expand image Remarks

RootPictureAlbum is only supported on Windows Phone, and returns an empty PictureAlbum on Windows and Xbox 360.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbumCollection Class
MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.SavedPictures Property

MediaLibrary.SavedPictures Property

Returns the collection of all saved pictures in the device's media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PictureCollection SavedPictures { get; }

Property Value

PictureCollection object that contains the collection of all saved pictures in the media library.

Expand image Remarks

SavedPictures is only supported on Windows Phone, and returns an empty PictureCollection on Windows and Xbox 360.

Expand image See Also

Reference

MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaLibrary.Songs Property

MediaLibrary.Songs Property

Gets the SongCollection that contains all songs in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public SongCollection Songs { get; }

Property Value

SongCollection that contains all songs in the device's media library.

Expand image See Also

Reference

SongCollection Class
Song Class
MediaLibrary Class
MediaLibrary Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer Class

MediaPlayer Class
See Also Members
CollapseAll image

Provides methods and properties to play, pause, resume, and stop songs. MediaPlayer also exposes shuffle, repeat, volume, play position, and visualization capabilities.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static class MediaPlayer

Expand image Remarks

MediaPlayer provides methods and properties for playing songs in the media library.

To control song playback, use the Play, Pause, Stop, and Resume methods. The MoveNext and MovePrevious methods move to the next or previous song in the queue. They operate as if the queue was circular. That is, MoveNext, when the last song is playing, moves to the first song. MovePrevious, when the first song is playing, moves to the last song.

To get and set playback options, use the IsMuted, IsRepeating, IsShuffled, PlayPosition, and Volume properties.

To obtain visualization data for the currently playing song, call GetVisualizationData.

MediaPlayer is a static class, so you do not have to use new to instantiate an instance of the class. Instead, call methods and properties directly on the class.

Expand image See Also

Tasks

Playing a Song

Reference

MediaPlayer.Play Method
Song Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer Members

MediaPlayer Members
See Also Events Methods Properties
CollapseAll image

The following tables list the members exposed by the MediaPlayer type.

Expand image Public Properties

Name | Description
GameHasControl | Determines whether the game has control of the background music.
IsMuted | Gets or set the muted setting for the media player.
IsRepeating | Gets or sets the repeat setting for the media player.
IsShuffled | Gets or sets the shuffle setting for the media player.
IsVisualizationEnabled | Gets or sets the visualization enabled setting for the media player.
PlayPosition | Gets the play position within the currently playing song.
Queue | Gets the media playback queue, MediaQueue.
State | Gets the media playback state, MediaState.
Volume | Gets or sets the media player volume.

Expand image Public Methods

Name | Description
GetVisualizationData | Retrieves visualization (frequency and sample) data for the currently-playing song.
MoveNext | Moves to the next song in the queue of playing songs.
MovePrevious | Moves to the previous song in the queue of playing songs.
Pause | Pauses the currently playing song.
Play | Overloaded. Plays a song or collection of songs.
Resume | Resumes a paused song.
Stop | Stops playing a song.

Expand image Public Events

Name | Description
ActiveSongChanged | Raised when the active song changes due to active playback or due to explicit calls to the MoveNext or MovePrevious methods.
MediaStateChanged | Raised when the media player play state changes.

Expand image See Also

Reference

MediaPlayer Class
Microsoft.Xna.Framework.Media Namespace


MediaPlayer Methods

MediaPlayer Methods

Expand image Public Methods

Name | Description
GetVisualizationData | Retrieves visualization (frequency and sample) data for the currently-playing song.
MoveNext | Moves to the next song in the queue of playing songs.
MovePrevious | Moves to the previous song in the queue of playing songs.
Pause | Pauses the currently playing song.
Play | Overloaded. Plays a song or collection of songs.
Resume | Resumes a paused song.
Stop | Stops playing a song.

Expand image See Also

Reference

MediaPlayer Class
Microsoft.Xna.Framework.Media Namespace


MediaPlayer.GetVisualizationData Method

MediaPlayer.GetVisualizationData Method
See Also Example
CollapseAll image

Retrieves visualization (frequency and sample) data for the currently-playing song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void GetVisualizationData (
         VisualizationData visualizationData
)

Parameters

visualizationData
Visualization (frequency and sample) data for the currently playing song.

Expand image Remarks

Visualization data can be used to create visualizers, which are graphical representations of sound. For example, a simple visualizer might be an equalizer spectrum display that shows the current power level for each frequency band.

The frequency data is a collection of float values. Each element corresponds to a frequency band, ranging from 20Hz to 20KHz. In the collection, the distribution of bands from 20Hz to 20KHz is logarithmic, not linear. This means that elements at the lower end of the spectrum represent a smaller frequency range than those at the upper end of the spectrum.

Each value in the frequency collection is a normalized float value from 0.0f to 1.0f, and is the logarithmic scaled power level for that frequency band. Frequency is perceived as pitch.

Information returned from the GetVisualizationData method can determine if a sound is more of a higher pitch, or more of a lower pitch. This information can be useful when determining how the sounds might drive game play.

Windows Phone Specific Information

Visualization data is not available on Windows Phone. Any attempt to get visualization data on the phone will populate the VisualizationData class with 0s.

The Complete Sample

The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.

Download Spectrum.zip.

Expand image Example

The following example demonstrates using frequency and sample data to display the frequency power spectrum and waveform of the currently playing song. The program display is in landscape mode.

C#
if (MediaPlayer.State == MediaState.Playing)
{
    MediaPlayer.GetVisualizationData(visData);
}
...
    spritebatch.Begin();
    for (int y = 0; y < arraySize; y++)
    {
        // Draw frequency spectrum display.
        spritebatch.Draw(
            line,
            new Vector2((float)((-1.0 + visData.Frequencies[y]) * width + 1), y),
            Color.White);

        // Draw waveform from samples.
        spritebatch.Draw(
            line,
            new Vector2((float)(visData.Samples[y] * width / 4 + width * 3 / 4), y),
            sampleLine,
            Color.White);
    }
    spriteBatch.End();

Expand image See Also

Reference

MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.MoveNext Method

MediaPlayer.MoveNext Method

Moves to the next song in the queue of playing songs.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void MoveNext ()

Expand image Remarks

If the current song is the last song in the queue, MoveNext moves to the first song in the queue.

MoveNext does not alter the current media state (playing, paused, or stopped).

Expand image See Also

Reference

MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.MovePrevious Method

MediaPlayer.MovePrevious Method

Moves to the previous song in the queue of playing songs.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void MovePrevious ()

Expand image Remarks

If the current song is the first song in the queue, MovePrevious moves to the last song in the queue.

MovePrevious does not alter the current media state (playing, paused, or stopped).

Expand image See Also

Reference

MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.Pause Method

MediaPlayer.Pause Method

Pauses the currently playing song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Pause ()

Expand image See Also

Reference

MediaPlayer.Play Method
MediaPlayer.Resume Method
MediaPlayer.Stop Method
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.Play Method

MediaPlayer.Play Method

Plays a song or collection of songs.

Expand image Overload List

Name | Description
MediaPlayer.Play (Song) | Plays a Song.
MediaPlayer.Play (SongCollection) | Plays a SongCollection.
MediaPlayer.Play (SongCollection, Int32) | Plays a SongCollection, starting with the Song at the specified index.

Expand image See Also

Tasks

Playing a Song

Reference

MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace


MediaPlayer.Play Method (Song)

MediaPlayer.Play Method (Song)
See Also
CollapseAll image

Plays a Song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Play (
         Song song
)

Parameters

song
Song to play.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | song is null.

Expand image Remarks

Play clears the current playback queue, and then queues up the specified song for playback. Playback starts immediately at the beginning of the song.

Expand image See Also

Tasks

Playing a Song

Reference

MediaPlayer.Play Method
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.Play Method (SongCollection)

MediaPlayer.Play Method (SongCollection)
See Also
CollapseAll image

Plays a SongCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Play (
         SongCollection songs
)

Parameters

songs
SongCollection to play.

Expand image Exceptions

Exception type | Condition
ArgumentException | Play cannot be used when the song collection count is zero.
ArgumentNullException | songs is null.

Expand image Remarks

Play clears the current playback queue, and then queues up the specified song collection for playback. It begins with the first song in the collection. Playback starts immediately at the beginning of the song.

Expand image See Also

Tasks

Playing a Song

Reference

MediaPlayer.Play Method
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.Play Method (SongCollection, Int32)

MediaPlayer.Play Method (SongCollection, Int32)
See Also
CollapseAll image

Plays a SongCollection, starting with the Song at the specified index.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Play (
         SongCollection songs,
         int index
)

Parameters

songs
SongCollection to play.
index
Index of the song in the collection at which playback should begin.

Expand image Exceptions

Exception type | Condition
ArgumentException | Play cannot be used when the song collection count is zero.
ArgumentNullException | songs is null.
ArgumentOutOfRangeException | index must be valid for the current collection.

Expand image Remarks

Play clears the current playback queue, and then queues up the specified song collection for playback. It begins with the song at the specified index in the collection. Playback starts immediately at the beginning of the song.

Expand image See Also

Tasks

Playing a Song

Reference

MediaPlayer.Play Method
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.Resume Method

MediaPlayer.Resume Method

Resumes a paused song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Resume ()

Expand image See Also

Reference

MediaPlayer.Play Method
MediaPlayer.Pause Method
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.Stop Method

MediaPlayer.Stop Method

Stops playing a song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static void Stop ()

Expand image See Also

Reference

MediaPlayer.Play Method
MediaPlayer.Pause Method
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer Properties

MediaPlayer Properties

Expand image Public Properties

Name | Description
GameHasControl | Determines whether the game has control of the background music.
IsMuted | Gets or set the muted setting for the media player.
IsRepeating | Gets or sets the repeat setting for the media player.
IsShuffled | Gets or sets the shuffle setting for the media player.
IsVisualizationEnabled | Gets or sets the visualization enabled setting for the media player.
PlayPosition | Gets the play position within the currently playing song.
Queue | Gets the media playback queue, MediaQueue.
State | Gets the media playback state, MediaState.
Volume | Gets or sets the media player volume.

Expand image See Also

Reference

MediaPlayer Class
Microsoft.Xna.Framework.Media Namespace


MediaPlayer.GameHasControl Property

MediaPlayer.GameHasControl Property

Determines whether the game has control of the background music.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool GameHasControl { get; }

Property Value

true if the game has control of the background music; otherwise, false.

Expand image Remarks

A gamer can play his or her own music as the background to your game by using the Xbox 360 dashboard. If the game is currently playing custom background music (specified by the gamer using the Xbox 360 dashboard), calls to Play, Stop, Pause, Resume, MoveNext, and MovePrevious have no effect.

Expand image See Also

Reference

MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.IsMuted Property

MediaPlayer.IsMuted Property

Gets or set the muted setting for the media player.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool IsMuted { get; set; }

Property Value

true if sound is muted; false otherwise.

Expand image See Also

Reference

MediaPlayer.Volume Property
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.IsRepeating Property

MediaPlayer.IsRepeating Property

Gets or sets the repeat setting for the media player.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool IsRepeating { get; set; }

Property Value

true if the current play queue is set to repeat; false otherwise.

Expand image Remarks

When IsRepeating is true, the playback queue will begin playing again after all songs in the queue have been played.

Expand image See Also

Reference

MediaPlayer.IsShuffled Property
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.IsShuffled Property

MediaPlayer.IsShuffled Property

Gets or sets the shuffle setting for the media player.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool IsShuffled { get; set; }

Property Value

true if the current play queue is set to shuffled; false otherwise.

Expand image Remarks

When IsShuffled is true, songs in the playback queue are played in random order rather than from first to last.

Expand image See Also

Reference

MediaPlayer.IsRepeating Property
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.IsVisualizationEnabled Property

MediaPlayer.IsVisualizationEnabled Property

Gets or sets the visualization enabled setting for the media player.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool IsVisualizationEnabled { get; set; }

Property Value

true if visualization is enabled; false otherwise.

Expand image Remarks

When IsVisualizationEnabled is true, visualization data is enabled and GetVisualizationData will return visualization data for the currently playing song.

Windows Phone Specific Information

Visualization data is not available on Windows Phone. Any attempt to get visualization data on the phone will populate the VisualizationData class with 0s.

Expand image See Also

Reference

MediaPlayer.GetVisualizationData Method
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.PlayPosition Property

MediaPlayer.PlayPosition Property

Gets the play position within the currently playing song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static TimeSpan PlayPosition { get; }

Property Value

Play position within the current song, as a TimeSpan structure.

Expand image See Also

Reference

MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.Queue Property

MediaPlayer.Queue Property

Gets the media playback queue, MediaQueue.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static MediaQueue Queue { get; }

Property Value

The media playback queue, MediaQueue.

Expand image See Also

Reference

MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.State Property

MediaPlayer.State Property

Gets the media playback state, MediaState.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static MediaState State { get; }

Property Value

The media playback state, MediaState.

Expand image See Also

Reference

MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.Volume Property

MediaPlayer.Volume Property

Gets or sets the media player volume.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static float Volume { get; set; }

Property Value

Media player volume, from 0.0f (silence) to 1.0f (full volume relative to the current device volume).

Expand image Remarks

Volume adjustment is based on a decibel, not multiplicative, scale. For example, when the device volume is half of maximum (about 7 in the Zune user interface), setting Volume to 0.6f or less is silent or nearly so, not volume 4 as you would expect from a multiplicative adjustment.

Setting Volume to 0.0 subtracts 96 dB from the volume. Setting Volume to 1.0 subtracts 0 dB from the volume. Values in between 0.0f and 1.0f subtract dB from the volume proportionally.

Expand image See Also

Reference

MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer Events

MediaPlayer Events

Expand image Public Events

Name | Description
ActiveSongChanged | Raised when the active song changes due to active playback or due to explicit calls to the MoveNext or MovePrevious methods.
MediaStateChanged | Raised when the media player play state changes.

Expand image See Also

Reference

MediaPlayer Class
Microsoft.Xna.Framework.Media Namespace


MediaPlayer.ActiveSongChanged Event

MediaPlayer.ActiveSongChanged Event

Raised when the active song changes due to active playback or due to explicit calls to the MoveNext or MovePrevious methods.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static event EventHandler<EventArgs> ActiveSongChanged

Expand image See Also

Reference

MediaPlayer Class
MediaPlayer Members
MoveNext
MovePrevious
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaPlayer.MediaStateChanged Event

MediaPlayer.MediaStateChanged Event

Raised when the media player play state changes.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static event EventHandler<EventArgs> MediaStateChanged

Expand image See Also

Reference

MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaQueue Class

MediaQueue Class
See Also Members
CollapseAll image

Provides methods and properties to access and control the queue of playing songs.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class MediaQueue

Expand image Remarks

MediaQueue provides properties and methods that query and control the queue of playing songs. The ActiveSong property returns the currently playing Song. ActiveSongIndex gets or set the queue index of the currently playing song. Count returns the number of songs in the queue. The Item indexer returns the Song at the specified index in the queue.

MediaQueue is a read-only queue of songs. With MediaQueue, you can control which song is playing in the queue, but you cannot add or remove songs from the queue. Either MediaPlayer.Play or the songs already queued up when the game starts determine the songs that are in the queue of playing songs.

Note

All of the collections, playlists, and queues returned by methods and properties in the Microsoft.Xna.Framework.Media namespace are immutable. You cannot add or remove objects from those collections or playlists. To create a custom 'playlist' of songs, games must maintain their own list of songs to play, and play those songs one at a time by calling MediaPlayer.Play.

Expand image See Also

Reference

MediaPlayer.Play Method
MediaQueue Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaQueue Members

MediaQueue Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the MediaQueue type.

Expand image Public Properties

 | Name | Description
Public Property | ActiveSong | Gets the current Song in the queue of playing songs.
Public Property | ActiveSongIndex | Gets or sets the index of the current (active) song in the queue of playing songs.
Public Property | Count | Gets the count of songs in the MediaQueue.
Public Property | Item | Gets the Song at the specified index in the MediaQueue.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MediaQueue Class
Microsoft.Xna.Framework.Media Namespace


MediaQueue Properties

MediaQueue Properties

Expand image Public Properties

 | Name | Description
Public Property | ActiveSong | Gets the current Song in the queue of playing songs.
Public Property | ActiveSongIndex | Gets or sets the index of the current (active) song in the queue of playing songs.
Public Property | Count | Gets the count of songs in the MediaQueue.
Public Property | Item | Gets the Song at the specified index in the MediaQueue.

Expand image See Also

Reference

MediaQueue Class
Microsoft.Xna.Framework.Media Namespace


MediaQueue.ActiveSong Property

MediaQueue.ActiveSong Property

Gets the current Song in the queue of playing songs.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Song ActiveSong { get; }

Property Value

Current Song in the queue of playing songs.

Expand image Remarks

Retrieving this property is expensive on Xbox, so it should not be called every frame.

Expand image See Also

Reference

MediaQueue.ActiveSongIndex Property
MediaQueue Class
MediaQueue Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaQueue.ActiveSongIndex Property

MediaQueue.ActiveSongIndex Property

Gets or sets the index of the current (active) song in the queue of playing songs.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int ActiveSongIndex { get; set; }

Property Value

Index of the current song in the queue of playing songs.

Expand image Remarks

Changing the active song index does not alter the current media state (playing, paused, or stopped).

Expand image See Also

Reference

MediaQueue.ActiveSong Property
MediaQueue Class
MediaQueue Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaQueue.Count Property

MediaQueue.Count Property

Gets the count of songs in the MediaQueue.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Count of songs in this MediaQueue.

Expand image See Also

Reference

MediaQueue.ActiveSongIndex Property
MediaQueue Class
MediaQueue Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaQueue.Item Property

MediaQueue.Item Property

Gets the Song at the specified index in the MediaQueue.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Song this [
         int index
] { get; }

Property Value

A new Song representing the song at the specified index in this MediaQueue.

Expand image Remarks

Each call returns a new Song instance.

Expand image See Also

Reference

MediaQueue.ActiveSongIndex Property
MediaQueue Class
MediaQueue Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaSource Class

MediaSource Class
See Also Members
CollapseAll image

Provides methods and properties to access the source or sources from which the media will be read.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class MediaSource

Expand image Remarks

MediaSource provides access to the source or sources from which the media will be read. A source can be either the local device, or a device connected through Windows Media Connect. On Windows and Zune, the only available MediaSource is the local device. On Xbox 360, a MediaSource can either be the local device or a device connected through Windows Media Connect. Windows Media Connect is software that lets you connect your Xbox 360 console to a computer running Microsoft Windows. Connecting this way enables you to view media on the connected computer in the Xbox 360 dashboard.

Expand image See Also

Reference

MediaSource Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaSource Members

MediaSource Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the MediaSource type.

Expand image Public Properties

 | Name | Description
Public Property | MediaSourceType | Gets the MediaSourceType of this media source.
Public Property | Name | Gets the name of this media source.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
 | GetAvailableMediaSources | Gets the available media sources.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | Returns the name of this media source.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MediaSource Class
Microsoft.Xna.Framework.Media Namespace


MediaSource Methods

MediaSource Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
 | GetAvailableMediaSources | Gets the available media sources.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | Returns the name of this media source.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MediaSource Class
Microsoft.Xna.Framework.Media Namespace


MediaSource.GetAvailableMediaSources Method

MediaSource.GetAvailableMediaSources Method
See Also Example
CollapseAll image

Gets the available media sources.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static IList<MediaSource> GetAvailableMediaSources ()

Return Value

The available media sources.

Expand image Remarks

Gets the available media sources with which a media library can be constructed. On Windows Phone and Windows, this method will always return a single media source: the local device. On Xbox 360, this method can return multiple sources, depending on how many computers are connected to the Xbox 360 through Windows Media Connect.

Expand image Example

The following example demonstrates how the GetAvailableMediaSources method gets and displays the current media sources.

C#
GraphicsDevice.Clear(Color.CornflowerBlue);
Vector2 pos = Vector2.Zero;
SpriteFont font = Content.Load<SpriteFont>("Font");

spriteBatch.Begin();
spriteBatch.DrawString(font, "media source(s):", pos, Color.White);

ICollection<MediaSource> mediaSources =
    MediaSource.GetAvailableMediaSources();
foreach (MediaSource source in mediaSources)
{
    pos.Y += font.LineSpacing;
    spriteBatch.DrawString(font, source.Name, pos, Color.White);
}

spriteBatch.End();

Expand image See Also

Reference

MediaSource Class
MediaSource Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaSource.ToString Method

MediaSource.ToString Method

Returns the name of this media source.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

The name of this media source.

Expand image See Also

Reference

MediaSource Class
MediaSource Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaSource Properties

MediaSource Properties

Expand image Public Properties

 | Name | Description
Public Property | MediaSourceType | Gets the MediaSourceType of this media source.
Public Property | Name | Gets the name of this media source.

Expand image See Also

Reference

MediaSource Class
Microsoft.Xna.Framework.Media Namespace


MediaSource.MediaSourceType Property

MediaSource.MediaSourceType Property

Gets the MediaSourceType of this media source.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public MediaSourceType MediaSourceType { get; }

Property Value

The MediaSourceType of this media source.

Expand image See Also

Reference

MediaSource Class
MediaSource Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaSource.Name Property

MediaSource.Name Property

Gets the name of this media source.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The media source name.

Expand image See Also

Reference

MediaSource Class
MediaSource Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaSourceType Enumeration

MediaSourceType Enumeration

Type of the media source.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum MediaSourceType

Expand image Members

Member name | Description
LocalDevice | A local device.
WindowsMediaConnect | A Windows Media Connect device.

Expand image Remarks

Indicates the type of the current media source. The type can be either a local device, or a device connected through Windows Media Connect. On Windows and Zune, the only available media source type is the local device. On Xbox 360, a media source can be either the local device or a device connected through Windows Media Connect.

The MediaSource.MediaSourceType property returns a MediaSourceType value.

Expand image See Also

Reference

MediaSource.MediaSourceType Property
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


MediaState Enumeration

MediaState Enumeration

Media playback state (playing, paused, or stopped).

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum MediaState

Expand image Members

Member name | Description
Paused | Media playback is paused.
Playing | Media is currently playing.
Stopped | Media playback is stopped.

Expand image Remarks

The MediaPlayer.State property returns a MediaState value.

Expand image See Also

Reference

MediaPlayer.State Property
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture Class

Picture Class
See Also Members
CollapseAll image

Provides access to a picture in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class Picture : IEquatable<Picture>, IDisposable

Expand image Remarks

The Picture class provides information about a picture, including Name, Date, and Height and Width.

You can obtain a Picture object through the PictureCollection.Item indexer.

Expand image See Also

Reference

PictureCollection.Item Property
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture Members

Picture Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Picture type.

Expand image Public Properties

 | Name | Description
Public Property | Album | Gets the picture album that contains the picture.
Public Property | Date | Gets the picture's date.
Public Property | Height | Gets the picture's height.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the Picture.
Public Property | Width | Gets the picture's width.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Picture are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetImage | Returns the stream that contains the image data.
Public Method | GetThumbnail | Returns the stream that contains the picture's thumbnail image data.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Picture instances are equal.
 | op_Inequality | Determines whether the specified Picture instances are not equal.
Public Method | ToString | Returns a String representation of the Picture.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Picture Class
Microsoft.Xna.Framework.Media Namespace


Picture Methods

Picture Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Picture are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetImage | Returns the stream that contains the image data.
Public Method | GetThumbnail | Returns the stream that contains the picture's thumbnail image data.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Picture instances are equal.
 | op_Inequality | Determines whether the specified Picture instances are not equal.
Public Method | ToString | Returns a String representation of the Picture.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Picture Class
Microsoft.Xna.Framework.Media Namespace


Picture.Dispose Method

Picture.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.Equals Method

Picture.Equals Method

Determines whether two instances of Picture are equal.

Expand image Overload List

Name | Description
Picture.Equals (Object) | Determines whether the specified Object is equal to this Picture.
Picture.Equals (Picture) | Determines whether the specified Picture is equal to this Picture.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace


Picture.Equals Method (Object)

Picture.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to this Picture.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.Equals Method (Picture)

Picture.Equals Method (Picture)
See Also
CollapseAll image

Determines whether the specified Picture is equal to this Picture.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Picture other
)

Parameters

other
Picture to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.GetHashCode Method

Picture.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.GetImage Method

Picture.GetImage Method

Returns the stream that contains the image data.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Stream GetImage ()

Return Value

Stream object that contains the image data.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.GetThumbnail Method

Picture.GetThumbnail Method

Returns the stream that contains the picture's thumbnail image data.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Stream GetThumbnail ()

Return Value

Stream object that contains the thumbnail image data.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.op_Equality Method

Picture.op_Equality Method

Determines whether the specified Picture instances are equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Picture first,
         Picture second
)

Parameters

first
Object to the left of the equality operator.
second
Object to the right of the equality operator.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.op_Inequality Method

Picture.op_Inequality Method

Determines whether the specified Picture instances are not equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Picture first,
         Picture second
)

Parameters

first
Object to the left of the inequality operator.
second
Object to the right of the inequality operator.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.ToString Method

Picture.ToString Method

Returns a String representation of the Picture.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture Properties

Picture Properties

Expand image Public Properties

 | Name | Description
Public Property | Album | Gets the picture album that contains the picture.
Public Property | Date | Gets the picture's date.
Public Property | Height | Gets the picture's height.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the Picture.
Public Property | Width | Gets the picture's width.

Expand image See Also

Reference

Picture Class
Microsoft.Xna.Framework.Media Namespace


Picture.Album Property

Picture.Album Property

Gets the picture album that contains the picture.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PictureAlbum Album { get; }

Property Value

PictureAlbum that contains this picture.

Expand image See Also

Reference

PictureAlbum Class
Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.Date Property

Picture.Date Property

Gets the picture's date.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public DateTime Date { get; }

Property Value

Date and time associated with the picture's file, as a DateTime structure.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.Height Property

Picture.Height Property

Gets the picture's height.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Height { get; }

Property Value

Height of this picture, in pixels.

Expand image See Also

Reference

Picture.Width Property
Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.IsDisposed Property

Picture.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.Name Property

Picture.Name Property

Gets the name of the Picture.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this Picture.

Expand image See Also

Reference

Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Picture.Width Property

Picture.Width Property

Gets the picture's width.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Width { get; }

Property Value

Width of this picture, in pixels.

Expand image See Also

Reference

Picture.Height Property
Picture Class
Picture Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum Class

PictureAlbum Class
See Also Members
CollapseAll image

Provides access to a picture album in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class PictureAlbum : IEquatable<PictureAlbum>, IDisposable

Expand image Remarks

The PictureAlbum class provides information about a picture album, including the picture album's Name, Pictures, and Parent.

A PictureAlbum can contain both pictures and other picture albums.

Obtain PictureAlbum objects through the PictureAlbumCollection.Item indexer.

Expand image See Also

Reference

PictureAlbumCollection.Item Property
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum Members

PictureAlbum Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the PictureAlbum type.

Expand image Public Properties

 | Name | Description
Public Property | Albums | Gets the collection of picture albums that are contained within the picture album (that is, picture albums that are children of the picture album).
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the PictureAlbum.
Public Property | Parent | Gets the parent picture album.
Public Property | Pictures | Gets the collection of pictures in this picture album.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of PictureAlbum are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified PictureAlbum instances are equal.
 | op_Inequality | Determines whether the specified PictureAlbum instances are not equal.
Public Method | ToString | Returns a String representation of the PictureAlbum.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PictureAlbum Class
Microsoft.Xna.Framework.Media Namespace


PictureAlbum Methods

PictureAlbum Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of PictureAlbum are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified PictureAlbum instances are equal.
 | op_Inequality | Determines whether the specified PictureAlbum instances are not equal.
Public Method | ToString | Returns a String representation of the PictureAlbum.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PictureAlbum Class
Microsoft.Xna.Framework.Media Namespace


PictureAlbum.Dispose Method

PictureAlbum.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum.Equals Method

PictureAlbum.Equals Method

Determines whether two instances of PictureAlbum are equal.

Expand image Overload List

Name | Description
PictureAlbum.Equals (Object) | Determines whether the specified Object is equal to this PictureAlbum.
PictureAlbum.Equals (PictureAlbum) | Determines whether the specified PictureAlbum is equal to this PictureAlbum.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace


PictureAlbum.Equals Method (Object)

PictureAlbum.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to this PictureAlbum.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum.Equals Method (PictureAlbum)

PictureAlbum.Equals Method (PictureAlbum)
See Also
CollapseAll image

Determines whether the specified PictureAlbum is equal to this PictureAlbum.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         PictureAlbum other
)

Parameters

other
PictureAlbum to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum.GetHashCode Method

PictureAlbum.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum.op_Equality Method

PictureAlbum.op_Equality Method

Determines whether the specified PictureAlbum instances are equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         PictureAlbum first,
         PictureAlbum second
)

Parameters

first
Object to the left of the equality operator.
second
Object to the right of the equality operator.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum.op_Inequality Method

PictureAlbum.op_Inequality Method

Determines whether the specified PictureAlbum instances are not equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         PictureAlbum first,
         PictureAlbum second
)

Parameters

first
Object to the left of the inequality operator.
second
Object to the right of the inequality operator.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum.ToString Method

PictureAlbum.ToString Method

Returns a String representation of the PictureAlbum.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum Properties

PictureAlbum Properties

Expand image Public Properties

 | Name | Description
Public Property | Albums | Gets the collection of picture albums that are contained within the picture album (that is, picture albums that are children of the picture album).
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the PictureAlbum.
Public Property | Parent | Gets the parent picture album.
Public Property | Pictures | Gets the collection of pictures in this picture album.

Expand image See Also

Reference

PictureAlbum Class
Microsoft.Xna.Framework.Media Namespace


PictureAlbum.Albums Property

PictureAlbum.Albums Property

Gets the collection of picture albums that are contained within the picture album (that is, picture albums that are children of the picture album).
Windows Specific Information
Picture albums are not supported. This property always returns an empty collection.
Xbox 360 Specific Information
Picture albums are not supported. This property always returns an empty collection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PictureAlbumCollection Albums { get; }

Property Value

PictureAlbumCollection that contains the picture albums that are children of this picture album.

Expand image Remarks

A PictureAlbum can contain pictures as well as other picture albums. This property returns the collection of picture albums that are contained within this picture album, if any. If this picture album has no child picture albums, an empty collection is returned.

Expand image See Also

Reference

PictureAlbumCollection Class
PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum.IsDisposed Property

PictureAlbum.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum.Name Property

PictureAlbum.Name Property

Gets the name of the PictureAlbum.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this PictureAlbum.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum.Parent Property

PictureAlbum.Parent Property

Gets the parent picture album.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PictureAlbum Parent { get; }

Property Value

PictureAlbum that is the parent of this picture album.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbum.Pictures Property

PictureAlbum.Pictures Property

Gets the collection of pictures in this picture album.
Windows Specific Information
Picture collections are not supported. This property always returns an empty collection.
Xbox 360 Specific Information
Picture collections are not supported. This property always returns an empty collection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PictureCollection Pictures { get; }

Property Value

PictureCollection that contains the pictures in this picture album.

Expand image Remarks

A PictureAlbum can contain pictures as well as other picture albums. This property returns the collection of pictures in this picture album, if any. If this picture album has no pictures, an empty collection is returned.

Expand image See Also

Reference

PictureAlbum Class
PictureAlbum Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbumCollection Class

PictureAlbumCollection Class
See Also Members
CollapseAll image

A collection of picture albums in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class PictureAlbumCollection : IEnumerable<PictureAlbum>, IEnumerable, IDisposable

Expand image Remarks

The PictureAlbumCollection class provides access to picture albums in the device's media library.

Use the PictureAlbum.Albums property to obtain a collection of picture albums that are contained within (that is, children of) a particular picture album. Use the MediaLibrary.RootPictureAlbum property to obtain the root (top-most) picture album, which contains both pictures and other picture albums.

The PictureAlbumCollection does not immediately instantiate instances of all picture albums in the collection. Instead, individual PictureAlbum objects are created each time a picture album is accessed through the collection's Item indexer.

Expand image See Also

Reference

PictureAlbum.Albums Property
MediaLibrary.RootPictureAlbum Property
PictureAlbum Class
PictureAlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbumCollection Members

PictureAlbumCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the PictureAlbumCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of PictureAlbum objects in the PictureAlbumCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the PictureAlbum at the specified index in the PictureAlbumCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the PictureAlbumCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

PictureAlbumCollection Class
Microsoft.Xna.Framework.Media Namespace


PictureAlbumCollection Methods

PictureAlbumCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the PictureAlbumCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

PictureAlbumCollection Class
Microsoft.Xna.Framework.Media Namespace


PictureAlbumCollection.Dispose Method

PictureAlbumCollection.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

PictureAlbumCollection Class
PictureAlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbumCollection.GetEnumerator Method

PictureAlbumCollection.GetEnumerator Method

Returns an enumerator that iterates through the PictureAlbumCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public IEnumerator<PictureAlbum> GetEnumerator ()

Return Value

IEnumerator for the PictureAlbumCollection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until MoveNext is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. You cannot set Current to the first element of the collection again; you must create a new enumerator instance instead.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

PictureAlbumCollection Class
PictureAlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the collection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

IEnumerator that iterates through the collection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. Reset also brings the enumerator back to this position. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until either MoveNext or Reset is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. To set Current to the first element of the collection again, you can call Reset followed by MoveNext.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

PictureAlbumCollection Class
PictureAlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbumCollection Properties

PictureAlbumCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of PictureAlbum objects in the PictureAlbumCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the PictureAlbum at the specified index in the PictureAlbumCollection.

Expand image See Also

Reference

PictureAlbumCollection Class
Microsoft.Xna.Framework.Media Namespace


PictureAlbumCollection.Count Property

PictureAlbumCollection.Count Property

Gets the number of PictureAlbum objects in the PictureAlbumCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of PictureAlbum objects in this PictureAlbumCollection.

Expand image See Also

Reference

PictureAlbumCollection Class
PictureAlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbumCollection.IsDisposed Property

PictureAlbumCollection.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

PictureAlbumCollection Class
PictureAlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureAlbumCollection.Item Property

PictureAlbumCollection.Item Property

Gets the PictureAlbum at the specified index in the PictureAlbumCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public PictureAlbum this [
         int index
] { get; }

Property Value

A new PictureAlbum representing the picture album at the specified index in this PictureAlbumCollection.

Expand image Remarks

Each call returns a new PictureAlbum instance.

PictureAlbum resources such as the picture collection and children picture albums collection are cached in each PictureAlbum instance. Retrieving and maintaining references to multiple instances of the same picture album, and then accessing the picture collection (PictureAlbum.Pictures) or children picture albums collection (PictureAlbum.Albums) on each of those instances, creates multiple copies of the resources.

Expand image See Also

PictureAlbumCollection Class
PictureAlbumCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureCollection Class

PictureCollection Class
See Also Members
CollapseAll image

A collection of pictures in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class PictureCollection : IEnumerable<Picture>, IEnumerable, IDisposable

Expand image Remarks

The PictureCollection class provides access to pictures in the device's media library.

Use the MediaLibrary.Pictures property to obtain a collection of all pictures in the media library, and use the PictureAlbum.Pictures property to obtain a collection of pictures in a particular picture album.

The PictureCollection does not immediately instantiate instances of all pictures in the collection. Instead, individual Picture objects are created each time a picture is accessed through the collection's Item indexer. See the Remarks section of Item for the resource implications of maintaining references to multiple Picture objects.

Expand image See Also

Reference

MediaLibrary.Pictures Property
PictureAlbum.Pictures Property
Picture Class
PictureCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureCollection Members

PictureCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the PictureCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Picture objects in the PictureCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Picture at the specified index in the PictureCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the PictureCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

PictureCollection Class
Microsoft.Xna.Framework.Media Namespace


PictureCollection Methods

PictureCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the PictureCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

PictureCollection Class
Microsoft.Xna.Framework.Media Namespace


PictureCollection.Dispose Method

PictureCollection.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

PictureCollection Class
PictureCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureCollection.GetEnumerator Method

PictureCollection.GetEnumerator Method

Returns an enumerator that iterates through the PictureCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public IEnumerator<Picture> GetEnumerator ()

Return Value

IEnumerator for the PictureCollection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until MoveNext is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. You cannot set Current to the first element of the collection again; you must create a new enumerator instance instead.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

PictureCollection Class
PictureCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the collection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

IEnumerator that iterates through the collection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. Reset also brings the enumerator back to this position. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until either MoveNext or Reset is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. To set Current to the first element of the collection again, you can call Reset followed by MoveNext.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

PictureCollection Class
PictureCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureCollection Properties

PictureCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Picture objects in the PictureCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Picture at the specified index in the PictureCollection.

Expand image See Also

Reference

PictureCollection Class
Microsoft.Xna.Framework.Media Namespace


PictureCollection.Count Property

PictureCollection.Count Property

Gets the number of Picture objects in the PictureCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of Picture objects in this PictureCollection.

Expand image See Also

Reference

PictureCollection Class
PictureCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureCollection.IsDisposed Property

PictureCollection.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

PictureCollection Class
PictureCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PictureCollection.Item Property

PictureCollection.Item Property

Gets the Picture at the specified index in the PictureCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Picture this [
         int index
] { get; }

Property Value

A new Picture representing the picture at the specified index in this PictureCollection.

Expand image Remarks

Each call returns a new Picture instance.

Picture resources such as the picture texture and thumbnail are cached in each Picture instance. Retrieving and maintaining references to multiple instances of the same picture, and then accessing the picture texture or thumbnail on each of those instances, creates multiple copies of the texture or thumbnail.

Expand image See Also

Reference

PictureCollection Class
PictureCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist Class

Playlist Class
See Also Members
CollapseAll image

Provides access to a playlist in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class Playlist : IEquatable<Playlist>, IDisposable

Expand image Remarks

The Playlist class provides information about a playlist, including the playlist's Name, Duration, and Songs.

Obtain Playlist objects through the PlaylistCollection.Item indexer.

Expand image See Also

Reference

PlaylistCollection.Item Property
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist Members

Playlist Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Playlist type.

Expand image Public Properties

 | Name | Description
Public Property | Duration | Gets the duration of the Playlist.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the Playlist.
Public Property | Songs | Gets a SongCollection that contains the songs in the playlist.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Playlist are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Playlist instances are equal.
 | op_Inequality | Determines whether the specified Playlist instances are not equal.
Public Method | ToString | Returns a String representation of the Playlist.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Playlist Class
Microsoft.Xna.Framework.Media Namespace


Playlist Methods

Playlist Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Playlist are equal.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Playlist instances are equal.
 | op_Inequality | Determines whether the specified Playlist instances are not equal.
Public Method | ToString | Returns a String representation of the Playlist.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Playlist Class
Microsoft.Xna.Framework.Media Namespace


Playlist.Dispose Method

Playlist.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist.Equals Method

Playlist.Equals Method

Determines whether two instances of Playlist are equal.

Expand image Overload List

Name | Description
Playlist.Equals (Object) | Determines whether the specified Object is equal to this Playlist.
Playlist.Equals (Playlist) | Determines whether the specified Playlist is equal to this Playlist.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace


Playlist.Equals Method (Object)

Playlist.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to this Playlist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist.Equals Method (Playlist)

Playlist.Equals Method (Playlist)
See Also
CollapseAll image

Determines whether the specified Playlist is equal to this Playlist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Playlist other
)

Parameters

other
Playlist to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist.GetHashCode Method

Playlist.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist.op_Equality Method

Playlist.op_Equality Method

Determines whether the specified Playlist instances are equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Playlist first,
         Playlist second
)

Parameters

first
Object to the left of the equality operator.
second
Object to the right of the equality operator.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist.op_Inequality Method

Playlist.op_Inequality Method

Determines whether the specified Playlist instances are not equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Playlist first,
         Playlist second
)

Parameters

first
Object to the left of the inequality operator.
second
Object to the right of the inequality operator.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist.ToString Method

Playlist.ToString Method

Returns a String representation of the Playlist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist Properties

Playlist Properties

Expand image Public Properties

 | Name | Description
Public Property | Duration | Gets the duration of the Playlist.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Name | Gets the name of the Playlist.
Public Property | Songs | Gets a SongCollection that contains the songs in the playlist.

Expand image See Also

Reference

Playlist Class
Microsoft.Xna.Framework.Media Namespace


Playlist.Duration Property

Playlist.Duration Property

Gets the duration of the Playlist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TimeSpan Duration { get; }

Property Value

Duration of the playlist, as a TimeSpan structure.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist.IsDisposed Property

Playlist.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist.Name Property

Playlist.Name Property

Gets the name of the Playlist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this Playlist.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Playlist.Songs Property

Playlist.Songs Property

Gets a SongCollection that contains the songs in the playlist.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public SongCollection Songs { get; }

Property Value

SongCollection containing the songs in this playlist.

Expand image See Also

Reference

Playlist Class
Playlist Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PlaylistCollection Class

PlaylistCollection Class
See Also Members
CollapseAll image

A collection of playlists in the media library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class PlaylistCollection : IEnumerable<Playlist>, IEnumerable, IDisposable

Expand image Remarks

The PlaylistCollection class provides access to playlists in the device's media library.

Use the MediaLibrary.Playlists property to obtain a collection of all playlists in the media library.

The PlaylistCollection does not immediately instantiate instances of all playlists in the collection. Instead, individual Playlist objects are created each time a playlist is accessed through the collection's Item indexer.

Expand image See Also

Reference

MediaLibrary.Songs Property
Song Class
PlaylistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PlaylistCollection Members

PlaylistCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the PlaylistCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Playlist objects in the PlaylistCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Playlist at the specified index in the PlaylistCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the PlaylistCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

PlaylistCollection Class
Microsoft.Xna.Framework.Media Namespace


PlaylistCollection Methods

PlaylistCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the PlaylistCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

PlaylistCollection Class
Microsoft.Xna.Framework.Media Namespace


PlaylistCollection.Dispose Method

PlaylistCollection.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

PlaylistCollection Class
PlaylistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PlaylistCollection.GetEnumerator Method

PlaylistCollection.GetEnumerator Method

Returns an enumerator that iterates through the PlaylistCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public IEnumerator<Playlist> GetEnumerator ()

Return Value

IEnumerator for the PlaylistCollection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until MoveNext is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. You cannot set Current to the first element of the collection again; you must create a new enumerator instance instead.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

PlaylistCollection Class
PlaylistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the collection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

IEnumerator that iterates through the collection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. Reset also brings the enumerator back to this position. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until either MoveNext or Reset is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. To set Current to the first element of the collection again, you can call Reset followed by MoveNext.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

PlaylistCollection Class
PlaylistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PlaylistCollection Properties

PlaylistCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Playlist objects in the PlaylistCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Playlist at the specified index in the PlaylistCollection.

Expand image See Also

Reference

PlaylistCollection Class
Microsoft.Xna.Framework.Media Namespace


PlaylistCollection.Count Property

PlaylistCollection.Count Property

Gets the number of Playlist objects in the PlaylistCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of Playlist objects in this PlaylistCollection.

Expand image See Also

Reference

PlaylistCollection Class
PlaylistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PlaylistCollection.IsDisposed Property

PlaylistCollection.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

PlaylistCollection Class
PlaylistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


PlaylistCollection.Item Property

PlaylistCollection.Item Property

Gets the Playlist at the specified index in the PlaylistCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Playlist this [
         int index
] { get; }

Property Value

A new Playlist representing the playlist at the specified index in this PlaylistCollection.

Expand image Remarks

Each call returns a new Playlist instance.

The SongCollection returned by Songs is allocated and cached by each Playlist instance. Retrieving and maintaining references to multiple instances of the same playlist, and then accessing the song collection on each of those instances, creates multiple copies of the song collection.

Expand image See Also

Reference

PlaylistCollection Class
PlaylistCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song Class

Song Class
See Also Members
CollapseAll image

Provides access to a song in the song library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class Song : IEquatable<Song>, IDisposable

Expand image Remarks

The Song class provides information about a song, including the song's Name, Artist, and Album.

You can obtain a Song object through the SongCollection.Item indexer and the MediaQueue.ActiveSong property.

Expand image See Also

Reference

SongCollection.Item Property
MediaQueue.ActiveSong Property
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song Members

Song Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the Song type.

Expand image Public Properties

 | Name | Description
Public Property | Album | Gets the Album on which the Song appears.
Public Property | Artist | Gets the Artist of the Song.
Public Property | Duration | Gets the duration of the Song.
Public Property | Genre | Gets the Genre of the Song.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | IsProtected | Gets a value that indicates whether the song is DRM protected content.
Public Property | IsRated | Gets a value that indicates whether the song has been rated by the user.
Public Property | Name | Gets the name of the Song.
Public Property | PlayCount | Gets the song play count.
Public Property | Rating | Gets the user's rating for the Song.
Public Property | TrackNumber | Gets the track number of the song on the song's Album.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Song are equal.
 | FromUri | Constructs a new Song object based on the specified URI.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Song instances are equal.
 | op_Inequality | Determines whether the specified Song instances are not equal.
Public Method | ToString | Returns a String representation of the Song.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Song Class
Microsoft.Xna.Framework.Media Namespace


Song Methods

Song Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | Overloaded. Determines whether two instances of Song are equal.
 | FromUri | Constructs a new Song object based on the specified URI.
Public Method | GetHashCode | Gets the hash code for this instance.
Public Method | GetType | (Inherited from Object.)
 | op_Equality | Determines whether the specified Song instances are equal.
 | op_Inequality | Determines whether the specified Song instances are not equal.
Public Method | ToString | Returns a String representation of the Song.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Song Class
Microsoft.Xna.Framework.Media Namespace


Song.Dispose Method

Song.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.Equals Method

Song.Equals Method

Determines whether two instances of Song are equal.

Expand image Overload List

Name | Description
Song.Equals (Object) | Determines whether the specified Object is equal to this Song.
Song.Equals (Song) | Determines whether the specified Song is equal to this Song.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace


Song.Equals Method (Object)

Song.Equals Method (Object)
See Also
CollapseAll image

Determines whether the specified Object is equal to this Song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override bool Equals (
         Object obj
)

Parameters

obj
Object to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.Equals Method (Song)

Song.Equals Method (Song)
See Also
CollapseAll image

Determines whether the specified Song is equal to this Song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool Equals (
         Song other
)

Parameters

other
Song to compare with this instance.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.FromUri Method

Song.FromUri Method

Constructs a new Song object based on the specified URI.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static Song FromUri (
         string name,
         Uri uri
)

Parameters

name
Name of the song.
uri
Uri object that represents the URI.

Return Value

Song object that can be used to play the song remotely.

Expand image See Also

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.GetHashCode Method

Song.GetHashCode Method

Gets the hash code for this instance.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override int GetHashCode ()

Return Value

Hash code for this object.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.op_Equality Method

Song.op_Equality Method

Determines whether the specified Song instances are equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Equality (
         Song first,
         Song second
)

Parameters

first
Object to the left of the equality operator.
second
Object to the right of the equality operator.

Return Value

true if the objects are equal; false otherwise.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.op_Inequality Method

Song.op_Inequality Method

Determines whether the specified Song instances are not equal.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public static bool op_Inequality (
         Song first,
         Song second
)

Parameters

first
Object to the left of the inequality operator.
second
Object to the right of the inequality operator.

Return Value

true if the objects are not equal; false otherwise.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.ToString Method

Song.ToString Method

Returns a String representation of the Song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

String representation of this object.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song Properties

Song Properties

Expand image Public Properties

 | Name | Description
Public Property | Album | Gets the Album on which the Song appears.
Public Property | Artist | Gets the Artist of the Song.
Public Property | Duration | Gets the duration of the Song.
Public Property | Genre | Gets the Genre of the Song.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | IsProtected | Gets a value that indicates whether the song is DRM protected content.
Public Property | IsRated | Gets a value that indicates whether the song has been rated by the user.
Public Property | Name | Gets the name of the Song.
Public Property | PlayCount | Gets the song play count.
Public Property | Rating | Gets the user's rating for the Song.
Public Property | TrackNumber | Gets the track number of the song on the song's Album.

Expand image See Also

Reference

Song Class
Microsoft.Xna.Framework.Media Namespace


Song.Album Property

Song.Album Property

Gets the Album on which the Song appears.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Album Album { get; }

Property Value

Album on which this Song appears.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.Artist Property

Song.Artist Property

Gets the Artist of the Song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Artist Artist { get; }

Property Value

Artist of this Song.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.Duration Property

Song.Duration Property

Gets the duration of the Song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TimeSpan Duration { get; }

Property Value

Duration of the song, as a TimeSpan structure.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.Genre Property

Song.Genre Property

Gets the Genre of the Song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Genre Genre { get; }

Property Value

Genre of this Song.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.IsDisposed Property

Song.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.IsProtected Property

Song.IsProtected Property

Gets a value that indicates whether the song is DRM protected content.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsProtected { get; }

Property Value

true if this Song is DRM protected; false otherwise.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.IsRated Property

Song.IsRated Property

Gets a value that indicates whether the song has been rated by the user.
Xbox 360 Specific Information

Song information is not supported. This property is always set to false.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsRated { get; }

Property Value

true if this Song has been rated by the user; false otherwise.

Expand image See Also

Reference

Song.Rating Property
Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.Name Property

Song.Name Property

Gets the name of the Song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The name of this Song.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.PlayCount Property

Song.PlayCount Property

Gets the song play count.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int PlayCount { get; }

Property Value

Song play count.

Expand image See Also

Reference

Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.Rating Property

Song.Rating Property

Gets the user's rating for the Song.
Xbox 360 Specific Information
Album information is not supported. This value is always 0.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Rating { get; }

Property Value

User's rating for this Song, or 0 if the song is unrated.

Ratings range from 1 (dislike the most) to 10 (like the most).

When the user rates songs using the Zune device or Zune software, the rating is set to 8 for liked songs (shown as a heart) and to 2 or 3 for disliked songs (shown as a broken heart).

Expand image See Also

Reference

Song.IsRated Property
Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Song.TrackNumber Property

Song.TrackNumber Property

Gets the track number of the song on the song's Album.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int TrackNumber { get; }

Property Value

Track number of this Song on the song's Album.

Expand image See Also

Reference

Album Class
Song Class
Song Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SongCollection Class

SongCollection Class
See Also Members
CollapseAll image

A collection of songs in the song library.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class SongCollection : IEnumerable<Song>, IEnumerable, IDisposable

Expand image Remarks

The SongCollection class provides access to songs in the device's song library.

Use the MediaLibrary.Songs property to obtain the following collections:

  • All songs in the media library.
  • Songs on a particular album.
  • Songs associated with a particular artist.
  • Songs associated with a particular genre.

The SongCollection does not immediately instantiate instances of all songs in the collection. Instead, individual Song objects are created each time a user accesses a song through the collection's Item indexer. See the Remarks section of Item for the resource implications of maintaining references to multiple Song objects.

Note

All of the collections, playlists, and queues returned by methods and properties in the Microsoft.Xna.Framework.Media namespace are immutable. You cannot add or remove objects from those collections or playlists. To create a custom 'playlist' of songs, games must maintain their own list of songs to play, and play those songs one at a time by calling MediaPlayer.Play.

Expand image See Also

Reference

MediaLibrary.Songs Property
Album.Songs Property
Artist.Songs Property
Genre.Songs Property
Song Class
SongCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SongCollection Members

SongCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the SongCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Song objects in the SongCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Song at the specified index in the SongCollection.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the SongCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

SongCollection Class
Microsoft.Xna.Framework.Media Namespace


SongCollection Methods

SongCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the SongCollection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection.

Expand image See Also

Reference

SongCollection Class
Microsoft.Xna.Framework.Media Namespace


SongCollection.Dispose Method

SongCollection.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

SongCollection Class
SongCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SongCollection.GetEnumerator Method

SongCollection.GetEnumerator Method

Returns an enumerator that iterates through the SongCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public IEnumerator<Song> GetEnumerator ()

Return Value

IEnumerator for the SongCollection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until MoveNext is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. You cannot set Current to the first element of the collection again; you must create a new enumerator instance instead.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

SongCollection Class
SongCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the collection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

IEnumerator that iterates through the collection.

Expand image Remarks

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. Therefore, using foreach instead of directly manipulating the enumerator is recommended.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection. Reset also brings the enumerator back to this position. At this position, Current is undefined. You must call MoveNext to advance the enumerator to the first element of the collection before reading the value of Current.

Current returns the same object until either MoveNext or Reset is called. MoveNext sets Current to the next element.

If MoveNext passes the end of the collection, the enumerator is positioned after the last element in the collection and MoveNext returns false. When the enumerator is at this position, subsequent calls to MoveNext also return false. If the last call to MoveNext returned false, Current is undefined. To set Current to the first element of the collection again, you can call Reset followed by MoveNext.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

The enumerator does not have exclusive access to the collection; enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

This method is an O(1) operation.

Expand image See Also

Reference

SongCollection Class
SongCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SongCollection Properties

SongCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of Song objects in the SongCollection.
Public Property | IsDisposed | Gets a value indicating whether the object is disposed.
Public Property | Item | Gets the Song at the specified index in the SongCollection.

Expand image See Also

Reference

SongCollection Class
Microsoft.Xna.Framework.Media Namespace


SongCollection.Count Property

SongCollection.Count Property

Gets the number of Song objects in the SongCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of Song objects in this SongCollection.

Expand image See Also

Reference

SongCollection Class
SongCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SongCollection.IsDisposed Property

SongCollection.IsDisposed Property

Gets a value indicating whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

SongCollection Class
SongCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


SongCollection.Item Property

SongCollection.Item Property

Gets the Song at the specified index in the SongCollection.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Song this [
         int index
] { get; }

Property Value

A new Song representing the song at the specified index in this SongCollection.

Expand image Remarks

Each call returns a new Song instance.

Song resources such as the album, artist, and genre are cached in each Song instance. Retrieving and maintaining references to multiple instances of the same song, and then accessing the album, artist, or genre on each of those instances, creates multiple copies of the album, artist, or genre.

Expand image See Also

Reference

SongCollection Class
SongCollection Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Video Class

Video Class
See Also Members
CollapseAll image

Represents a video.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class Video

Expand image See Also

Reference

Video Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Video Members

Video Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the Video type.

Expand image Public Properties

 | Name | Description
Public Property | Duration | Gets the duration of the Video.
Public Property | FramesPerSecond | Gets the frame rate of this video.
Public Property | Height | Gets the height of this video, in pixels.
Public Property | VideoSoundtrackType | Gets the VideoSoundtrackType for this video.
Public Property | Width | Gets the width of this video, in pixels.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Video Class
Microsoft.Xna.Framework.Media Namespace


Video Properties

Video Properties

Expand image Public Properties

 | Name | Description
Public Property | Duration | Gets the duration of the Video.
Public Property | FramesPerSecond | Gets the frame rate of this video.
Public Property | Height | Gets the height of this video, in pixels.
Public Property | VideoSoundtrackType | Gets the VideoSoundtrackType for this video.
Public Property | Width | Gets the width of this video, in pixels.

Expand image See Also

Reference

Video Class
Microsoft.Xna.Framework.Media Namespace


Video.Duration Property

Video.Duration Property

Gets the duration of the Video.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TimeSpan Duration { get; }

Property Value

Duration of the video, as a TimeSpan structure.

Expand image See Also

Reference

Video Class
Video Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Video.FramesPerSecond Property

Video.FramesPerSecond Property

Gets the frame rate of this video.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float FramesPerSecond { get; }

Property Value

The number of frames this video displays per second.

Expand image Remarks

24, 30, and 29.97 are common frame rates.

Expand image See Also

Reference

Video Class
Video Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Video.Height Property

Video.Height Property

Gets the height of this video, in pixels.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Height { get; }

Property Value

The height of this video, in pixels.

Expand image See Also

Reference

Video Class
Video Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Video.VideoSoundtrackType Property

Video.VideoSoundtrackType Property

Gets the VideoSoundtrackType for this video.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public VideoSoundtrackType VideoSoundtrackType { get; }

Property Value

The type of soundtrack used in the video: dialog, music, or both.

Expand image See Also

Reference

Video Class
Video Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Video.Width Property

Video.Width Property

Gets the width of this video, in pixels.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public int Width { get; }

Property Value

The width of this video resource, in pixels.

Expand image See Also

Reference

Video Class
Video Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer Class

VideoPlayer Class
See Also Members
CollapseAll image

Provides methods and properties to play back, pause, resume, and stop video. VideoPlayer also exposes repeat, volume, and play position information.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public sealed class VideoPlayer : IDisposable

Expand image See Also

Reference

VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer Members

VideoPlayer Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the VideoPlayer type.

Expand image Public Constructors

 | Name | Description
Public Method | VideoPlayer | Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | IsLooped | Gets a value that indicates whether the player is playing video in a loop.
Public Property | IsMuted | Gets or sets the muted setting for the video player.
Public Property | PlayPosition | Gets the play position within the currently playing video.
Public Property | State | Gets the media playback state, MediaState.
Public Property | Video | Gets the Video that is currently playing.
Public Property | Volume | Gets or sets the video player volume.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetTexture | Retrieves a Texture2D containing the current frame of video being played.
Public Method | GetType | (Inherited from Object.)
Public Method | Pause | Pauses the currently playing video.
Public Method | Play | Plays a Video.
Public Method | Resume | Resumes a paused video.
Public Method | Stop | Stops playing a video.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VideoPlayer Class
Microsoft.Xna.Framework.Media Namespace


VideoPlayer Constructor

VideoPlayer Constructor

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public VideoPlayer ()

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer Methods

VideoPlayer Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetTexture | Retrieves a Texture2D containing the current frame of video being played.
Public Method | GetType | (Inherited from Object.)
Public Method | Pause | Pauses the currently playing video.
Public Method | Play | Plays a Video.
Public Method | Resume | Resumes a paused video.
Public Method | Stop | Stops playing a video.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VideoPlayer Class
Microsoft.Xna.Framework.Media Namespace


VideoPlayer.Dispose Method

VideoPlayer.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.GetTexture Method

VideoPlayer.GetTexture Method

Retrieves a Texture2D containing the current frame of video being played.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Texture2D GetTexture ()

Return Value

The current frame of video.

Expand image Remarks

Call GetTexture once per frame to get the latest video data.

Use SpriteBatch.Draw to display the video on the screen, or attach the texture to an object in 3D space to display the video as part of a scene.

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.Pause Method

VideoPlayer.Pause Method

Pauses the currently playing video.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Pause ()

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.Play Method

VideoPlayer.Play Method

Plays a Video.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Play (
         Video video
)

Parameters

video
Video to play.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | video is null.

Expand image Remarks

After calling Play, call GetTexture to get the current frame of video.

Expand image See Also

Reference

VideoPlayer Class
GetTexture
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.Resume Method

VideoPlayer.Resume Method

Resumes a paused video.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Resume ()

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.Stop Method

VideoPlayer.Stop Method

Stops playing a video.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public void Stop ()

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer Properties

VideoPlayer Properties

Expand image Public Properties

 | Name | Description
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | IsLooped | Gets a value that indicates whether the player is playing video in a loop.
Public Property | IsMuted | Gets or sets the muted setting for the video player.
Public Property | PlayPosition | Gets the play position within the currently playing video.
Public Property | State | Gets the media playback state, MediaState.
Public Property | Video | Gets the Video that is currently playing.
Public Property | Volume | Gets or sets the video player volume.

Expand image See Also

Reference

VideoPlayer Class
Microsoft.Xna.Framework.Media Namespace


VideoPlayer.IsDisposed Property

VideoPlayer.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.IsLooped Property

VideoPlayer.IsLooped Property

Gets a value that indicates whether the player is playing video in a loop.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsLooped { get; set; }

Property Value

true if the player is playing video in a loop; false otherwise.

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.IsMuted Property

VideoPlayer.IsMuted Property

Gets or sets the muted setting for the video player.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public bool IsMuted { get; set; }

Property Value

true if sound is muted; false otherwise.

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.PlayPosition Property

VideoPlayer.PlayPosition Property

Gets the play position within the currently playing video.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public TimeSpan PlayPosition { get; }

Property Value

Play position within the current song, as a TimeSpan structure.

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.State Property

VideoPlayer.State Property

Gets the media playback state, MediaState.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public MediaState State { get; }

Property Value

The media playback state, MediaState.

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.Video Property

VideoPlayer.Video Property

Gets the Video that is currently playing.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public Video Video { get; }

Property Value

The currently playing Video.

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoPlayer.Volume Property

VideoPlayer.Volume Property

Gets or sets the video player volume.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public float Volume { get; set; }

Property Value

Video player volume, from 0.0f (silence) to 1.0f (full volume relative to the current device volume).

Expand image Remarks

Volume adjustment is based on a decibel, not multiplicative, scale. For example, when the device volume is half of maximum (about 7 in the Zune user interface), setting Volume to 0.6f or less is silent or nearly so, not volume 4 as you would expect from a multiplicative adjustment.

Setting Volume to 0.0 subtracts 96 dB from the volume. Setting Volume to 1.0 subtracts 0 dB from the volume. Values in between 0.0f and 1.0f subtract dB from the volume proportionally.

Expand image See Also

Reference

VideoPlayer Class
VideoPlayer Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VideoSoundtrackType Enumeration

VideoSoundtrackType Enumeration

Type of sounds in a video

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public enum VideoSoundtrackType

Expand image Members

Member name | Description
Dialog | This video contains only dialog.
Music | This video contains only music.
MusicAndDialog | This video contains music and dialog.
Xbox 360 Specific Information
This setting has no effect on Windows. On the Xbox 360, videos with the Dialog type will have their sound mixed in with the dashboard player's playback. Videos with the Music type will be muted if the dashboard player is playing. Videos with the MusicAndDialog type will override the dashboard playback.

Expand image Remarks

A video that only contains music will be muted on playback if the MediaPlayer is playing back music.

Expand image See Also

Reference

Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


VisualizationData Class

VisualizationData Class
See Also Members
CollapseAll image

Encapsulates visualization (frequency and sample) data for the currently-playing song.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public class VisualizationData

Expand image Remarks

Windows Phone Specific Information

Visualization data is not available on Windows Phone. Any attempt to get visualization data on the phone will populate the VisualizationData class with 0s.

Expand image See Also

Reference

VisualizationData Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VisualizationData Members

VisualizationData Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the VisualizationData type.

Expand image Public Constructors

 | Name | Description
Public Method | VisualizationData | Initializes a new instance of the VisualizationData class.

Expand image Public Properties

 | Name | Description
Public Property | Frequencies | Returns a collection of floats that contain frequency data.
Public Property | Samples | Returns a collection of floats that contain sample data.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VisualizationData Class
Microsoft.Xna.Framework.Media Namespace


VisualizationData Constructor

VisualizationData Constructor

Initializes a new instance of the VisualizationData class.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public VisualizationData ()

Expand image See Also

Reference

VisualizationData Class
VisualizationData Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VisualizationData Methods

VisualizationData Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VisualizationData Class
Microsoft.Xna.Framework.Media Namespace


VisualizationData Properties

VisualizationData Properties

Expand image Public Properties

 | Name | Description
Public Property | Frequencies | Returns a collection of floats that contain frequency data.
Public Property | Samples | Returns a collection of floats that contain sample data.

Expand image See Also

Reference

VisualizationData Class
Microsoft.Xna.Framework.Media Namespace


VisualizationData.Frequencies Property

VisualizationData.Frequencies Property

Returns a collection of floats that contain frequency data.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ReadOnlyCollection<float> Frequencies { get; }

Property Value

A collection of floats that contain frequency data.

Expand image Remarks

Each value in the collection is a float value from 0.0f to 1.0f, and is the logarithmic scaled power level for that frequency band.

Expand image See Also

Reference

VisualizationData Class
VisualizationData Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


VisualizationData.Samples Property

VisualizationData.Samples Property

Returns a collection of floats that contain sample data.

Sample floats are in the range -1.0f to 1.0f, which approximate the wave form of the sound. The sample data equates to the volume of the sound.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Expand image Syntax

C#
public ReadOnlyCollection<float> Samples { get; }

Property Value

A collection of floats that contain sample data.

Expand image See Also

Reference

VisualizationData Class
VisualizationData Members
Microsoft.Xna.Framework.Media Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7


Microsoft.Xna.Framework.Net Namespace

Microsoft.Xna.Framework.Net Namespace

Contains classes that implement support for Xbox LIVE, multiplayer, and networking for XNA Framework games.

Expand image Classes

 | Name | Description
Public Class | AvailableNetworkSession | Describes a multiplayer session that can be joined.
Public Class | AvailableNetworkSessionCollection | Represents a collection of sessions available for joining.
Public Class | GameEndedEventArgs | Represents the arguments passed to a GameEnded event.
Public Class | GamerJoinedEventArgs | Represents the arguments passed to a GamerJoined event.
Public Class | GamerLeftEventArgs | Represents the arguments passed to a GamerLeft event.
Public Class | GameStartedEventArgs | Represents the arguments passed to a GameStarted event.
Public Class | HostChangedEventArgs | Represents the arguments passed to a HostChanged event.
Public Class | LocalNetworkGamer | Represents a local player in a network session.
Public Class | NetworkGamer | Represents a player in a network session.
Public Class | NetworkMachine | Represents a physical machine (such as single Xbox 360 console or Windows-based computer) that is participating in a multiplayer session. It can be used to detect when more than one NetworkGamer is playing on the same actual machine.
Public Class | NetworkSession | Represents a multiplayer game session.
Public Class | NetworkSessionEndedEventArgs | Represents the arguments passed to a SessionEnded event. These arguments are passed to event handlers when a session ends.
Public Class | NetworkSessionJoinException | Thrown if an error was encountered while joining a session.
Public Class | NetworkSessionProperties | Describes custom, game-specific information about a NetworkSession object.
Public Class | PacketReader | Provides common functionality for efficiently reading incoming network packets.
Public Class | PacketWriter | Provides common functionality for efficiently formatting outgoing network packets.
Public Class | QualityOfService | Describes the quality of the network connection between this machine and the host of a multiplayer session that was discovered with a matchmaking query.
Public Class | WriteLeaderboardsEventArgs | Represents the arguments passed to a WriteArbitratedLeaderboard. WriteUnarbitratedLeaderboard, or WriteTrueSkill event.

Expand image Enumerations

 | Name | Description
Public Enumeration | NetworkSessionEndReason | Defines the reason a session ended.
Public Enumeration | NetworkSessionJoinError | Contains additional data about a NetworkSessionJoinException.
Public Enumeration | NetworkSessionState | Defines the different states of a multiplayer session.
Public Enumeration | NetworkSessionType | Defines the different types of a multiplayer session.
Public Enumeration | SendDataOptions | Defines options for network packet transmission.

Expand image Remarks

Important

Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

Expand image See Also

Concepts

Prerequisites for Developing Xbox LIVE Multiplayer Games on Xbox 360
Networking Content Catalog at XNA Creators Club Online


AvailableNetworkSession Class

AvailableNetworkSession Class
See Also Members
CollapseAll image

Describes a multiplayer session that can be joined.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public sealed class AvailableNetworkSession

Expand image Remarks

Use the NetworkSession class to get a list of AvailableNetworkSession instances. Typically, the results populate some type of user interface, displayed by the game. The user then chooses a session, and the game adds the player to the chosen session with a call to Join.

Expand image See Also

Tasks

Finding and Joining a Network Session

Reference

AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvailableNetworkSession Members

AvailableNetworkSession Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the AvailableNetworkSession type.

Expand image Public Properties

 | Name | Description
Public Property | CurrentGamerCount | Gets the number of gamers in the session.
Public Property | HostGamertag | Gets the gamertag of the session host.
Public Property | OpenPrivateGamerSlots | Gets the number of private player slots.
Public Property | OpenPublicGamerSlots | Gets the number of public player slots.
Public Property | QualityOfService | Gets an estimate of the quality of network service between this local machine and the remote session.
Public Property | SessionProperties | Gets any custom properties that have been attached to the session.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Finding and Joining a Network Session

Reference

AvailableNetworkSession Class
Microsoft.Xna.Framework.Net Namespace


AvailableNetworkSession Methods

AvailableNetworkSession Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AvailableNetworkSession Class
Microsoft.Xna.Framework.Net Namespace


AvailableNetworkSession Properties

AvailableNetworkSession Properties

Expand image Public Properties

 | Name | Description
Public Property | CurrentGamerCount | Gets the number of gamers in the session.
Public Property | HostGamertag | Gets the gamertag of the session host.
Public Property | OpenPrivateGamerSlots | Gets the number of private player slots.
Public Property | OpenPublicGamerSlots | Gets the number of public player slots.
Public Property | QualityOfService | Gets an estimate of the quality of network service between this local machine and the remote session.
Public Property | SessionProperties | Gets any custom properties that have been attached to the session.

Expand image See Also

Reference

AvailableNetworkSession Class
Microsoft.Xna.Framework.Net Namespace


AvailableNetworkSession.CurrentGamerCount Property

AvailableNetworkSession.CurrentGamerCount Property

Gets the number of gamers in the session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int CurrentGamerCount { get; }

Property Value

Number of gamers currently in the session.

Expand image See Also

Reference

AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvailableNetworkSession.HostGamertag Property

AvailableNetworkSession.HostGamertag Property

Gets the gamertag of the session host.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public string HostGamertag { get; }

Property Value

Name of the gamertag.

Expand image See Also

Reference

AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvailableNetworkSession.OpenPrivateGamerSlots Property

AvailableNetworkSession.OpenPrivateGamerSlots Property

Gets the number of private player slots. These slots are reserved for people joining by invitation or friend presence.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int OpenPrivateGamerSlots { get; }

Property Value

Number of reserved private slots.

Expand image See Also

Reference

AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvailableNetworkSession.OpenPublicGamerSlots Property

AvailableNetworkSession.OpenPublicGamerSlots Property

Gets the number of public player slots. These slots are reserved for people joining by a matchmaking service.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int OpenPublicGamerSlots { get; }

Property Value

Number of public slots.

Expand image See Also

Reference

AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvailableNetworkSession.QualityOfService Property

AvailableNetworkSession.QualityOfService Property

Gets an estimate of the quality of network service between this local machine and the remote session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public QualityOfService QualityOfService { get; }

Property Value

An estimate of the quality of network service between this local machine and the remote session. Initially the IsAvailable property will be set to false, and all the other properties of the returned QualityOfService instance will be zero, but after the probing finishes this will become true and the other properties will be filled in with some actual data.

Expand image Remarks

This measurement can take some time to complete, so the data may not be available when the search result is first returned to you.

Expand image See Also

Reference

AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvailableNetworkSession.SessionProperties Property

AvailableNetworkSession.SessionProperties Property

Gets any custom properties that have been attached to the session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionProperties SessionProperties { get; }

Property Value

Any custom properties that have been attached to the session.

Expand image See Also

Reference

AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvailableNetworkSessionCollection Class

AvailableNetworkSessionCollection Class
See Also Members
CollapseAll image

Represents a collection of sessions available for joining.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public sealed class AvailableNetworkSessionCollection : ReadOnlyCollection<AvailableNetworkSession>, IDisposable

Expand image See Also

Tasks

Finding and Joining a Network Session

Reference

AvailableNetworkSessionCollection Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvailableNetworkSessionCollection Members

AvailableNetworkSessionCollection Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the AvailableNetworkSessionCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Dispose | Immediately releases the collection.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from ReadOnlyCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Finding and Joining a Network Session

Reference

AvailableNetworkSessionCollection Class
Microsoft.Xna.Framework.Net Namespace


AvailableNetworkSessionCollection Methods

AvailableNetworkSessionCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Dispose | Immediately releases the collection.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from ReadOnlyCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AvailableNetworkSessionCollection Class
Microsoft.Xna.Framework.Net Namespace


AvailableNetworkSessionCollection.Dispose Method

AvailableNetworkSessionCollection.Dispose Method

Immediately releases the collection.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

AvailableNetworkSessionCollection Class
AvailableNetworkSessionCollection Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


AvailableNetworkSessionCollection Properties

AvailableNetworkSessionCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

AvailableNetworkSessionCollection Class
Microsoft.Xna.Framework.Net Namespace


AvailableNetworkSessionCollection.IsDisposed Property

AvailableNetworkSessionCollection.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

AvailableNetworkSessionCollection Class
AvailableNetworkSessionCollection Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GameEndedEventArgs Class

GameEndedEventArgs Class
See Also Members
CollapseAll image

Represents the arguments passed to a GameEnded event. These arguments are passed to event handlers when a game ends.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class GameEndedEventArgs : EventArgs

Expand image See Also

Reference

GameEndedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GameEndedEventArgs Members

GameEndedEventArgs Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the GameEndedEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | GameEndedEventArgs | Creates an instance of GameEndedEventArgs.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameEndedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


GameEndedEventArgs Constructor

GameEndedEventArgs Constructor

Creates an instance of GameEndedEventArgs.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public GameEndedEventArgs ()

Expand image See Also

Reference

GameEndedEventArgs Class
GameEndedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GameEndedEventArgs Methods

GameEndedEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameEndedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


GamerJoinedEventArgs Class

GamerJoinedEventArgs Class
See Also Members
CollapseAll image

Represents the arguments passed to a GamerJoined event. These arguments are passed to event handlers when a new gamer joins a network session. This class contains the NetworkGamer instance that recently joined the network session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class GamerJoinedEventArgs : EventArgs

Expand image See Also

Reference

GamerJoinedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GamerJoinedEventArgs Members

GamerJoinedEventArgs Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the GamerJoinedEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | GamerJoinedEventArgs | Creates an instance of GamerJoinedEventArgs.

Expand image Public Properties

 | Name | Description
Public Property | Gamer | Gets the gamer who just joined the session.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerJoinedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


GamerJoinedEventArgs Constructor

GamerJoinedEventArgs Constructor

Creates an instance of GamerJoinedEventArgs.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public GamerJoinedEventArgs (
         NetworkGamer gamer
)

Parameters

gamer
The gamer who just joined the session.

Expand image See Also

Reference

GamerJoinedEventArgs Class
GamerJoinedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GamerJoinedEventArgs Methods

GamerJoinedEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerJoinedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


GamerJoinedEventArgs Properties

GamerJoinedEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | Gamer | Gets the gamer who just joined the session.

Expand image See Also

Reference

GamerJoinedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


GamerJoinedEventArgs.Gamer Property

GamerJoinedEventArgs.Gamer Property

Gets the gamer who just joined the session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkGamer Gamer { get; }

Property Value

The gamer who just joined the session.

Expand image See Also

Reference

GamerJoinedEventArgs Class
GamerJoinedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GamerLeftEventArgs Class

GamerLeftEventArgs Class
See Also Members
CollapseAll image

Represents the arguments passed to a GamerLeft event. These arguments are passed to event handlers when a gamer leaves a network session. This class contains the NetworkGamer instance that recently left the network session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class GamerLeftEventArgs : EventArgs

Expand image See Also

Reference

GamerLeftEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GamerLeftEventArgs Members

GamerLeftEventArgs Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the GamerLeftEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | GamerLeftEventArgs | Creates an instance of GamerLeftEventArgs.

Expand image Public Properties

 | Name | Description
Public Property | Gamer | Gets the gamer who just left the session.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerLeftEventArgs Class
Microsoft.Xna.Framework.Net Namespace


GamerLeftEventArgs Constructor

GamerLeftEventArgs Constructor

Creates an instance of GamerLeftEventArgs.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public GamerLeftEventArgs (
         NetworkGamer gamer
)

Parameters

gamer
The gamer who just left the session.

Expand image See Also

Reference

GamerLeftEventArgs Class
GamerLeftEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GamerLeftEventArgs Methods

GamerLeftEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GamerLeftEventArgs Class
Microsoft.Xna.Framework.Net Namespace


GamerLeftEventArgs Properties

GamerLeftEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | Gamer | Gets the gamer who just left the session.

Expand image See Also

Reference

GamerLeftEventArgs Class
Microsoft.Xna.Framework.Net Namespace


GamerLeftEventArgs.Gamer Property

GamerLeftEventArgs.Gamer Property

Gets the gamer who just left the session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkGamer Gamer { get; }

Property Value

The gamer who just left the session.

Expand image See Also

Reference

GamerLeftEventArgs Class
GamerLeftEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GameStartedEventArgs Class

GameStartedEventArgs Class
See Also Members
CollapseAll image

Represents the arguments passed to a GameStarted event. These arguments are passed to event handlers when a game starts.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class GameStartedEventArgs : EventArgs

Expand image See Also

Reference

GameStartedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GameStartedEventArgs Members

GameStartedEventArgs Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the GameStartedEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | GameStartedEventArgs | Creates an instance of GameStartedEventArgs.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameStartedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


GameStartedEventArgs Constructor

GameStartedEventArgs Constructor

Creates an instance of GameStartedEventArgs.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public GameStartedEventArgs ()

Expand image See Also

Reference

GameStartedEventArgs Class
GameStartedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


GameStartedEventArgs Methods

GameStartedEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GameStartedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


HostChangedEventArgs Class

HostChangedEventArgs Class
See Also Members
CollapseAll image

Represents the arguments passed to a HostChanged event. These arguments are passed to event handlers when the host changes for a multiplayer session. This class contains the NetworkGamer instance that is the new host of the multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class HostChangedEventArgs : EventArgs

Expand image See Also

Reference

HostChangedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


HostChangedEventArgs Members

HostChangedEventArgs Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the HostChangedEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | HostChangedEventArgs | Creates an instance of HostChangedEventArgs.

Expand image Public Properties

 | Name | Description
Public Property | NewHost | Gets the new host of the session.
Public Property | OldHost | Gets the player who was the previous session host.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

HostChangedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


HostChangedEventArgs Constructor

HostChangedEventArgs Constructor

Creates an instance of HostChangedEventArgs.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public HostChangedEventArgs (
         NetworkGamer oldHost,
         NetworkGamer newHost
)

Parameters

oldHost
The player who was the previous session host.
newHost
The player who is the new host of the multiplayer session.

Expand image See Also

Reference

HostChangedEventArgs Class
HostChangedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


HostChangedEventArgs Methods

HostChangedEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

HostChangedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


HostChangedEventArgs Properties

HostChangedEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | NewHost | Gets the new host of the session.
Public Property | OldHost | Gets the player who was the previous session host.

Expand image See Also

Reference

HostChangedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


HostChangedEventArgs.NewHost Property

HostChangedEventArgs.NewHost Property

Gets the new host of the session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkGamer NewHost { get; }

Property Value

The player who is the new host of the multiplayer session.

Expand image See Also

Reference

HostChangedEventArgs Class
HostChangedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


HostChangedEventArgs.OldHost Property

HostChangedEventArgs.OldHost Property

Gets the player who was the previous session host.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkGamer OldHost { get; }

Property Value

The player who was the previous session host.

Expand image See Also

Reference

HostChangedEventArgs Class
HostChangedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer Class

LocalNetworkGamer Class
See Also Members
CollapseAll image

Represents a local player in a network session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public sealed class LocalNetworkGamer : NetworkGamer

Expand image See Also

Reference

SignedInGamer
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer Members

LocalNetworkGamer Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the LocalNetworkGamer type.

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | (Inherited from Gamer.)
Public Property | Gamertag | (Inherited from Gamer.)
Public Property | HasLeftSession | (Inherited from NetworkGamer.)
Public Property | HasVoice | (Inherited from NetworkGamer.)
Public Property | Id | (Inherited from NetworkGamer.)
Public Property | IsDataAvailable | Determines if there is incoming packet data for this player.
Public Property | IsDisposed | (Inherited from Gamer.)
Public Property | IsGuest | (Inherited from NetworkGamer.)
Public Property | IsHost | (Inherited from NetworkGamer.)
Public Property | IsLocal | (Inherited from NetworkGamer.)
Public Property | IsMutedByLocalUser | (Inherited from NetworkGamer.)
Public Property | IsPrivateSlot | (Inherited from NetworkGamer.)
Public Property | IsReady | (Inherited from NetworkGamer.)
Public Property | IsTalking | (Inherited from NetworkGamer.)
Public Property | LeaderboardWriter | (Inherited from Gamer.)
Public Property | Machine | (Inherited from NetworkGamer.)
Public Property | RoundtripTime | (Inherited from NetworkGamer.)
Public Property | Session | (Inherited from NetworkGamer.)
Public Property | SignedInGamer | Gets the SignedInGamer instance for this SignedInGamer object.
Public Property | Tag | (Inherited from Gamer.)

Expand image Public Methods

 | Name | Description
Public Method | BeginGetProfile | (Inherited from Gamer.)
Public Method | EnableSendVoice | Specifies whether voice data should be sent to, or received from, the specified remote gamer.
Public Method | EndGetProfile | (Inherited from Gamer.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProfile | (Inherited from Gamer.)
Public Method | GetType | (Inherited from Object.)
Public Method | ReceiveData | Overloaded. Reads the next incoming packet.
Public Method | SendData | Overloaded. Sends data to a specified set of gamers in a network session.
Public Method | SendPartyInvites | Sends game invitations to all party members that are not in the current game session.
Public Method | ToString | (Inherited from Gamer.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

LocalNetworkGamer Class
Microsoft.Xna.Framework.Net Namespace


LocalNetworkGamer Methods

LocalNetworkGamer Methods

Expand image Public Methods

 | Name | Description
Public Method | BeginGetProfile | (Inherited from Gamer.)
Public Method | EnableSendVoice | Specifies whether voice data should be sent to, or received from, the specified remote gamer.
Public Method | EndGetProfile | (Inherited from Gamer.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProfile | (Inherited from Gamer.)
Public Method | GetType | (Inherited from Object.)
Public Method | ReceiveData | Overloaded. Reads the next incoming packet.
Public Method | SendData | Overloaded. Sends data to a specified set of gamers in a network session.
Public Method | SendPartyInvites | Sends game invitations to all party members that are not in the current game session.
Public Method | ToString | (Inherited from Gamer.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

LocalNetworkGamer Class
Microsoft.Xna.Framework.Net Namespace


LocalNetworkGamer.EnableSendVoice Method

LocalNetworkGamer.EnableSendVoice Method

Specifies whether voice data should be sent to, or received from, the specified remote gamer.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void EnableSendVoice (
         NetworkGamer remoteGamer,
         bool enable
)

Parameters

remoteGamer
A remote gamer in the session.
enable
true if voice is enabled; false otherwise.

Expand image Exceptions

Exception type | Condition
ArgumentException | This NetworkGamer belongs to a different network session.
ArgumentNullException | remoteGamer is null.
ObjectDisposedException | This NetworkGamer is no longer valid. The gamer may have left the session.

Expand image Remarks

Call this method for local gamer instances only.

By default, voice is enabled for all gamers. However, you can selectively turn it off to enable features such as team chat. Also, you can dynamically turn it on or off, depending on the player's location in the game world, to achieve a proximity voice effect.

Expand image See Also

Reference

GamerPrivileges.AllowCommunication Property
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.ReceiveData Method

LocalNetworkGamer.ReceiveData Method
See Also Example
CollapseAll image

Reads the next incoming packet.

Expand image Overload List

Name | Description
LocalNetworkGamer.ReceiveData (Byte[], Int32, NetworkGamer) | Reads the next incoming packet using the specified values.
LocalNetworkGamer.ReceiveData (Byte[], NetworkGamer) | Reads the next incoming packet using the specified values.
LocalNetworkGamer.ReceiveData (PacketReader, NetworkGamer) | Reads the next incoming packet and copies the packet data into the specified reader object.

Expand image Example

Be sure to call ReceiveData for all incoming data for all local gamers, even if the data is to be discarded. Any time data is sent to a local network gamer, the incoming data queue will grow until the data is read. If the data is not read using ReceiveData the performance of the application will degrade as the data queue grows in size.

C#
foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
    // Keep reading while packets are available.
    while (gamer.IsDataAvailable)
    {
        NetworkGamer sender;

        // Read a single packet.
        gamer.ReceiveData(packetReader, out sender);
        // Discard the data, or use packetReader.Read* to process the data.
    }
    gamer.SendData(packetWriter, SendDataOptions.None);

}

Expand image See Also

Tasks

Receiving Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace


LocalNetworkGamer.ReceiveData Method (Byte[], Int32, NetworkGamer)

LocalNetworkGamer.ReceiveData Method (Byte[], Int32, NetworkGamer)
See Also
CollapseAll image

Reads the next incoming packet using the specified values.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int ReceiveData (
         byte[] data,
         int offset,
         out NetworkGamer sender
)

Parameters

data
Storage for the network packet data.
offset
Offset, in bytes, to begin reading data.
sender
[OutAttribute] Gamer who sent this packet.

Return Value

Number of bytes read from the network packet. Returns 0 if no packet is available.

Expand image Exceptions

Exception type | Condition
ArgumentException | The specified array is too small to receive the incoming network packet.
ArgumentNullException | data is null.
ArgumentOutOfRangeException | offset cannot be larger than the amount of data available for storage.

Expand image Example

Be sure to call ReceiveData for all incoming data for all local gamers, even if the data is to be discarded. Any time data is sent to a local network gamer, the incoming data queue will grow until the data is read. If the data is not read using ReceiveData the performance of the application will degrade as the data queue grows in size.

C#
foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
    // Keep reading while packets are available.
    while (gamer.IsDataAvailable)
    {
        NetworkGamer sender;

        // Read a single packet.
        gamer.ReceiveData(packetReader, out sender);
        // Discard the data, or use packetReader.Read* to process the data.
    }
    gamer.SendData(packetWriter, SendDataOptions.None);

}

Expand image Remarks

ReceiveData copies the packet data into the array specified by data, returning the number of bytes read. If several independent packets are available, only one is returned for each ReceiveData call.

Expand image See Also

Tasks

Receiving Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.ReceiveData Method (Byte[], NetworkGamer)

LocalNetworkGamer.ReceiveData Method (Byte[], NetworkGamer)
See Also
CollapseAll image

Reads the next incoming packet using the specified values.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int ReceiveData (
         byte[] data,
         out NetworkGamer sender
)

Parameters

data
Storage for the network packet data.
sender
[OutAttribute] Gamer who sent this packet.

Return Value

Number of bytes read from the network packet. Returns 0 if no packet is available.

Expand image Exceptions

Exception type | Condition
ArgumentException | The specified array is too small to receive the incoming network packet.
ArgumentNullException | data is null.

Expand image Example

Be sure to call ReceiveData for all incoming data for all local gamers, even if the data is to be discarded. Any time data is sent to a local network gamer, the incoming data queue will grow until the data is read. If the data is not read using ReceiveData the performance of the application will degrade as the data queue grows in size.

C#
foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
    // Keep reading while packets are available.
    while (gamer.IsDataAvailable)
    {
        NetworkGamer sender;

        // Read a single packet.
        gamer.ReceiveData(packetReader, out sender);
        // Discard the data, or use packetReader.Read* to process the data.
    }
    gamer.SendData(packetWriter, SendDataOptions.None);

}

Expand image Remarks

ReceiveData copies the packet data into the array specified by data, returning the number of bytes read. If several independent packets are available, only one is returned for each ReceiveData call.

Expand image See Also

Tasks

Receiving Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.ReceiveData Method (PacketReader, NetworkGamer)

LocalNetworkGamer.ReceiveData Method (PacketReader, NetworkGamer)
See Also
CollapseAll image

Reads the next incoming packet and copies the packet data into the specified reader object.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int ReceiveData (
         PacketReader data,
         out NetworkGamer sender
)

Parameters

data
Network packet data.
sender
[OutAttribute] Gamer who sent this packet.

Return Value

Number of bytes read from the network packet. Returns 0 if no packet is available.

Expand image Exceptions

Exception type | Condition
ArgumentException | The specified array is too small to receive the incoming network packet.
ArgumentNullException | data is null.

Expand image Example

Be sure to call ReceiveData for all incoming data for all local gamers, even if the data is to be discarded. Any time data is sent to a local network gamer, the incoming data queue will grow until the data is read. If the data is not read using ReceiveData the performance of the application will degrade as the data queue grows in size.

C#
foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
    // Keep reading while packets are available.
    while (gamer.IsDataAvailable)
    {
        NetworkGamer sender;

        // Read a single packet.
        gamer.ReceiveData(packetReader, out sender);
        // Discard the data, or use packetReader.Read* to process the data.
    }
    gamer.SendData(packetWriter, SendDataOptions.None);

}

Expand image Remarks

If several independent packets are available, only one will be returned on each call to ReceiveData.

Expand image See Also

Tasks

Receiving Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.SendData Method

LocalNetworkGamer.SendData Method

Sends data to a specified set of gamers in a network session.

Expand image Overload List

Name | Description
LocalNetworkGamer.SendData (Byte[], Int32, Int32, SendDataOptions) | Sends a selected portion of a byte array to all gamers in a session.
LocalNetworkGamer.SendData (Byte[], Int32, Int32, SendDataOptions, NetworkGamer) | Sends a selected portion of a byte array to the specified gamer.
LocalNetworkGamer.SendData (Byte[], SendDataOptions) | Sends a byte array to all gamers in a session.
LocalNetworkGamer.SendData (Byte[], SendDataOptions, NetworkGamer) | Sends a byte array to the specified gamer.
LocalNetworkGamer.SendData (PacketWriter, SendDataOptions) | Sends a network packet to all gamers in a session.
LocalNetworkGamer.SendData (PacketWriter, SendDataOptions, NetworkGamer) | Sends a network packet to the specified gamer in a session.

Expand image See Also

Tasks

Sending Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace


LocalNetworkGamer.SendData Method (Byte[], Int32, Int32, SendDataOptions)

LocalNetworkGamer.SendData Method (Byte[], Int32, Int32, SendDataOptions)
See Also
CollapseAll image

Sends a selected portion of a byte array to all gamers in a session. This includes the gamer sending the packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void SendData (
         byte[] data,
         int offset,
         int count,
         SendDataOptions options
)

Parameters

data
Byte array containing session data.
offset
Offset, in bytes, to the start of the data.
count
Amount, in bytes, of data sent.
options
Enumeration containing data send options.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null.
ArgumentOutOfRangeException
  • offset must be greater than zero, and no larger than the amount of data available.
  • count must be greater than zero, and offset + count must be no larger than the amount of data available.
ObjectDisposedException | The NetworkGamer sending this message is no longer valid. The gamer may have left the session.

Expand image See Also

Tasks

Sending Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.SendData Method (Byte[], Int32, Int32, SendDataOptions, NetworkGamer)

LocalNetworkGamer.SendData Method (Byte[], Int32, Int32, SendDataOptions, NetworkGamer)
See Also
CollapseAll image

Sends a selected portion of a byte array to the specified gamer.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void SendData (
         byte[] data,
         int offset,
         int count,
         SendDataOptions options,
         NetworkGamer recipient
)

Parameters

data
Byte array containing session data.
offset
Offset, in bytes, to the start of the data.
count
Amount, in bytes, of data sent.
options
Enumeration containing data send options.
recipient
Gamer to receive the data packet.

Expand image Exceptions

Exception type | Condition
ArgumentException | The NetworkGamer specified as the recipient does not belong to this network session.
ArgumentNullException | data or recipient is null.
ArgumentOutOfRangeException
  • offset must be greater than zero, and no larger than the amount of data available.
  • count must be greater than zero, and offset + count must be no larger than the amount of data available.
ObjectDisposedException | The NetworkGamer specified as either the sender or the recipient is no longer valid. The gamer may have left the session.

Expand image See Also

Tasks

Sending Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.SendData Method (Byte[], SendDataOptions)

LocalNetworkGamer.SendData Method (Byte[], SendDataOptions)
See Also
CollapseAll image

Sends a byte array to all gamers in a session. This includes the gamer sending the packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void SendData (
         byte[] data,
         SendDataOptions options
)

Parameters

data
Byte array containing session data.
options
Enumeration containing data send options.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null.
ObjectDisposedException | The NetworkGamer sending this message is no longer valid. The gamer may have left the session.

Expand image See Also

Tasks

Sending Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.SendData Method (Byte[], SendDataOptions, NetworkGamer)

LocalNetworkGamer.SendData Method (Byte[], SendDataOptions, NetworkGamer)
See Also
CollapseAll image

Sends a byte array to the specified gamer.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void SendData (
         byte[] data,
         SendDataOptions options,
         NetworkGamer recipient
)

Parameters

data
Byte array containing session data.
options
Enumeration containing data send options.
recipient
Gamer to receive the data packet.

Expand image Exceptions

Exception type | Condition
ArgumentException | The NetworkGamer specified as the recipient does not belong to this network session.
ArgumentNullException | data or recipient is null.
ObjectDisposedException | The NetworkGamer specified as either the sender or the recipient is no longer valid. The gamer may have left the session.

Expand image See Also

Tasks

Sending Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.SendData Method (PacketWriter, SendDataOptions)

LocalNetworkGamer.SendData Method (PacketWriter, SendDataOptions)
See Also
CollapseAll image

Sends a network packet to all gamers in a session. This includes the gamer sending the packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void SendData (
         PacketWriter data,
         SendDataOptions options
)

Parameters

data
Byte array containing session data.
options
Enumeration containing data send options.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | data is null.
ObjectDisposedException | The NetworkGamer sending this message is no longer valid. The gamer may have left the session.

Expand image See Also

Tasks

Sending Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.SendData Method (PacketWriter, SendDataOptions, NetworkGamer)

LocalNetworkGamer.SendData Method (PacketWriter, SendDataOptions, NetworkGamer)
See Also
CollapseAll image

Sends a network packet to the specified gamer in a session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void SendData (
         PacketWriter data,
         SendDataOptions options,
         NetworkGamer recipient
)

Parameters

data
Byte array containing session data.
options
Enumeration containing data send options.
recipient
Gamer receiving the data.

Expand image Exceptions

Exception type | Condition
ArgumentException | The NetworkGamer specified as the recipient does not belong to this network session.
ArgumentNullException | data or recipient is null.
ObjectDisposedException | The NetworkGamer specified as either the sender or the recipient is no longer valid. The gamer may have left the session.

Expand image See Also

Tasks

Sending Network Data

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.SendPartyInvites Method

LocalNetworkGamer.SendPartyInvites Method

Sends game invitations to all party members that are not in the current game session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void SendPartyInvites ()

Expand image Remarks

This method has no effect when the player is not currently a member of a LIVE party, or on platforms that do not support LIVE parties.

Expand image See Also

Tasks

Inviting a Group to Join Your Game (Xbox 360)
Inviting Players to Join Your Game

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer Properties

LocalNetworkGamer Properties

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | (Inherited from Gamer.)
Public Property | Gamertag | (Inherited from Gamer.)
Public Property | HasLeftSession | (Inherited from NetworkGamer.)
Public Property | HasVoice | (Inherited from NetworkGamer.)
Public Property | Id | (Inherited from NetworkGamer.)
Public Property | IsDataAvailable | Determines if there is incoming packet data for this player.
Public Property | IsDisposed | (Inherited from Gamer.)
Public Property | IsGuest | (Inherited from NetworkGamer.)
Public Property | IsHost | (Inherited from NetworkGamer.)
Public Property | IsLocal | (Inherited from NetworkGamer.)
Public Property | IsMutedByLocalUser | (Inherited from NetworkGamer.)
Public Property | IsPrivateSlot | (Inherited from NetworkGamer.)
Public Property | IsReady | (Inherited from NetworkGamer.)
Public Property | IsTalking | (Inherited from NetworkGamer.)
Public Property | LeaderboardWriter | (Inherited from Gamer.)
Public Property | Machine | (Inherited from NetworkGamer.)
Public Property | RoundtripTime | (Inherited from NetworkGamer.)
Public Property | Session | (Inherited from NetworkGamer.)
Public Property | SignedInGamer | Gets the SignedInGamer instance for this SignedInGamer object.
Public Property | Tag | (Inherited from Gamer.)

Expand image See Also

Reference

LocalNetworkGamer Class
Microsoft.Xna.Framework.Net Namespace


LocalNetworkGamer.IsDataAvailable Property

LocalNetworkGamer.IsDataAvailable Property

Determines if there is incoming packet data for this player.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsDataAvailable { get; }

Property Value

true if there are one or more packets waiting; otherwise false.

Expand image See Also

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


LocalNetworkGamer.SignedInGamer Property

LocalNetworkGamer.SignedInGamer Property

Gets the SignedInGamer instance for this SignedInGamer object.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public SignedInGamer SignedInGamer { get; }

Property Value

The related SignedInGamer instance.

Expand image See Also

Reference

LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer Class

NetworkGamer Class
See Also Members
CollapseAll image

Represents a player in a network session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class NetworkGamer : Gamer

Expand image Remarks

The NetworkSession class maintains a list of players in a network session. Some of the players may also be local players, which are represented LocalNetworkGamer.

Expand image See Also

Reference

NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer Members

NetworkGamer Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the NetworkGamer type.

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | (Inherited from Gamer.)
Public Property | Gamertag | (Inherited from Gamer.)
Public Property | HasLeftSession | Indicates whether this gamer has left the session.
Public Property | HasVoice | Determines if the player has a voice headset.
Public Property | Id | Gets a unique identifier that can be used to refer to this gamer in network packets.
Public Property | IsDisposed | (Inherited from Gamer.)
Public Property | IsGuest | Determines whether this gamer is logged in as a guest profile.
Public Property | IsHost | Determines if the player is the host of the multiplayer session.
Public Property | IsLocal | Determines if the player is playing on a local machine.
Public Property | IsMutedByLocalUser | Determines if the player is muted by one or more local users.
Public Property | IsPrivateSlot | Determines if the player occupies a reserved private session slot.
Public Property | IsReady | Determines whether the gamer is ready to leave the lobby screen and begin gameplay.
Public Property | IsTalking | Determines whether the gamer is currently sending voice data.
Public Property | LeaderboardWriter | (Inherited from Gamer.)
Public Property | Machine | Gets an object representing the physical gaming machine this NetworkGamer is playing on.
Public Property | RoundtripTime | Gets an estimate of the network latency involved in sending a packet round trip from the local machine to this gamer and back again.
Public Property | Session | Gets the multiplayer session of the gamer.
Public Property | Tag | (Inherited from Gamer.)

Expand image Public Methods

 | Name | Description
Public Method | BeginGetProfile | (Inherited from Gamer.)
Public Method | EndGetProfile | (Inherited from Gamer.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProfile | (Inherited from Gamer.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Gamer.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkGamer Class
Microsoft.Xna.Framework.Net Namespace


NetworkGamer Methods

NetworkGamer Methods

Expand image Public Methods

 | Name | Description
Public Method | BeginGetProfile | (Inherited from Gamer.)
Public Method | EndGetProfile | (Inherited from Gamer.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetProfile | (Inherited from Gamer.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Gamer.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkGamer Class
Microsoft.Xna.Framework.Net Namespace


NetworkGamer Properties

NetworkGamer Properties

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | (Inherited from Gamer.)
Public Property | Gamertag | (Inherited from Gamer.)
Public Property | HasLeftSession | Indicates whether this gamer has left the session.
Public Property | HasVoice | Determines if the player has a voice headset.
Public Property | Id | Gets a unique identifier that can be used to refer to this gamer in network packets.
Public Property | IsDisposed | (Inherited from Gamer.)
Public Property | IsGuest | Determines whether this gamer is logged in as a guest profile.
Public Property | IsHost | Determines if the player is the host of the multiplayer session.
Public Property | IsLocal | Determines if the player is playing on a local machine.
Public Property | IsMutedByLocalUser | Determines if the player is muted by one or more local users.
Public Property | IsPrivateSlot | Determines if the player occupies a reserved private session slot.
Public Property | IsReady | Determines whether the gamer is ready to leave the lobby screen and begin gameplay.
Public Property | IsTalking | Determines whether the gamer is currently sending voice data.
Public Property | LeaderboardWriter | (Inherited from Gamer.)
Public Property | Machine | Gets an object representing the physical gaming machine this NetworkGamer is playing on.
Public Property | RoundtripTime | Gets an estimate of the network latency involved in sending a packet round trip from the local machine to this gamer and back again.
Public Property | Session | Gets the multiplayer session of the gamer.
Public Property | Tag | (Inherited from Gamer.)

Expand image See Also

Reference

NetworkGamer Class
Microsoft.Xna.Framework.Net Namespace


NetworkGamer.HasLeftSession Property

NetworkGamer.HasLeftSession Property

Indicates whether this gamer has left the session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool HasLeftSession { get; }

Property Value

true if the player has left the session; false, otherwise.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.HasVoice Property

NetworkGamer.HasVoice Property

Determines if the player has a voice headset.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool HasVoice { get; }

Property Value

true if a headset is present; false otherwise.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.Id Property

NetworkGamer.Id Property

Gets a unique identifier that can be used to refer to this gamer in network packets.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public byte Id { get; }

Property Value

A unique identifier that can be used to refer to this gamer in network packets.

Expand image Remarks

This value is synchronized across all the machines in the session, so it can be used in situations where gamer A wants to send a packet to B, and the contents of this packet must refer to gamer C. Using the identifier is preferable to sending the index of the gamer within the session, because indices could change if gamers join or leave in mid session, but this id will always remain constant. To look up a gamer once you know their id, use FindGamerById.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.IsGuest Property

NetworkGamer.IsGuest Property

Determines whether this gamer is logged in as a guest profile.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsGuest { get; }

Property Value

true if this gamer is logged in as a guest profile; false otherwise.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.IsHost Property

NetworkGamer.IsHost Property

Determines if the player is the host of the multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsHost { get; }

Property Value

true if the player is the host; false otherwise.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.IsLocal Property

NetworkGamer.IsLocal Property

Determines if the player is playing on a local machine.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsLocal { get; }

Property Value

true if the player is local; false otherwise.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.IsMutedByLocalUser Property

NetworkGamer.IsMutedByLocalUser Property

Determines if the player is muted by one or more local users.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsMutedByLocalUser { get; }

Property Value

true if the player is muted by one or more players in the session; false otherwise.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.IsPrivateSlot Property

NetworkGamer.IsPrivateSlot Property

Determines if the player occupies a reserved private session slot.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsPrivateSlot { get; }

Property Value

true if the player occupies a reserved private session slot; false otherwise.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.IsReady Property

NetworkGamer.IsReady Property

Determines whether the gamer is ready to leave the lobby screen and begin gameplay.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsReady { get; set; }

Property Value

true if the gamer is ready to start playing; false otherwise.

Expand image Exceptions

Exception type | Condition
InvalidOperationException
  • This operation is only valid when the session state is NetworkSessionState.Lobby.
  • This method cannot be called on remote gamer instances. It is only valid when NetworkGamer.IsLocal is true. If you are looping over the contents of the NetworkSession.AllGamers collection, consider using NetworkSession.LocalGamers instead.
ObjectDisposedException | This NetworkGamer is no longer valid. The gamer may have left the session.

Expand image Remarks

The host of a multiplayer session can use the IsEveryoneReady property to detect when all players have marked themselves ready, and then call StartGame to kick off the game.

Expand image See Also

Tasks

Managing Player Movement Between Lobby and Gameplay Modes

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.IsTalking Property

NetworkGamer.IsTalking Property

Determines whether the gamer is currently sending voice data.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsTalking { get; }

Property Value

true if the gamer is sending voice data; false otherwise.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.Machine Property

NetworkGamer.Machine Property

Gets an object representing the physical gaming machine this NetworkGamer is playing on.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkMachine Machine { get; set; }

Property Value

An object representing the physical gaming machine this NetworkGamer is playing on.

Expand image Remarks

If there are several gamers all playing on the same gaming machine, they will all share a single value for the Machine property.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.RoundtripTime Property

NetworkGamer.RoundtripTime Property

Gets an estimate of the network latency involved in sending a packet round trip from the local machine to this gamer and back again.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public TimeSpan RoundtripTime { get; }

Property Value

An estimate of the network latency involved in sending a packet round trip from the local machine to this gamer and back again.

Expand image Remarks

This value does not include latency introduced via the NetworkSession.SimulatedLatency property.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkGamer.Session Property

NetworkGamer.Session Property

Gets the multiplayer session of the gamer.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSession Session { get; }

Property Value

Session that contains the gamer.

Expand image See Also

Reference

NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkMachine Class

NetworkMachine Class
See Also Members
CollapseAll image

Represents a physical machine (such as single Xbox 360 console or Windows-based computer) that is participating in a multiplayer session. It can be used to detect when more than one NetworkGamer is playing on the same actual machine.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public sealed class NetworkMachine

Expand image See Also

Reference

NetworkMachine Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkMachine Members

NetworkMachine Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the NetworkMachine type.

Expand image Public Properties

 | Name | Description
Public Property | Gamers | Gets a collection of all the gamers who are playing on this machine.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | RemoveFromSession | Forcibly removes this machine from the session.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkMachine Class
Microsoft.Xna.Framework.Net Namespace


NetworkMachine Methods

NetworkMachine Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | RemoveFromSession | Forcibly removes this machine from the session.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkMachine Class
Microsoft.Xna.Framework.Net Namespace


NetworkMachine.RemoveFromSession Method

NetworkMachine.RemoveFromSession Method

Forcibly removes this machine from the session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void RemoveFromSession ()

Expand image Exceptions

Exception type Condition
ObjectDisposedException

There are no gamers on this machine, or the gamer is no longer valid.

InvalidOperationException
  • The local NetworkMachine cannot be removed from the session.
  • This method can only be called by the session host.

Expand image See Also

Reference

NetworkMachine Class
NetworkMachine Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkMachine Properties

NetworkMachine Properties

Expand image Public Properties

 | Name | Description
Public Property | Gamers | Gets a collection of all the gamers who are playing on this machine.

Expand image See Also

Reference

NetworkMachine Class
Microsoft.Xna.Framework.Net Namespace


NetworkMachine.Gamers Property

NetworkMachine.Gamers Property

Gets a collection of all the gamers who are playing on this machine.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public GamerCollection<NetworkGamer> Gamers { get; }

Property Value

A collection of all the gamers who are playing on this machine.

Expand image See Also

Reference

NetworkMachine Class
NetworkMachine Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession Class

NetworkSession Class
See Also Members
CollapseAll image

Represents a multiplayer game session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public sealed class NetworkSession : IDisposable

Expand image Remarks

An XNA Framework game can only initiate a single multiplayer session at a time. To start a multiplayer session, make a call to Create or use Find or BeginFind to search for and join an existing network session.

Expand image See Also

Tasks

Creating a Network Session
Finding and Joining a Network Session

Concepts

Network Session Management

Reference

NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession Members

NetworkSession Members
See Also Events Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the NetworkSession type.

Expand image Public Fields

 | Name | Description
Public Field | MaxPreviousGamers | Represents the maximum number of gamers that can be held in the PreviousGamers property.
Public Field | MaxSupportedGamers | Maximum number of gamers supported in a session.

Expand image Public Properties

 | Name | Description
Public Property | AllGamers | Gets the collection of gamers currently in the session.
Public Property | AllowHostMigration | Gets or sets whether host migration is allowed. This can be read by any machine in the session, but can only be changed by the host. The default value is false indicating that host migration is disabled.
Public Property | AllowJoinInProgress | Gets or sets whether join-in-progress is allowed. If the host enables this setting, new machines will be able to join at any time. The default value is false, indicating that join-in-progress is disabled. AllowJoinInProgress can be read by any machine in the session, but can only be changed by the host.
Public Property | BytesPerSecondReceived | Gets a performance counter recording the amount of data being received from the network.
Public Property | BytesPerSecondSent | Gets a performance counter recording the amount of data being sent over the network.
Public Property | Host | Gets the current host of the multiplayer session.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | IsEveryoneReady | Determines whether all gamers are ready to enter the session.
Public Property | IsHost | Determines whether this machine is the session host.
Public Property | LocalGamers | Get the collection of local gamers for a multiplayer session.
Public Property | MaxGamers | Gets or sets the maximum number of players able to join this multiplayer session.
Public Property | PreviousGamers | A collection of previous gamers in the network session.
Public Property | PrivateGamerSlots | Gets or sets the number of private slots reserved for gamers who join using an invitation.
Public Property | RemoteGamers | Gets the collection of remote gamers for a multiplayer session.
Public Property | SessionProperties | Gets any custom properties that have been attached to the session.
Public Property | SessionState | Gets the current state of a multiplayer session.
Public Property | SessionType | Gets the current multiplayer session type.
Public Property | SimulatedLatency | Gets or sets the amount of simulated network latency.
Public Property | SimulatedPacketLoss | Gets or sets the amount of simulated packet loss.

Expand image Public Methods

 | Name | Description
Public Method | AddLocalGamer | Adds the specified local gamer profile to the network session.
 | BeginCreate | Overloaded. Starts hosting a new multiplayer session.
 | BeginFind | Overloaded. Starts a matchmaking query to search for available multiplayer sessions.
 | BeginJoin | Starts a join operation for the specified multiplayer session.
 | BeginJoinInvited | Overloaded. Starts joining an existing network session in response to an InviteAccepted notification event. Call EndJoinInvited to access the asynchronous method results.
 | Create | Overloaded. Hosts a new multiplayer session.
Public Method | Dispose | Ends the current multiplayer session.
 | EndCreate | Gets the result from a BeginCreate asynchronous call.
 | EndFind | Gets the result from a BeginFind asynchronous call.
Public Method | EndGame | Changes the session state from NetworkSessionState.Playing to NetworkSessionState.Lobby.
 | EndJoin | Gets the result from a BeginJoin asynchronous call.
 | EndJoinInvited | Gets the result from a BeginJoinInvited asynchronous call.
Public Method | Equals | (Inherited from Object.)
 | Find | Overloaded. Issues a matchmaking query, searching for available multiplayer sessions.
Public Method | FindGamerById | Looks up the network gamer with the specified ID.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
 | Join | Joins an existing multiplayer session.
 | JoinInvited | Overloaded. Joins the specified local gamers, along with the local machine, to an existing network session in response to an InviteAccepted notification event from a non-local session.
Public Method | ResetReady | Resets the IsReady property of all session gamers.
Public Method | StartGame | Changes the session state from NetworkSessionState.Lobby to NetworkSessionState.Playing.
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Updates the state of the multiplayer session.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | GameEnded | Occurs when the game moves from gameplay to the lobby.
Public Event | GamerJoined | Occurs when a new player joins a multiplayer session.
Public Event | GamerLeft | Occurs when a player leaves the multiplayer session.
Public Event | GameStarted | Occurs when the game moves from the lobby into actual gameplay.
Public Event | HostChanged | Occurs when the session host has changed.
 | InviteAccepted | Event that occurs when a user has accepted an invitation to join a network session.
Public Event | SessionEnded | Occurs when the multiplayer session ends.
Public Event | WriteArbitratedLeaderboard | TBD
Public Event | WriteTrueSkill | TBD
Public Event | WriteUnarbitratedLeaderboard | TBD

Expand image See Also

Reference

NetworkSession Class
Microsoft.Xna.Framework.Net Namespace


NetworkSession Fields

NetworkSession Fields

Expand image Public Fields

 | Name | Description
Public Field | MaxPreviousGamers | Represents the maximum number of gamers that can be held in the PreviousGamers property.
Public Field | MaxSupportedGamers | Maximum number of gamers supported in a session.

Expand image See Also

Reference

NetworkSession Class
Microsoft.Xna.Framework.Net Namespace


NetworkSession.MaxPreviousGamers Field

NetworkSession.MaxPreviousGamers Field

Represents the maximum number of gamers that can be held in the PreviousGamers property.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public const int MaxPreviousGamers

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.MaxSupportedGamers Field

NetworkSession.MaxSupportedGamers Field

Maximum number of gamers supported in a session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public const int MaxSupportedGamers

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession Methods

NetworkSession Methods

Expand image Public Methods

 | Name | Description
Public Method | AddLocalGamer | Adds the specified local gamer profile to the network session.
 | BeginCreate | Overloaded. Starts hosting a new multiplayer session.
 | BeginFind | Overloaded. Starts a matchmaking query to search for available multiplayer sessions.
 | BeginJoin | Starts a join operation for the specified multiplayer session.
 | BeginJoinInvited | Overloaded. Starts joining an existing network session in response to an InviteAccepted notification event. Call EndJoinInvited to access the asynchronous method results.
 | Create | Overloaded. Hosts a new multiplayer session.
Public Method | Dispose | Ends the current multiplayer session.
 | EndCreate | Gets the result from a BeginCreate asynchronous call.
 | EndFind | Gets the result from a BeginFind asynchronous call.
Public Method | EndGame | Changes the session state from NetworkSessionState.Playing to NetworkSessionState.Lobby.
 | EndJoin | Gets the result from a BeginJoin asynchronous call.
 | EndJoinInvited | Gets the result from a BeginJoinInvited asynchronous call.
Public Method | Equals | (Inherited from Object.)
 | Find | Overloaded. Issues a matchmaking query, searching for available multiplayer sessions.
Public Method | FindGamerById | Looks up the network gamer with the specified ID.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
 | Join | Joins an existing multiplayer session.
 | JoinInvited | Overloaded. Joins the specified local gamers, along with the local machine, to an existing network session in response to an InviteAccepted notification event from a non-local session.
Public Method | ResetReady | Resets the IsReady property of all session gamers.
Public Method | StartGame | Changes the session state from NetworkSessionState.Lobby to NetworkSessionState.Playing.
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Updates the state of the multiplayer session.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkSession Class
Microsoft.Xna.Framework.Net Namespace


NetworkSession.AddLocalGamer Method

NetworkSession.AddLocalGamer Method

Adds the specified local gamer profile to the network session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void AddLocalGamer (
         SignedInGamer gamer
)

Parameters

gamer
The gamer to add to the network session

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.BeginCreate Method

NetworkSession.BeginCreate Method

Starts hosting a new multiplayer session.

Expand image Overload List

Name | Description
NetworkSession.BeginCreate (NetworkSessionType, Generic IEnumerable, Int32, Int32, NetworkSessionProperties, AsyncCallback, Object) | Starts hosting a new multiplayer session.
NetworkSession.BeginCreate (NetworkSessionType, Int32, Int32, AsyncCallback, Object) | Starts hosting a new multiplayer session.
NetworkSession.BeginCreate (NetworkSessionType, Int32, Int32, Int32, NetworkSessionProperties, AsyncCallback, Object) | Starts hosting a new multiplayer session.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException One of the following conditions is true:
  • maxGamers is not in the range of gamers that are supported in a network session. The XNA Framework supports multiplayer sessions between two and 31 players in a session for a Windows or an Xbox 360 game.
  • privateGamerSlots is less than 0 or greater than maximumGamers.
InvalidOperationException

One of the following conditions is true:

  • A different session already exists. There can be only one NetworkSession or AvailableNetworkSessionCollection in use at a time. You must dispose any previous session before you create a new one.

  • One of the following methods has been called, but has not yet returned results:

    • NetworkSession.Create
    • NetworkSession.BeginCreate
    • NetworkSession.Find
    • NetworkSession.BeginFind
    • NetworkSession.Join
    • NetworkSession.BeginJoin

    Note that you must wait for any of these methods to return before you can create a new network session. To support this, you may use the asynchronous methods BeginCreate, BeginFind, BeginJoin, and the corresponding EndCreate, EndFind, EndJoin methods to detect when the operation is complete.

ObjectDisposedException | This NetworkSession is disposed.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace


NetworkSession.BeginCreate Method (NetworkSessionType, Generic IEnumerable, Int32, Int32, NetworkSessionProperties, AsyncCallback, Object)

NetworkSession.BeginCreate Method (NetworkSessionType, Generic IEnumerable, Int32, Int32, NetworkSessionProperties, AsyncCallback, Object)
See Also
CollapseAll image

Starts hosting a new multiplayer session. The creation operation is performed asynchronously.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static IAsyncResult BeginCreate (
         NetworkSessionType sessionType,
         IEnumerable<SignedInGamer> localGamers,
         int maxGamers,
         int privateGamerSlots,
         NetworkSessionProperties sessionProperties,
         AsyncCallback callback,
         Object asyncState
)

Parameters

sessionType
Type of session being created.
localGamers
A collection of local gamers to add to the network session. The first gamer in the collection becomes the host; the others are added to the session.
maxGamers
Maximum number of players allowed in this network session. For a Windows or an Xbox 360 game, this value must be between 2 and 31; 31 is the maximum number of players supported in a session.
privateGamerSlots
Number of reserved private session slots created for the session. This value must be less than maximumGamers.
sessionProperties
Properties of the session being created.
callback
The method to be called once the asynchronous operation is finished.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException One of the following conditions is true:
  • maxGamers is not in the range of gamers that are supported in a network session. The XNA Framework supports multiplayer sessions between two and 31 players in a session for a Windows or an Xbox 360 game.
  • privateGamerSlots is less than 0 or greater than maximumGamers.
InvalidOperationException

One of the following conditions is true:

  • A different session already exists. There can be only one NetworkSession or AvailableNetworkSessionCollection in use at a time. You must dispose any previous session before you create a new one.

  • One of the following methods has been called, but has not yet returned results:

    • NetworkSession.Create
    • NetworkSession.BeginCreate
    • NetworkSession.Find
    • NetworkSession.BeginFind
    • NetworkSession.Join
    • NetworkSession.BeginJoin

    Note that you must wait for any of these methods to return before you can create a new network session. To support this, you may use the asynchronous methods BeginCreate, BeginFind, BeginJoin, and the corresponding EndCreate, EndFind, EndJoin methods to detect when the operation is complete.

ObjectDisposedException | This NetworkSession is disposed.

Expand image Remarks

Call EndCreate to get results of the call to BeginCreate.

Windows Specific Information
For Windows-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.
Xbox 360 Specific Information
For Xbox 360-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.BeginCreate Method (NetworkSessionType, Int32, Int32, AsyncCallback, Object)

NetworkSession.BeginCreate Method (NetworkSessionType, Int32, Int32, AsyncCallback, Object)
See Also
CollapseAll image

Starts hosting a new multiplayer session. The creation operation is performed asynchronously.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static IAsyncResult BeginCreate (
         NetworkSessionType sessionType,
         int maxLocalGamers,
         int maxGamers,
         AsyncCallback callback,
         Object asyncState
)

Parameters

sessionType
Type of session being created.
maxLocalGamers
Maximum number of local players on the same gaming machine in this network session.
maxGamers
Maximum number of players allowed in this network session. For games based on Windows or Xbox 360, this value must be between 2 and 31; 31 is the maximum number of players supported in a session.
callback
The method to be called once the asynchronous operation is finished.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException One of the following conditions is true:
  • maxGamers is not in the range of gamers that are supported in a network session. The XNA Framework supports multiplayer sessions between two and 31 players in a session for a Windows or an Xbox 360 game.
  • privateGamerSlots is less than 0 or greater than maximumGamers.
InvalidOperationException

One of the following conditions is true:

  • A different session already exists. There can be only one NetworkSession or AvailableNetworkSessionCollection in use at a time. You must dispose any previous session before you create a new one.

  • One of the following methods has been called, but has not yet returned results:

    • NetworkSession.Create
    • NetworkSession.BeginCreate
    • NetworkSession.Find
    • NetworkSession.BeginFind
    • NetworkSession.Join
    • NetworkSession.BeginJoin

    Note that you must wait for any of these methods to return before you can create a new network session. To support this, you may use the asynchronous methods BeginCreate, BeginFind, BeginJoin, and the corresponding EndCreate, EndFind, EndJoin methods to detect when the operation is complete.

ObjectDisposedException | This NetworkSession is disposed.

Expand image Remarks

Call EndCreate to get results of the call to BeginCreate.

Windows Specific Information
For Windows-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.
Xbox 360 Specific Information
For Xbox 360-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.BeginCreate Method (NetworkSessionType, Int32, Int32, Int32, NetworkSessionProperties, AsyncCallback, Object)

NetworkSession.BeginCreate Method (NetworkSessionType, Int32, Int32, Int32, NetworkSessionProperties, AsyncCallback, Object)
See Also
CollapseAll image

Starts hosting a new multiplayer session. The creation operation is performed asynchronously.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static IAsyncResult BeginCreate (
         NetworkSessionType sessionType,
         int maxLocalGamers,
         int maxGamers,
         int privateGamerSlots,
         NetworkSessionProperties sessionProperties,
         AsyncCallback callback,
         Object asyncState
)

Parameters

sessionType
Type of session being created.
maxLocalGamers
Maximum number of local players on the same gaming machine in this network session.
maxGamers
Maximum number of players allowed in this network session. For games based on Windows or Xbox 360, this value must be between 2 and 31; 31 is the maximum number of players supported in a session.
privateGamerSlots
Number of reserved private session slots created for the session. This value must be less than maximumGamers.
sessionProperties
Properties of the session being created.
callback
The method to be called once the asynchronous operation is finished.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method. Call EndCreate to access these results.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException One of the following conditions is true:
  • maxGamers is not in the range of gamers that are supported in a network session. The XNA Framework supports multiplayer sessions between two and 31 players in a session for a Windows or an Xbox 360 game.
  • privateGamerSlots is less than 0 or greater than maximumGamers.
InvalidOperationException

One of the following conditions is true:

  • A different session already exists. There can be only one NetworkSession or AvailableNetworkSessionCollection in use at a time. You must dispose any previous session before you create a new one.

  • One of the following methods has been called, but has not yet returned results:

    • NetworkSession.Create
    • NetworkSession.BeginCreate
    • NetworkSession.Find
    • NetworkSession.BeginFind
    • NetworkSession.Join
    • NetworkSession.BeginJoin

    Note that you must wait for any of these methods to return before you can create a new network session. To support this, you may use the asynchronous methods BeginCreate, BeginFind, BeginJoin, and the corresponding EndCreate, EndFind, EndJoin methods to detect when the operation is complete.

ObjectDisposedException | This NetworkSession is disposed.

Expand image Remarks

Call EndCreate to get results of the call to BeginCreate.

Windows Specific Information
For Windows-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.
Xbox 360 Specific Information
For Xbox 360-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.BeginFind Method

NetworkSession.BeginFind Method

Starts a matchmaking query to search for available multiplayer sessions. Call EndFind to access the results of this asynchronous call.

Expand image Overload List

Name | Description
NetworkSession.BeginFind (NetworkSessionType, Generic IEnumerable, NetworkSessionProperties, AsyncCallback, Object) | Starts a matchmaking query to search for available multiplayer sessions, specifying a collection of local gamers to add to the network session.
NetworkSession.BeginFind (NetworkSessionType, Int32, NetworkSessionProperties, AsyncCallback, Object) | Starts a matchmaking query to search for available multiplayer sessions.

Expand image Exceptions

Exception type | Condition
ArgumentException | BeginFind cannot be used from NetworkSession objects of session type NetworkSessionType.Local.
ArgumentOutOfRangeException | maxLocalGamers must be between 1 and 4.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace


NetworkSession.BeginFind Method (NetworkSessionType, Generic IEnumerable, NetworkSessionProperties, AsyncCallback, Object)

NetworkSession.BeginFind Method (NetworkSessionType, Generic IEnumerable, NetworkSessionProperties, AsyncCallback, Object)
See Also
CollapseAll image

Starts a matchmaking query to search for available multiplayer sessions, specifying a collection of local gamers to add to the network session. Call EndFind to access the results of this asynchronous call.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static IAsyncResult BeginFind (
         NetworkSessionType sessionType,
         IEnumerable<SignedInGamer> localGamers,
         NetworkSessionProperties searchProperties,
         AsyncCallback callback,
         Object asyncState
)

Parameters

sessionType
Type of session sought.
localGamers
A collection of local gamers to add to the network session.
searchProperties
Optional session properties to match during the search. If this argument is null, the query results will not be filtered based on properties of available sessions. If any of the search property values in searchProperties are specified, the query returns only sessions with matching properties. null items in the searchProperties collection will match to any value for that session property.
callback
Method to be called once the asynchronous operation is finished.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method.

Expand image Exceptions

Exception type | Condition
ArgumentException | BeginFind cannot be used from NetworkSession objects of session type NetworkSessionType.Local.
ArgumentOutOfRangeException | maxLocalGamers must be between 1 and 4.

Expand image Remarks

The collection of gamers provided in localGamers are not added to a session until NetworkSession.Join is called with one of the sessions returned from the search. The gamers are provided here for matchmaking purposes.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.BeginFind Method (NetworkSessionType, Int32, NetworkSessionProperties, AsyncCallback, Object)

NetworkSession.BeginFind Method (NetworkSessionType, Int32, NetworkSessionProperties, AsyncCallback, Object)
See Also
CollapseAll image

Starts a matchmaking query to search for available multiplayer sessions. Call EndFind to access the results of this asynchronous call.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static IAsyncResult BeginFind (
         NetworkSessionType sessionType,
         int maxLocalGamers,
         NetworkSessionProperties searchProperties,
         AsyncCallback callback,
         Object asyncState
)

Parameters

sessionType
Type of session sought.
maxLocalGamers
Maximum number of local players on the same gaming machine in this network session.
searchProperties
Optional session properties to match during the search. If this argument is null, query results will not be filtered based on properties of available sessions. If any search property values in searchProperties are specified, the query returns only sessions with matching properties. null items in the searchProperties collection will match to any value for that session property.
callback
Method to be called once the asynchronous operation is finished.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method.

Expand image Exceptions

Exception type | Condition
ArgumentException | BeginFind cannot be used from NetworkSession objects of session type NetworkSessionType.Local.
ArgumentOutOfRangeException | maxLocalGamers must be between 1 and 4.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.BeginJoin Method

NetworkSession.BeginJoin Method

Starts a join operation for the specified multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static IAsyncResult BeginJoin (
         AvailableNetworkSession availableSession,
         AsyncCallback callback,
         Object asyncState
)

Parameters

availableSession
Session the gamer is attempting to join.
callback
The method to be called once the asynchronous operation is finished.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method. Call EndJoin to access these results.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | availableSession is null.
ObjectDisposedException | availableSession is disposed.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.BeginJoinInvited Method

NetworkSession.BeginJoinInvited Method

Starts joining an existing network session in response to an InviteAccepted notification event. Call EndJoinInvited to access the asynchronous method results.

Expand image Overload List

Name | Description
NetworkSession.BeginJoinInvited (Generic IEnumerable, AsyncCallback, Object) | Starts joining an existing network session in response to an InviteAccepted notification event with the specified collection of local gamers.
NetworkSession.BeginJoinInvited (Int32, AsyncCallback, Object) | Starts joining an existing network session in response to an InviteAccepted notification event.

Expand image Remarks

See Inviting Players to Join Your Game for more information about adding game invitation support to your title.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace


NetworkSession.BeginJoinInvited Method (Generic IEnumerable, AsyncCallback, Object)

NetworkSession.BeginJoinInvited Method (Generic IEnumerable, AsyncCallback, Object)
See Also
CollapseAll image

Starts joining an existing network session in response to an InviteAccepted notification event with the specified collection of local gamers. Call EndJoinInvited to access the asynchronous method results.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static IAsyncResult BeginJoinInvited (
         IEnumerable<SignedInGamer> localGamers,
         AsyncCallback callback,
         Object asyncState
)

Parameters

localGamers
A collection of local signed-in gamers to add to the network session.
callback
Method to be called at the conclusion of the asynchronous operation.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method.

Expand image Remarks

See Inviting Players to Join Your Game for more information about adding game invitation support to your title.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.BeginJoinInvited Method (Int32, AsyncCallback, Object)

NetworkSession.BeginJoinInvited Method (Int32, AsyncCallback, Object)
See Also
CollapseAll image

Starts joining an existing network session in response to an InviteAccepted notification event. Call EndJoinInvited to access the asynchronous method results.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static IAsyncResult BeginJoinInvited (
         int maxLocalGamers,
         AsyncCallback callback,
         Object asyncState
)

Parameters

maxLocalGamers
The number of local signed-in gamers to add to the network session when accepting the invite. This must be at least one, and can be as high as the limit imposed by the title or the platform. On Windows, this value must always be set to one.
callback
Method to be called at the conclusion of the asynchronous operation.
asyncState
State of the asynchronous operation.

Return Value

An IAsyncResult used to track the progress of the method.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | maxLocalGamers must be between 1 and 4.

Expand image Remarks

If there are fewer signed-in gamers than the number specified in maxLocalGamers, all currently available signed-in gamers are added. This method does not allow specifying particular signed-in gamers in the event that there are more local signed-in gamers than the number to add.

See Inviting Players to Join Your Game for more information about adding game invitation support to your title.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.Create Method

NetworkSession.Create Method

Hosts a new multiplayer session.

Expand image Overload List

Name | Description
NetworkSession.Create (NetworkSessionType, Generic IEnumerable, Int32, Int32, NetworkSessionProperties) | Starts hosting a new multiplayer session.
NetworkSession.Create (NetworkSessionType, Int32, Int32) | Starts hosting a new multiplayer session.
NetworkSession.Create (NetworkSessionType, Int32, Int32, Int32, NetworkSessionProperties) | Starts hosting a new multiplayer session.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException One of the following conditions is true:
  • maxGamers is not in the range of gamers that are supported in a network session. The XNA Framework supports multiplayer sessions between two and 31 players in a session for a Windows or an Xbox 360 game.
  • privateGamerSlots is less than 0 or greater than maximumGamers.
InvalidOperationException

One of the following conditions is true:

  • A different session already exists. There can be only one NetworkSession or AvailableNetworkSessionCollection in use at a time. You must dispose any previous session before you create a new one.

  • One of the following methods has been called, but has not yet returned results:

    • NetworkSession.Create
    • NetworkSession.BeginCreate
    • NetworkSession.Find
    • NetworkSession.BeginFind
    • NetworkSession.Join
    • NetworkSession.BeginJoin

    Note that you must wait for any of these methods to return before you can create a new network session. To support this, you may use the asynchronous methods BeginCreate, BeginFind, BeginJoin, and the corresponding EndCreate, EndFind, EndJoin methods to detect when the operation is complete.

ObjectDisposedException | This NetworkSession is disposed.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace


NetworkSession.Create Method (NetworkSessionType, Generic IEnumerable, Int32, Int32, NetworkSessionProperties)

NetworkSession.Create Method (NetworkSessionType, Generic IEnumerable, Int32, Int32, NetworkSessionProperties)
See Also
CollapseAll image

Starts hosting a new multiplayer session. This method blocks until the operation is complete.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static NetworkSession Create (
         NetworkSessionType sessionType,
         IEnumerable<SignedInGamer> localGamers,
         int maxGamers,
         int privateGamerSlots,
         NetworkSessionProperties sessionProperties
)

Parameters

sessionType
Type of session being hosted.
localGamers
A collection of local gamers to add to the network session. The first gamer in the collection becomes the host; the others are added to the session.
maxGamers
Maximum number of players allowed in this network session. This value for games based on Windows or Xbox 360 must be between 2 and 31; 31 is the maximum number of players supported in a session.
privateGamerSlots
Number of reserved private session slots created for the session. This value must be less than maxGamers.
sessionProperties
Properties of the session being created.

Return Value

The newly hosted session.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException One of the following conditions is true:
  • maxGamers is not in the range of gamers that are supported in a network session. The XNA Framework supports multiplayer sessions between two and 31 players in a session for a Windows or an Xbox 360 game.
  • privateGamerSlots is less than 0 or greater than maximumGamers.
InvalidOperationException

One of the following conditions is true:

  • A different session already exists. There can be only one NetworkSession or AvailableNetworkSessionCollection in use at a time. You must dispose any previous session before you create a new one.

  • One of the following methods has been called, but has not yet returned results:

    • NetworkSession.Create
    • NetworkSession.BeginCreate
    • NetworkSession.Find
    • NetworkSession.BeginFind
    • NetworkSession.Join
    • NetworkSession.BeginJoin

    Note that you must wait for any of these methods to return before you can create a new network session. To support this, you may use the asynchronous methods BeginCreate, BeginFind, BeginJoin, and the corresponding EndCreate, EndFind, EndJoin methods to detect when the operation is complete.

ObjectDisposedException | This NetworkSession is disposed.

Expand image Remarks

The session continues even if one or more profiles sign out. Signed-out players are removed from the session, but the session ends only if no suitable players remain in the session.

Windows Specific Information
For Windows-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.
Xbox 360 Specific Information
For Xbox 360-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.Create Method (NetworkSessionType, Int32, Int32)

NetworkSession.Create Method (NetworkSessionType, Int32, Int32)
See Also
CollapseAll image

Starts hosting a new multiplayer session. This method blocks until the operation is complete.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static NetworkSession Create (
         NetworkSessionType sessionType,
         int maxLocalGamers,
         int maxGamers
)

Parameters

sessionType
Type of session being hosted.
maxLocalGamers
Maximum number of local players on the same gaming machine in this network session.
maxGamers
Maximum number of players allowed in this network session. This value for games based on Windows or Xbox 360 must be between 2 and 31; 31 is the maximum number of players supported in a session.

Return Value

The newly hosted session.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException One of the following conditions is true:
  • maxGamers is not in the range of gamers that are supported in a network session. The XNA Framework supports multiplayer sessions between two and 31 players in a session for a Windows or an Xbox 360 game.
  • privateGamerSlots is less than 0 or greater than maximumGamers.
InvalidOperationException

One of the following conditions is true:

  • A different session already exists. There can be only one NetworkSession or AvailableNetworkSessionCollection in use at a time. You must dispose any previous session before you create a new one.

  • One of the following methods has been called, but has not yet returned results:

    • NetworkSession.Create
    • NetworkSession.BeginCreate
    • NetworkSession.Find
    • NetworkSession.BeginFind
    • NetworkSession.Join
    • NetworkSession.BeginJoin

    Note that you must wait for any of these methods to return before you can create a new network session. To support this, you may use the asynchronous methods BeginCreate, BeginFind, BeginJoin, and the corresponding EndCreate, EndFind, EndJoin methods to detect when the operation is complete.

ObjectDisposedException | This NetworkSession is disposed.

Expand image Remarks

The session continues even if one or more profiles sign out. Signed-out players are removed from the session, but the session ends only if no suitable players remain in the session.

Windows Specific Information
For Windows-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.
Xbox 360 Specific Information
For Xbox 360-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.Create Method (NetworkSessionType, Int32, Int32, Int32, NetworkSessionProperties)

NetworkSession.Create Method (NetworkSessionType, Int32, Int32, Int32, NetworkSessionProperties)
See Also
CollapseAll image

Starts hosting a new multiplayer session. This method blocks until the operation is complete.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static NetworkSession Create (
         NetworkSessionType sessionType,
         int maxLocalGamers,
         int maxGamers,
         int privateGamerSlots,
         NetworkSessionProperties sessionProperties
)

Parameters

sessionType
Type of session being hosted.
maxLocalGamers
Maximum number of local players on the same gaming machine in this network session.
maxGamers
Maximum number of players allowed in this network session. This value for games based on Windows or Xbox 360 must be between 2 and 31; 31 is the maximum number of players supported in a session.
privateGamerSlots
Number of reserved private session slots created for the session. This value must be less than maxGamers.
sessionProperties
Properties of the session being created.

Return Value

The newly hosted session.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException One of the following conditions is true:
  • maxGamers is not in the range of gamers that are supported in a network session. The XNA Framework supports multiplayer sessions between two and 31 players in a session for a Windows or an Xbox 360 game.
  • privateGamerSlots is less than 0 or greater than maximumGamers.
InvalidOperationException

One of the following conditions is true:

  • A different session already exists. There can be only one NetworkSession or AvailableNetworkSessionCollection in use at a time. You must dispose any previous session before you create a new one.

  • One of the following methods has been called, but has not yet returned results:

    • NetworkSession.Create
    • NetworkSession.BeginCreate
    • NetworkSession.Find
    • NetworkSession.BeginFind
    • NetworkSession.Join
    • NetworkSession.BeginJoin

    Note that you must wait for any of these methods to return before you can create a new network session. To support this, you may use the asynchronous methods BeginCreate, BeginFind, BeginJoin, and the corresponding EndCreate, EndFind, EndJoin methods to detect when the operation is complete.

ObjectDisposedException | This NetworkSession is disposed.

Expand image Remarks

The session continues even if one or more profiles sign out. Signed-out players are removed from the session, but the session ends only if no suitable players remain in the session.

Windows Specific Information
For Windows-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.
Xbox 360 Specific Information
For Xbox 360-based games, maxGamers must be between 2 and 31; 31 is the maximum number of players supported in a session.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.Dispose Method

NetworkSession.Dispose Method

Ends the current multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.EndCreate Method

NetworkSession.EndCreate Method

Gets the result from a BeginCreate asynchronous call.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static NetworkSession EndCreate (
         IAsyncResult result
)

Parameters

result
An IAsyncResult used to track the progress of the operation.

Return Value

The session being created.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.EndFind Method

NetworkSession.EndFind Method

Gets the result from a BeginFind asynchronous call.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static AvailableNetworkSessionCollection EndFind (
         IAsyncResult result
)

Parameters

result
An IAsyncResult used to track the progress of the operation.

Return Value

Collection of sessions matching the search criteria.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.EndGame Method

NetworkSession.EndGame Method

Changes the session state from NetworkSessionState.Playing to NetworkSessionState.Lobby.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void EndGame ()

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | This is disposed.
InvalidOperationException | This NetworkSession is not the host, or is in an invalid state to call this method.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.EndJoin Method

NetworkSession.EndJoin Method

Gets the result from a BeginJoin asynchronous call.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static NetworkSession EndJoin (
         IAsyncResult result
)

Parameters

result
An IAsyncResult used to track the progress of the operation.

Return Value

The session being joined by the gamer.

Expand image Exceptions

Exception type Condition
NetworkSessionJoinException The session either is full, is not joinable, or cannot be found.
  • If the session is full, the specified session does not have enough open slots for all the local gamers signed in to this machine.
  • If it is not joinable, you must wait for the host to return to the lobby before joining.
  • If it cannot be found, the session may have ended, or there may be no network connectivity between the local machine and session host.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.EndJoinInvited Method

NetworkSession.EndJoinInvited Method

Gets the result from a BeginJoinInvited asynchronous call.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static NetworkSession EndJoinInvited (
         IAsyncResult result
)

Parameters

result
An IAsyncResult used to track the progress of the operation.

Return Value

The session being joined by the gamer.

Expand image Exceptions

Exception type Condition
NetworkSessionJoinException The session either is full, is not joinable, or cannot be found.
  • If the session is full, the specified session does not have enough open slots for all the local gamers signed in to this machine.
  • If it is not joinable, you must wait for the host to return to the lobby before joining.
  • If it cannot be found, the session may have ended, or there may be no network connectivity between the local machine and session host.

Expand image Remarks

See Inviting Players to Join Your Game for more information about adding game invitation support to your title.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.Find Method

NetworkSession.Find Method

Issues a matchmaking query, searching for available multiplayer sessions. This method blocks until the operation has completed.

Expand image Overload List

Name | Description
NetworkSession.Find (NetworkSessionType, Generic IEnumerable, NetworkSessionProperties) | Issues a matchmaking query, searching for available multiplayer sessions.
NetworkSession.Find (NetworkSessionType, Int32, NetworkSessionProperties) | Issues a matchmaking query, searching for available multiplayer sessions.

Expand image See Also

Tasks

Finding and Joining a Network Session

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace


NetworkSession.Find Method (NetworkSessionType, Generic IEnumerable, NetworkSessionProperties)

NetworkSession.Find Method (NetworkSessionType, Generic IEnumerable, NetworkSessionProperties)
See Also
CollapseAll image

Issues a matchmaking query, searching for available multiplayer sessions. This method blocks until the operation has completed.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static AvailableNetworkSessionCollection Find (
         NetworkSessionType sessionType,
         IEnumerable<SignedInGamer> localGamers,
         NetworkSessionProperties searchProperties
)

Parameters

sessionType
Type of session sought.
localGamers
A collection of local gamers to add to the network session.
searchProperties
Optional session properties to match during the search. If this argument is null, the query results will not be filtered based on the session properties of available sessions. If any of the search property values in searchProperties are specified, only sessions with matching properties will be returned by the query. null items in the searchProperties collection will match to any value for that session property.

Return Value

Collection of available network multiplayer sessions.

Expand image Exceptions

Exception type | Condition
ArgumentException | Find cannot be used from NetworkSession objects of session type NetworkSessionType.Local.
ArgumentOutOfRangeException | maxLocalGamers must be between 1 and 4.

Expand image Remarks

The collection of gamers provided in localGamers are not added to a session until NetworkSession.Join is called with one of the sessions returned from the search. The gamers are provided here for matchmaking purposes.

Expand image See Also

Tasks

Finding and Joining a Network Session

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.Find Method (NetworkSessionType, Int32, NetworkSessionProperties)

NetworkSession.Find Method (NetworkSessionType, Int32, NetworkSessionProperties)
See Also
CollapseAll image

Issues a matchmaking query, searching for available multiplayer sessions. This method blocks until the operation has completed.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static AvailableNetworkSessionCollection Find (
         NetworkSessionType sessionType,
         int maxLocalGamers,
         NetworkSessionProperties searchProperties
)

Parameters

sessionType
Type of session sought.
maxLocalGamers
Maximum number of local players on the same gaming machine in this network session.
searchProperties
Optional session properties to match during the search. If this argument is null, the query results will not be filtered based on the session properties of available sessions. If any of the search property values in searchProperties are specified, only sessions with matching properties will be returned by the query. null items in the searchProperties collection will match to any value for that session property.

Return Value

Collection of available network multiplayer sessions.

Expand image Exceptions

Exception type | Condition
ArgumentException | Find cannot be used from NetworkSession objects of session type NetworkSessionType.Local.
ArgumentOutOfRangeException | maxLocalGamers must be between 1 and 4.

Expand image See Also

Tasks

Finding and Joining a Network Session

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.FindGamerById Method

NetworkSession.FindGamerById Method

Looks up the network gamer with the specified ID. Returns null if the session contains no matching gamer.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkGamer FindGamerById (
         byte gamerId
)

Parameters

gamerId
Identifier specifying the network gamer for which to search.

Return Value

Network gamer matching the requested ID, or null if no matching gamer was found.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.Join Method

NetworkSession.Join Method

Joins an existing multiplayer session. This method blocks until the operation has completed.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static NetworkSession Join (
         AvailableNetworkSession availableSession
)

Parameters

availableSession
An existing multiplayer session.

Return Value

Session joined by the gamer.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | availableSession is null.
ObjectDisposedException | availableSession is disposed.
NetworkSessionJoinException The session either is full, is not joinable, or cannot be found.
  • If the session is full, the specified session does not have enough open slots for all the local gamers signed in to this machine.
  • If it is not joinable, you must wait for the host to return to the lobby before joining.
  • If it cannot be found, the session may have ended, or there may be no network connectivity between the local machine and session host.

Expand image Remarks

Use the Find or BeginFind methods to search for available sessions.

Behavior of Local Sessions

XNA Game Studio 3.0 introduces a change in the behavior of network sessions when local profiles sign out in the middle of a session. In previous versions of XNA Game Studio, a session ended whenever a player signed out. Now the session continues even if one or more profiles sign out. Signed-out players are removed from the session, but the session ends only if no suitable players remain in the session.

Expand image See Also

Tasks

Finding and Joining a Network Session

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.JoinInvited Method

NetworkSession.JoinInvited Method

Joins the specified local gamers, along with the local machine, to an existing network session in response to an InviteAccepted notification event from a non-local session.
Note
Use the NetworkSession.AddLocalGamer method to join players to a session in response to an InviteAccepted notification event for a session that already exists locally, as indicated by IsCurrentSession.

Expand image Overload List

Name | Description
NetworkSession.JoinInvited (Generic IEnumerable) | Joins the specified local gamers, along with the local machine, to an existing network session in response to an InviteAccepted notification event from a non-local session.
NetworkSession.JoinInvited (Int32) | Joins the local machine to an existing network session in response to an InviteAccepted notification event from a non-local session.

Expand image Exceptions

Exception type Condition
NetworkSessionJoinException The session either is full, is not joinable, or cannot be found.
  • If the session is full, the specified session does not have enough open slots for all the local gamers signed in to this machine.
  • If it is not joinable, you must wait for the host to return to the lobby before you can join it.
  • If it cannot be found, the session may have ended, or there may be no network connectivity between the local machine and session host.

Expand image Remarks

This method blocks until the operation has completed. For an asynchronous version of this method, see BeginJoinInvited.

Expand image See Also

Reference

Guide.ShowGameInvite Method
NetworkSession.InviteAccepted Event
NetworkSession.BeginJoinInvited Method
NetworkSession.EndJoinInvited Method
NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace


NetworkSession.JoinInvited Method (Generic IEnumerable)

NetworkSession.JoinInvited Method (Generic IEnumerable)
See Also
CollapseAll image

Joins the specified local gamers, along with the local machine, to an existing network session in response to an InviteAccepted notification event from a non-local session.
Note
Use the NetworkSession.AddLocalGamer method to join players to a session in response to an InviteAccepted notification event for a session that already exists locally, as indicated by IsCurrentSession.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static NetworkSession JoinInvited (
         IEnumerable<SignedInGamer> localGamers
)

Parameters

localGamers
A collection of local signed-in gamers to add to the network session.

Return Value

The network session.

Expand image Exceptions

Exception type Condition
NetworkSessionJoinException The session either is full, is not joinable, or cannot be found.
  • If the session is full, the specified session does not have enough open slots for all the local gamers signed in to this machine.
  • If it is not joinable, you must wait for the host to return to the lobby before you can join it.
  • If it cannot be found, the session may have ended, or there may be no network connectivity between the local machine and session host.

Expand image Remarks

This method blocks until the operation has completed. For an asynchronous version of this method, see BeginJoinInvited.

Expand image See Also

Reference

Guide.ShowGameInvite Method
NetworkSession.InviteAccepted Event
NetworkSession.BeginJoinInvited Method
NetworkSession.EndJoinInvited Method
NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.JoinInvited Method (Int32)

NetworkSession.JoinInvited Method (Int32)
See Also
CollapseAll image

Joins the local machine to an existing network session in response to an InviteAccepted notification event from a non-local session.
Note
Use the NetworkSession.AddLocalGamer method to join players to a session in response to an InviteAccepted notification event for a session that already exists locally, as indicated by IsCurrentSession.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static NetworkSession JoinInvited (
         int maxLocalGamers
)

Parameters

maxLocalGamers
The number of local signed-in gamers to add to the network session when accepting the invite. This must be at least one, and can be as high as the limit imposed by either the title or platform. On Windows, this value must always be set to one.

Return Value

The network session.

Expand image Exceptions

Exception type Condition
NetworkSessionJoinException The session either is full, is not joinable, or cannot be found.
  • If the session is full, the specified session does not have enough open slots for all the local gamers signed in to this machine.
  • If it is not joinable, you must wait for the host to return to the lobby before joining.
  • If it cannot be found, the session may have ended, or there may be no network connectivity between the local machine and session host.

Expand image Remarks

If there are fewer signed-in gamers than the number specified in maxLocalGamers, all currently-available signed-in gamers will be added. This method does not allow specifying particular signed-in gamers in the event that there are more local signed-in gamers than the number to add.

This method blocks until the operation has completed. For an asynchronous version of this method, see BeginJoinInvited.

Expand image See Also

Reference

Guide.ShowGameInvite Method
NetworkSession.InviteAccepted Event
NetworkSession.BeginJoinInvited Method
NetworkSession.EndJoinInvited Method
NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.ResetReady Method

NetworkSession.ResetReady Method

Resets the IsReady property of all session gamers.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void ResetReady ()

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | This is disposed.
InvalidOperationException | This NetworkSession is not the host, or is in an invalid state to call this method.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.StartGame Method

NetworkSession.StartGame Method

Changes the session state from NetworkSessionState.Lobby to NetworkSessionState.Playing.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void StartGame ()

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | This is disposed.
InvalidOperationException | This NetworkSession is not the host, or is in an invalid state to call this method.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.Update Method

NetworkSession.Update Method

Updates the state of the multiplayer session. Call this method at regular intervals—for example, from the Game.Update method.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void Update ()

Expand image Exceptions

Exception type | Condition
ObjectDisposedException | This object has already been disposed.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession Properties

NetworkSession Properties

Expand image Public Properties

 | Name | Description
Public Property | AllGamers | Gets the collection of gamers currently in the session.
Public Property | AllowHostMigration | Gets or sets whether host migration is allowed. This can be read by any machine in the session, but can only be changed by the host. The default value is false indicating that host migration is disabled.
Public Property | AllowJoinInProgress | Gets or sets whether join-in-progress is allowed. If the host enables this setting, new machines will be able to join at any time. The default value is false, indicating that join-in-progress is disabled. AllowJoinInProgress can be read by any machine in the session, but can only be changed by the host.
Public Property | BytesPerSecondReceived | Gets a performance counter recording the amount of data being received from the network.
Public Property | BytesPerSecondSent | Gets a performance counter recording the amount of data being sent over the network.
Public Property | Host | Gets the current host of the multiplayer session.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | IsEveryoneReady | Determines whether all gamers are ready to enter the session.
Public Property | IsHost | Determines whether this machine is the session host.
Public Property | LocalGamers | Get the collection of local gamers for a multiplayer session.
Public Property | MaxGamers | Gets or sets the maximum number of players able to join this multiplayer session.
Public Property | PreviousGamers | A collection of previous gamers in the network session.
Public Property | PrivateGamerSlots | Gets or sets the number of private slots reserved for gamers who join using an invitation.
Public Property | RemoteGamers | Gets the collection of remote gamers for a multiplayer session.
Public Property | SessionProperties | Gets any custom properties that have been attached to the session.
Public Property | SessionState | Gets the current state of a multiplayer session.
Public Property | SessionType | Gets the current multiplayer session type.
Public Property | SimulatedLatency | Gets or sets the amount of simulated network latency.
Public Property | SimulatedPacketLoss | Gets or sets the amount of simulated packet loss.

Expand image See Also

Reference

NetworkSession Class
Microsoft.Xna.Framework.Net Namespace


NetworkSession.AllGamers Property

NetworkSession.AllGamers Property

Gets the collection of gamers currently in the session. This is the union of everything in LocalGamers and RemoteGamers.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public GamerCollection<NetworkGamer> AllGamers { get; }

Property Value

Collection of gamers in the session.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.AllowHostMigration Property

NetworkSession.AllowHostMigration Property

Gets or sets whether host migration is allowed. This can be read by any machine in the session, but can only be changed by the host. The default value is false indicating that host migration is disabled.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool AllowHostMigration { get; set; }

Property Value

true to enable host migration; false to disable host migration. The default value is false.

Expand image Exceptions

Exception type | Condition
InvalidOperationException | This session is not the host, and cannot change the value of AllowHostMigration.
ObjectDisposedException | The session has been disposed.

Expand image Remarks

When host migration is disabled (the default state), the session will be ended if the host leaves the game or there is a network disconnect. If the host enables this setting, after they leave or disconnect a new host will automatically be selected from the machines remaining in the session, and the HostChanged event will be raised to notify you of the change. Note that game simulation state is not automatically transferred during the migration process. It is usually relatively easy for peer-to-peer games to support host migration, but rather more difficult to make this work in a client/server architecture.

Expand image See Also

Concepts

Network Topologies and Host Migration

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.AllowJoinInProgress Property

NetworkSession.AllowJoinInProgress Property

Gets or sets whether join-in-progress is allowed. If the host enables this setting, new machines will be able to join at any time. The default value is false, indicating that join-in-progress is disabled. AllowJoinInProgress can be read by any machine in the session, but can only be changed by the host.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool AllowJoinInProgress { get; set; }

Property Value

true to enable join-in-progress, false otherwise. The default value is false.

Expand image Exceptions

Exception type | Condition
NotSupportedException | Join-in-progress is not supported for multiplayer sessions of type NetworkSessionType.Ranked.
InvalidOperationException | This session is not the host, and cannot change the value of AllowJoinInProgress.
ObjectDisposedException | The session has been disposed.

Expand image Remarks

When join-in-progress is disabled (the default state), new machines are only able to join while the session is in the lobby. The session will not be visible to matchmaking queries while in the actual gameplay state.

Expand image See Also

Tasks

Joining an In-Progress Game

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.BytesPerSecondReceived Property

NetworkSession.BytesPerSecondReceived Property

Gets a performance counter recording the amount of data being received from the network.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int BytesPerSecondReceived { get; }

Property Value

A performance counter recording the amount of data being received from the network.

Expand image Remarks

Developers can use this to monitor how much network bandwidth their game is using.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.BytesPerSecondSent Property

NetworkSession.BytesPerSecondSent Property

Gets a performance counter recording the amount of data being sent over the network.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int BytesPerSecondSent { get; }

Property Value

A performance counter recording the amount of data being sent over the network.

Expand image Remarks

Developers can use this to monitor how much network bandwidth their game is using.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.Host Property

NetworkSession.Host Property

Gets the current host of the multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkGamer Host { get; }

Property Value

The gamer currently hosting the session.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.IsDisposed Property

NetworkSession.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.IsEveryoneReady Property

NetworkSession.IsEveryoneReady Property

Determines whether all gamers are ready to enter the session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsEveryoneReady { get; }

Property Value

true if all gamers are ready to leave the lobby screen and begin gameplay. This state is indicated by a setting of true for the IsReady property.

Expand image See Also

Tasks

Managing Player Movement Between Lobby and Gameplay Modes

Reference

IsReady
NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.IsHost Property

NetworkSession.IsHost Property

Determines whether this machine is the session host.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsHost { get; }

Property Value

true if this machine is the session host; false otherwise.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.LocalGamers Property

NetworkSession.LocalGamers Property

Get the collection of local gamers for a multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public GamerCollection<LocalNetworkGamer> LocalGamers { get; }

Property Value

Collection of local gamers of a network session. For a complete collection of gamers, access the AllGamers property.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.MaxGamers Property

NetworkSession.MaxGamers Property

Gets or sets the maximum number of players able to join this multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int MaxGamers { get; set; }

Property Value

Maximum number of players supported by the multiplayer session. Only the host can modify this value.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | MaxGamers must be between 2 and 31 players for Windows-based and Xbox 360-based games.
ObjectDisposedException | This NetworkSession is disposed.
InvalidOperationException | This NetworkSession is not the host; therefore, it cannot set the property MaxGamers.

Expand image Remarks

Windows Specific Information

For Windows-based games, MaxGamers must be between 2 and 31, where 31 is the maximum number of players supported in a session.

Xbox 360 Specific Information

For Xbox 360-based games, MaxGamers must be between 2 and 31, where 31 is the maximum number of players supported in a session.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.PreviousGamers Property

NetworkSession.PreviousGamers Property

A collection of previous gamers in the network session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public GamerCollection<NetworkGamer> PreviousGamers { get; }

Property Value

A collection of gamers who once belonged to the current network session, but have since left.

Expand image Remarks

The number of gamers in the PreviousGamers collection will be equal to or less than the value of MaxPreviousGamers. You can use this collection to include previous gamers in Guide calls that take a Gamer parameter.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.PrivateGamerSlots Property

NetworkSession.PrivateGamerSlots Property

Gets or sets the number of private slots reserved for gamers who join using an invitation.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int PrivateGamerSlots { get; set; }

Property Value

Number of private slots.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | There are not enough slots available to support this new value.
ObjectDisposedException | This NetworkSession is disposed.
InvalidOperationException | This NetworkSession is not the host, therefore it cannot set the property PrivateGamerSlots.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.RemoteGamers Property

NetworkSession.RemoteGamers Property

Gets the collection of remote gamers for a multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public GamerCollection<NetworkGamer> RemoteGamers { get; }

Property Value

Collection of remote gamers of a network session. For a complete collection of gamers, access the AllGamers property.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.SessionProperties Property

NetworkSession.SessionProperties Property

Gets any custom properties that have been attached to the session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionProperties SessionProperties { get; }

Property Value

Any custom properties that have been attached to the session.

Expand image Remarks

This NetworkSessionProperties is automatically synchronized across all the machines in the session, and can only be modified by the host. It can be used to filter sessions during matchmaking operations by passing in a set of required property values to Find or BeginFind.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.SessionState Property

NetworkSession.SessionState Property

Gets the current state of a multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionState SessionState { get; }

Property Value

Current state of the session.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.SessionType Property

NetworkSession.SessionType Property

Gets the current multiplayer session type.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionType SessionType { get; }

Property Value

The type of the multiplayer session.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.SimulatedLatency Property

NetworkSession.SimulatedLatency Property

Gets or sets the amount of simulated network latency.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public TimeSpan SimulatedLatency { get; set; }

Property Value

The amount of simulated network latency, in milliseconds. The default value is 0.

Expand image Remarks

SimulatedLatency is useful if you are testing a system link game on a fast local network and want to make sure it will also work correctly over the Internet. Xbox games are typically expected to work with up to 200 milliseconds of latency.

The latency simulation is applied on the sending machine, so if you set this property differently on each machine, only outgoing packets will be affected by the local value of the property. Latency introduced through this setting is not included in the RoundtripTime property, which always just reports the physical network latency.

Packets sent without any ordering guarantee will be given a random latency normally distributed around the specified value, introducing packet reordering as well as raw latency. Packets sent using SendDataOptions.InOrder will be delayed without reordering.

Caution

The packet loss and latency simulation in the XNA Framework applies to messages that are sent to all players, including local players. In game designs where data to local players is sent and received using the network session SendData methods, local players will experience the set values for simulated packet loss and latency. To work around this issue, avoid broadcasting messages to all users and set SimulatedPacketLoss and SimulatedLatency on a per-send basis.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.SimulatedPacketLoss Property

NetworkSession.SimulatedPacketLoss Property

Gets or sets the amount of simulated packet loss.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public float SimulatedPacketLoss { get; set; }

Property Value

The amount of simulated packet loss, expressed as any fractional probability in the range 0 to 1, with 1 causing 100% packet loss. The default value is zero.

Expand image Remarks

SimulatedPacketLoss is useful if you are testing a system link game on a fast local network and want to make sure it will also work correctly over the Internet. Xbox games are typically expected to work with up to 0.1 (10%) packet loss.

The packet loss simulation is applied on the sending machine, so if you set this property differently on each machine, only outgoing packets will be affected by the local value of the property.

Packets sent using SendDataOptions.Reliable are not affected by this setting.

Caution

The packet loss and latency simulation in the XNA Framework applies to messages that are sent to all players, including local players. In game designs where data to local players is sent and received using the network session SendData methods, local players will experience the set values for simulated packet loss and latency. To work around this issue, avoid broadcasting messages to all users and set SimulatedPacketLoss and SimulatedLatency on a per-send basis.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession Events

NetworkSession Events

Expand image Public Events

 | Name | Description
Public Event | GameEnded | Occurs when the game moves from gameplay to the lobby.
Public Event | GamerJoined | Occurs when a new player joins a multiplayer session.
Public Event | GamerLeft | Occurs when a player leaves the multiplayer session.
Public Event | GameStarted | Occurs when the game moves from the lobby into actual gameplay.
Public Event | HostChanged | Occurs when the session host has changed.
 | InviteAccepted | Event that occurs when a user has accepted an invitation to join a network session.
Public Event | SessionEnded | Occurs when the multiplayer session ends.
Public Event | WriteArbitratedLeaderboard | TBD
Public Event | WriteTrueSkill | TBD
Public Event | WriteUnarbitratedLeaderboard | TBD

Expand image See Also

Reference

NetworkSession Class
Microsoft.Xna.Framework.Net Namespace


NetworkSession.GameEnded Event

NetworkSession.GameEnded Event

Occurs when the game moves from gameplay to the lobby.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public event EventHandler<GameEndedEventArgs> GameEnded

Expand image See Also

Tasks

Managing Player Movement Between Lobby and Gameplay Modes

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.GamerJoined Event

NetworkSession.GamerJoined Event

Occurs when a new player joins a multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public event EventHandler<GamerJoinedEventArgs> GamerJoined

Expand image Remarks

This event is raised for both local and remote players, including when the session is first created.

Expand image See Also

Tasks

Joining and Leaving a Game
Joining an In-Progress Game

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.GamerLeft Event

NetworkSession.GamerLeft Event

Occurs when a player leaves the multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public event EventHandler<GamerLeftEventArgs> GamerLeft

Expand image Remarks

This event is raised for both local and remote gamers.

Expand image See Also

Tasks

Joining and Leaving a Game

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.GameStarted Event

NetworkSession.GameStarted Event

Occurs when the game moves from the lobby into actual gameplay.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public event EventHandler<GameStartedEventArgs> GameStarted

Expand image See Also

Tasks

Managing Player Movement Between Lobby and Gameplay Modes

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.HostChanged Event

NetworkSession.HostChanged Event

Occurs when the session host has changed.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public event EventHandler<HostChangedEventArgs> HostChanged

Expand image Remarks

HostChanged is only raised during host migration, and not when the session is first created.

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.InviteAccepted Event

NetworkSession.InviteAccepted Event

Event that occurs when a user has accepted an invitation to join a network session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public static event EventHandler<InviteAcceptedEventArgs> InviteAccepted

Expand image Remarks

In addition to being sent if a player responds to a game invitation, this event is also sent to a title when a gamer requests to join an in-progress session by selecting Join Session In Progress from the gamer's friends list on the LIVE Guide.

Important
If your title does not register for the InviteAccepted event, its sessions will always show up as non-joinable.

Notification of this event may be delivered at any time. However, if the game has been launched in response to a cross-title invite, it will arrive as soon as the game starts. In this case, the event will be delivered as soon as the managed client subscribes to it.

In response to this event, games should end any existing network session and call JoinInvited. There is no need to display any user interface before this. The system will already have prompted the user to confirm acceptance of the game invitation.

For more information, see Inviting Players to Join Your Game.

Expand image See Also

Reference

Guide.ShowGameInvite Method
NetworkSession.JoinInvited Method
NetworkSession.BeginJoinInvited Method
NetworkSession.EndJoinInvited Method
NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.SessionEnded Event

NetworkSession.SessionEnded Event

Occurs when the multiplayer session ends.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public event EventHandler<NetworkSessionEndedEventArgs> SessionEnded

Expand image See Also

Tasks

Managing Player Movement Between Lobby and Gameplay Modes

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.WriteArbitratedLeaderboard Event

NetworkSession.WriteArbitratedLeaderboard Event

TBD

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public event EventHandler<WriteLeaderboardsEventArgs> WriteArbitratedLeaderboard

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.WriteTrueSkill Event

NetworkSession.WriteTrueSkill Event

TBD

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public event EventHandler<WriteLeaderboardsEventArgs> WriteTrueSkill

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSession.WriteUnarbitratedLeaderboard Event

NetworkSession.WriteUnarbitratedLeaderboard Event

TBD

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public event EventHandler<WriteLeaderboardsEventArgs> WriteUnarbitratedLeaderboard

Expand image See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionEndedEventArgs Class

NetworkSessionEndedEventArgs Class
See Also Members
CollapseAll image

Represents the arguments passed to a SessionEnded event. These arguments are passed to event handlers when a session ends.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class NetworkSessionEndedEventArgs : EventArgs

Expand image See Also

Reference

NetworkSessionEndedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionEndedEventArgs Members

NetworkSessionEndedEventArgs Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the NetworkSessionEndedEventArgs type.

Expand image Public Constructors

 | Name | Description
Public Method | NetworkSessionEndedEventArgs | Creates an instance of NetworkSessionEndedEventArgs.

Expand image Public Properties

 | Name | Description
Public Property | EndReason | Gets the reason for ending a session.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkSessionEndedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


NetworkSessionEndedEventArgs Constructor

NetworkSessionEndedEventArgs Constructor

Creates an instance of NetworkSessionEndedEventArgs.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionEndedEventArgs (
         NetworkSessionEndReason endReason
)

Parameters

endReason
Reason for ending the session.

Expand image See Also

Reference

NetworkSessionEndedEventArgs Class
NetworkSessionEndedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionEndedEventArgs Methods

NetworkSessionEndedEventArgs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkSessionEndedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


NetworkSessionEndedEventArgs Properties

NetworkSessionEndedEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | EndReason | Gets the reason for ending a session.

Expand image See Also

Reference

NetworkSessionEndedEventArgs Class
Microsoft.Xna.Framework.Net Namespace


NetworkSessionEndedEventArgs.EndReason Property

NetworkSessionEndedEventArgs.EndReason Property

Gets the reason for ending a session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionEndReason EndReason { get; }

Property Value

Reason for ending the session.

Expand image See Also

Reference

NetworkSessionEndedEventArgs Class
NetworkSessionEndedEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionEndReason Enumeration

NetworkSessionEndReason Enumeration

Defines the reason a session ended.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public enum NetworkSessionEndReason

Expand image Members

Member name | Description
ClientSignedOut | This client player has signed out of session.
HostEndedSession | The host left the session, removing all active players.
RemovedByHost | The host removed this client player from the session.
Disconnected | Network connectivity problems ended the session

Expand image See Also

Reference

Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionJoinError Enumeration

NetworkSessionJoinError Enumeration

Contains additional data about a NetworkSessionJoinException.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public enum NetworkSessionJoinError

Expand image Members

Member name | Description
SessionNotFound | The session could not be found. Occurs if the session has ended after the matchmaking query but before the client joined, of if there is no network connectivity between the client and session host machines.
SessionNotJoinable | The session exists but is not joinable. Occurs if the session is in progress but does not allow gamers to join a session in progress.
SessionFull | The session exists but does not have any open slots for local signed-in gamers.

Expand image See Also

Reference

Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionJoinException Class

NetworkSessionJoinException Class
See Also Members
CollapseAll image

Thrown if an error was encountered while joining a session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class NetworkSessionJoinException : NetworkException

Expand image See Also

Reference

NetworkSessionJoinException Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionJoinException Members

NetworkSessionJoinException Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the NetworkSessionJoinException type.

Expand image Public Constructors

 | Name | Description
Public Method | NetworkSessionJoinException | Overloaded. Creates an instance of NetworkSessionJoinException.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | JoinError | Gets or sets a more detailed description of the session join failure.
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetObjectData | When overridden in a derived class, returns information about the exception.
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkSessionJoinException Class
Microsoft.Xna.Framework.Net Namespace


NetworkSessionJoinException Constructor

NetworkSessionJoinException Constructor

Creates an instance of NetworkSessionJoinException.

Expand image Overload List

Name | Description
NetworkSessionJoinException () | Creates an empty instance of NetworkSessionJoinException.
NetworkSessionJoinException (SerializationInfo, StreamingContext) | Creates an instance of NetworkSessionJoinException with the specified streaming context.
NetworkSessionJoinException (String) | Creates an instance of NetworkSessionJoinException with the specified error message.
NetworkSessionJoinException (String, Exception) | Creates an instance of NetworkSessionJoinException with the specified error message and inner exception.
NetworkSessionJoinException (String, NetworkSessionJoinError) | Creates an instance of NetworkSessionJoinException with the specified error and additional information on the exception.

Expand image See Also

Reference

NetworkSessionJoinException Class
NetworkSessionJoinException Members
Microsoft.Xna.Framework.Net Namespace


NetworkSessionJoinException Constructor ()

NetworkSessionJoinException Constructor ()
See Also
CollapseAll image

Creates an empty instance of NetworkSessionJoinException.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionJoinException ()

Expand image See Also

Reference

NetworkSessionJoinException Class
NetworkSessionJoinException Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionJoinException Constructor (SerializationInfo, StreamingContext)

NetworkSessionJoinException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Note
This constructor is available only when developing for Windows.
Creates an instance of NetworkSessionJoinException with the specified streaming context.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
protected NetworkSessionJoinException (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
Describes information related to the session being joined when the exception occurred.
context
Describes the stream where the exception occurred.

Expand image See Also

Reference

NetworkSessionJoinException Class
NetworkSessionJoinException Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


NetworkSessionJoinException Constructor (String)

NetworkSessionJoinException Constructor (String)
See Also
CollapseAll image

Creates an instance of NetworkSessionJoinException with the specified error message.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionJoinException (
         string message
)

Parameters

message
A message that describes the error.

Expand image See Also

Reference

NetworkSessionJoinException Class
NetworkSessionJoinException Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionJoinException Constructor (String, Exception)

NetworkSessionJoinException Constructor (String, Exception)
See Also
CollapseAll image

Creates an instance of NetworkSessionJoinException with the specified error message and inner exception.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionJoinException (
         string message,
         Exception innerException
)

Parameters

message
A message that describes the error.
innerException
The inner exception related to this exception.

Expand image See Also

Reference

NetworkSessionJoinException Class
NetworkSessionJoinException Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionJoinException Constructor (String, NetworkSessionJoinError)

NetworkSessionJoinException Constructor (String, NetworkSessionJoinError)
See Also
CollapseAll image

Creates an instance of NetworkSessionJoinException with the specified error and additional information on the exception.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionJoinException (
         string message,
         NetworkSessionJoinError joinError
)

Parameters

message
A message that describes the error.
joinError
Reason for the exception.

Expand image See Also

Reference

NetworkSessionJoinException Class
NetworkSessionJoinException Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionJoinException Methods

NetworkSessionJoinException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetObjectData | When overridden in a derived class, returns information about the exception.
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NetworkSessionJoinException Class
Microsoft.Xna.Framework.Net Namespace


NetworkSessionJoinException.GetObjectData Method

NetworkSessionJoinException.GetObjectData Method

Note
This method is available only when developing for Windows.

When overridden in a derived class, returns information about the exception. In addition to the base behavior, this method provides serialization functionality.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public override void GetObjectData (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
Information necessary for serialization and deserialization of the session item.
context
Information necessary for the source and destination of a given serialized stream. Also provides an additional caller-defined context.

Expand image See Also

Reference

NetworkSessionJoinException Class
NetworkSessionJoinException Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


NetworkSessionJoinException Properties

NetworkSessionJoinException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | JoinError | Gets or sets a more detailed description of the session join failure.
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

NetworkSessionJoinException Class
Microsoft.Xna.Framework.Net Namespace


NetworkSessionJoinException.JoinError Property

NetworkSessionJoinException.JoinError Property

Gets or sets a more detailed description of the session join failure.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionJoinError JoinError { get; set; }

Property Value

Contains information about the session join failure.

Expand image See Also

Reference

NetworkSessionJoinException Class
NetworkSessionJoinException Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionProperties Class

NetworkSessionProperties Class
See Also Members
CollapseAll image

Describes custom, game-specific information about a NetworkSession object.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class NetworkSessionProperties : IList<Nullable<int>>, ICollection<Nullable<int>>, IEnumerable<Nullable<int>>, IEnumerable

Expand image Remarks

Examples of custom properties include specifying the current game mode or the current level selection. Use these properties to filter the results from a search using the Find or BeginFind methods.

Expand image See Also

Tasks

Finding and Joining a Network Session

Reference

NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionProperties Members

NetworkSessionProperties Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the NetworkSessionProperties type.

Expand image Public Constructors

 | Name | Description
Public Method | NetworkSessionProperties | Creates an empty instance of NetworkSessionProperties.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of custom session properties.
Public Property | Item | Gets or sets a custom session property value at the specified index

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator for iterating over the custom property values.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.IsReadOnly | Gets a value indicating whether the collection is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Add | The System.Collections.Generic.ICollection{T}.Add interface method is not supported by NetworkSessionProperties.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Clear | The System.Collections.Generic.ICollection{T}.Clear interface method is not supported by NetworkSessionProperties.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Contains | Checks whether the collection contains the specified value.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.CopyTo | Copies the contents of the collection to an array.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator for iterating over the custom property values.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.IndexOf | Gets the index of the specified value.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.Insert | The System.Collections.Generic.IList{T}.Insert interface method is not supported by NetworkSessionProperties.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.RemoveAt | The System.Collections.Generic.IList{T}.RemoveAt interface method is not supported by NetworkSessionProperties.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Remove | The System.Collections.Generic.ICollection{T}.Remove interface method is not supported by NetworkSessionProperties.

Expand image See Also

Tasks

Finding and Joining a Network Session

Reference

NetworkSessionProperties Class
Microsoft.Xna.Framework.Net Namespace


NetworkSessionProperties Constructor

NetworkSessionProperties Constructor

Creates an empty instance of NetworkSessionProperties.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkSessionProperties ()

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionProperties Methods

NetworkSessionProperties Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator for iterating over the custom property values.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.IsReadOnly | Gets a value indicating whether the collection is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Add | The System.Collections.Generic.ICollection{T}.Add interface method is not supported by NetworkSessionProperties.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Clear | The System.Collections.Generic.ICollection{T}.Clear interface method is not supported by NetworkSessionProperties.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Contains | Checks whether the collection contains the specified value.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.CopyTo | Copies the contents of the collection to an array.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator for iterating over the custom property values.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.IndexOf | Gets the index of the specified value.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.Insert | The System.Collections.Generic.IList{T}.Insert interface method is not supported by NetworkSessionProperties.
Explicit Interface Implementation | System.Collections.Generic.IList{T}.RemoveAt | The System.Collections.Generic.IList{T}.RemoveAt interface method is not supported by NetworkSessionProperties.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Remove | The System.Collections.Generic.ICollection{T}.Remove interface method is not supported by NetworkSessionProperties.

Expand image See Also

Reference

NetworkSessionProperties Class
Microsoft.Xna.Framework.Net Namespace


NetworkSessionProperties.GetEnumerator Method

NetworkSessionProperties.GetEnumerator Method

Gets an enumerator for iterating over the custom property values.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public IEnumerator<Nullable<int>> GetEnumerator ()

Return Value

An enumerator for iterating over the custom property values.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


System.Collections.Generic.ICollection{T}.Add Method

System.Collections.Generic.ICollection{T}.Add Method

The System.Collections.Generic.ICollection{T}.Add interface method is not supported by NetworkSessionProperties.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.Add (
         Nullable<int> item
)

Parameters

item
The value to add.

Expand image Exceptions

Exception type | Condition
NotSupportedException | This interface method is not supported by the NetworkSessionProperties type.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


System.Collections.Generic.ICollection{T}.Clear Method

System.Collections.Generic.ICollection{T}.Clear Method

The System.Collections.Generic.ICollection{T}.Clear interface method is not supported by NetworkSessionProperties.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.Clear ()

Expand image Exceptions

Exception type | Condition
NotSupportedException | This interface method is not supported by the NetworkSessionProperties type.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


System.Collections.Generic.ICollection{T}.Contains Method

System.Collections.Generic.ICollection{T}.Contains Method

Checks whether the collection contains the specified value.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.Contains (
         Nullable<int> item
)

Parameters

item
The value to search for.

Return Value

true if the collection contains the specified value; false otherwise.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


System.Collections.Generic.ICollection{T}.CopyTo Method

System.Collections.Generic.ICollection{T}.CopyTo Method

Copies the contents of the collection to an array.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.CopyTo (
         Nullable<int>[] array,
         int arrayIndex
)

Parameters

array
The array to receive the contents of the collection.
arrayIndex
Starting index for the copy operation.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


System.Collections.Generic.ICollection{T}.Remove Method

System.Collections.Generic.ICollection{T}.Remove Method

The System.Collections.Generic.ICollection{T}.Remove interface method is not supported by NetworkSessionProperties.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.Remove (
         Nullable<int> item
)

Parameters

item
The item to remove.

Return Value

true if the item was removed successfully; false otherwise.

Expand image Exceptions

Exception type | Condition
NotSupportedException | This interface method is not supported by the NetworkSessionProperties type.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


System.Collections.Generic.IList{T}.IndexOf Method

System.Collections.Generic.IList{T}.IndexOf Method

Gets the index of the specified value.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
private int System.Collections.Generic.IList{T}.IndexOf (
         Nullable<int> item
)

Parameters

item
The value to search for.

Return Value

The index of the specified value.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


System.Collections.Generic.IList{T}.Insert Method

System.Collections.Generic.IList{T}.Insert Method

The System.Collections.Generic.IList{T}.Insert interface method is not supported by NetworkSessionProperties.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
private void System.Collections.Generic.IList{T}.Insert (
         int index,
         Nullable<int> item
)

Parameters

index
Index for the insertion operation
item
Item to insert.

Expand image Exceptions

Exception type | Condition
NotSupportedException | This interface method is not supported by the NetworkSessionProperties type.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


System.Collections.Generic.IList{T}.RemoveAt Method

System.Collections.Generic.IList{T}.RemoveAt Method

The System.Collections.Generic.IList{T}.RemoveAt interface method is not supported by NetworkSessionProperties.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
private void System.Collections.Generic.IList{T}.RemoveAt (
         int index
)

Parameters

index
Index of the item to remove.

Expand image Exceptions

Exception type | Condition
NotSupportedException | This interface method is not supported by the NetworkSessionProperties type.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Gets an enumerator for iterating over the custom property values.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

An enumerator for iterating over the custom property values.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionProperties Properties

NetworkSessionProperties Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of custom session properties.
Public Property | Item | Gets or sets a custom session property value at the specified index

Expand image See Also

Reference

NetworkSessionProperties Class
Microsoft.Xna.Framework.Net Namespace


NetworkSessionProperties.Count Property

NetworkSessionProperties.Count Property

Gets the number of custom session properties.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

The number of custom session properties.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionProperties.Item Property

NetworkSessionProperties.Item Property

Gets or sets a custom session property value at the specified index

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public Nullable<int> this [
         int index
] { get; set; }

Property Value

The custom session property value.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | index was out of range.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionProperties.System.Collections.Generic.ICollection{T}.IsReadOnly Property

NetworkSessionProperties.System.Collections.Generic.ICollection{T}.IsReadOnly Property
See Also
CollapseAll image

Gets a value indicating whether the collection is read-only.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.IsReadOnly { get; }

Property Value

true if the collection is read-only; false otherwise.

Expand image See Also

Reference

NetworkSessionProperties Class
NetworkSessionProperties Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionState Enumeration

NetworkSessionState Enumeration

Defines the different states of a multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public enum NetworkSessionState

Expand image Members

Member name | Description
Lobby | The local machine joins the session, waiting in the pregame lobby. The GameStarted event is raised when gameplay begins.
Playing | The local machine joins the session, currently in the middle of gameplay. The GameEnded event is raised when the session returns to the lobby.
Ended | The local machine has left the current session or the session has ended. The SessionEnded event is raised at this time. The event's arguments describe the reason for the session ending.

Expand image See Also

Reference

Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


NetworkSessionType Enumeration

NetworkSessionType Enumeration

Defines the different types of a multiplayer session.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public enum NetworkSessionType

Expand image Members

Member name | Description
Local | Does not involve any networking traffic, but can be used for split-screen gaming on a single Xbox 360 console. Creating a local network session may also make it easier to share code between local and online game modes.
LocalWithLeaderboards | Creates a local session with access to write to leaderboards on the Xbox LIVE servers. This local session type allows guests or other Xbox LIVE player profiles to join the session.
SystemLink

Connect multiple Xbox 360 consoles or computers over a local subnet. These machines do not require a connection to Xbox LIVE or any Xbox LIVE accounts. However, connection to machines on different subnets is not allowed.

If you are a Creators Club developer testing your game, you can use this type to connect an Xbox 360 console to a computer. However, cross-platform networking is not supported in games distributed to non–Creators Club community players.

PlayerMatch | Uses the Xbox LIVE servers. This enables connection to other machines over the Internet. It requires a Xbox LIVE Silver Membership for Windows-based games or a Xbox LIVE Gold membership for Xbox 360 games. Games in development will also require an XNA Creators Club premium membership. While in trial mode, Indie games downloaded from Xbox LIVE Markeplace will not have access to Xbox LIVE matchmaking.
Ranked | All session matches are ranked. This option is available only for commercial games that have passed Xbox LIVE certification. Due to the competitive nature of the gameplay, this session type does not support join-in-progress.

Expand image See Also

Tasks

Joining an In-Progress Game

Reference

Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader Class

PacketReader Class
See Also Members
CollapseAll image

Provides common functionality for efficiently reading incoming network packets.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class PacketReader : BinaryReader

Expand image Remarks

Commonly, your multiplayer game should create a single PacketReader instance at startup and then reuse it whenever a packet needs to be read. To read the packet, pass the PacketReader instance to ReceiveData and then use various Read methods to extract the data.

Expand image See Also

Tasks

Receiving Network Data

Reference

PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader Members

PacketReader Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the PacketReader type.

Expand image Public Constructors

 | Name | Description
Public Method | PacketReader | Overloaded. Initializes a new instance of PacketReader.

Expand image Public Properties

 | Name | Description
Public Property | BaseStream | (Inherited from BinaryReader.)
Public Property | Length | Gets the length of the packet being read.
Public Property | Position | Gets or sets the current packet read position.

Expand image Public Methods

 | Name | Description
Public Method | Close | (Inherited from BinaryReader.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | PeekChar | (Inherited from BinaryReader.)
Public Method | Read | (Overloaded. Inherited from BinaryReader.)
Public Method | ReadBoolean | (Inherited from BinaryReader.)
Public Method | ReadByte | (Inherited from BinaryReader.)
Public Method | ReadBytes | (Inherited from BinaryReader.)
Public Method | ReadChar | (Inherited from BinaryReader.)
Public Method | ReadChars | (Inherited from BinaryReader.)
Public Method | ReadColor | Reads a Color value.
Public Method | ReadDouble | Reads an 8-byte floating point value.
Public Method | ReadInt16 | (Inherited from BinaryReader.)
Public Method | ReadInt32 | (Inherited from BinaryReader.)
Public Method | ReadInt64 | (Inherited from BinaryReader.)
Public Method | ReadMatrix | Reads a Matrix value.
Public Method | ReadQuaternion | Reads a Quaternion value.
Public Method | ReadSByte | (Inherited from BinaryReader.)
Public Method | ReadSingle | Reads a 4-byte floating point value.
Public Method | ReadString | (Inherited from BinaryReader.)
Public Method | ReadUInt16 | (Inherited from BinaryReader.)
Public Method | ReadUInt32 | (Inherited from BinaryReader.)
Public Method | ReadUInt64 | (Inherited from BinaryReader.)
Public Method | ReadVector2 | Reads a Vector2 value.
Public Method | ReadVector3 | Reads a Vector3 value.
Public Method | ReadVector4 | Reads a Vector3 value.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from BinaryReader.)
Protected Method | FillBuffer | (Inherited from BinaryReader.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Tasks

Receiving Network Data

Reference

PacketReader Class
Microsoft.Xna.Framework.Net Namespace


PacketReader Constructor

PacketReader Constructor

Initializes a new instance of PacketReader.

Expand image Overload List

Name | Description
PacketReader () | Initializes an empty instance of PacketReader.
PacketReader (Int32) | Initializes an empty instance of PacketReader with the specified options.

Expand image See Also

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace


PacketReader Constructor ()

PacketReader Constructor ()
See Also
CollapseAll image

Initializes an empty instance of PacketReader.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public PacketReader ()

Expand image See Also

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader Constructor (Int32)

PacketReader Constructor (Int32)
See Also
CollapseAll image

Initializes an empty instance of PacketReader with the specified options.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public PacketReader (
         int capacity
)

Parameters

capacity
Initial capacity for a received network packet.

Expand image See Also

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader Methods

PacketReader Methods

Expand image Public Methods

 | Name | Description
Public Method | Close | (Inherited from BinaryReader.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | PeekChar | (Inherited from BinaryReader.)
Public Method | Read | (Overloaded. Inherited from BinaryReader.)
Public Method | ReadBoolean | (Inherited from BinaryReader.)
Public Method | ReadByte | (Inherited from BinaryReader.)
Public Method | ReadBytes | (Inherited from BinaryReader.)
Public Method | ReadChar | (Inherited from BinaryReader.)
Public Method | ReadChars | (Inherited from BinaryReader.)
Public Method | ReadColor | Reads a Color value.
Public Method | ReadDouble | Reads an 8-byte floating point value.
Public Method | ReadInt16 | (Inherited from BinaryReader.)
Public Method | ReadInt32 | (Inherited from BinaryReader.)
Public Method | ReadInt64 | (Inherited from BinaryReader.)
Public Method | ReadMatrix | Reads a Matrix value.
Public Method | ReadQuaternion | Reads a Quaternion value.
Public Method | ReadSByte | (Inherited from BinaryReader.)
Public Method | ReadSingle | Reads a 4-byte floating point value.
Public Method | ReadString | (Inherited from BinaryReader.)
Public Method | ReadUInt16 | (Inherited from BinaryReader.)
Public Method | ReadUInt32 | (Inherited from BinaryReader.)
Public Method | ReadUInt64 | (Inherited from BinaryReader.)
Public Method | ReadVector2 | Reads a Vector2 value.
Public Method | ReadVector3 | Reads a Vector3 value.
Public Method | ReadVector4 | Reads a Vector3 value.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from BinaryReader.)
Protected Method | FillBuffer | (Inherited from BinaryReader.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PacketReader Class
Microsoft.Xna.Framework.Net Namespace


PacketReader.ReadColor Method

PacketReader.ReadColor Method

Reads a Color value.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public Color ReadColor ()

Return Value

Color data received from the network packet.

Expand image See Also

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader.ReadDouble Method

PacketReader.ReadDouble Method

Reads an 8-byte floating point value.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public override double ReadDouble ()

Return Value

8-byte floating point value from the received network packet.

Expand image See Also

Tasks

Receiving Network Data

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader.ReadMatrix Method

PacketReader.ReadMatrix Method

Reads a Matrix value.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public Matrix ReadMatrix ()

Return Value

Matrix data from the received network packet.

Expand image See Also

Tasks

Receiving Network Data

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader.ReadQuaternion Method

PacketReader.ReadQuaternion Method

Reads a Quaternion value.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public Quaternion ReadQuaternion ()

Return Value

Quaternion data from the received network packet.

Expand image See Also

Tasks

Receiving Network Data

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader.ReadSingle Method

PacketReader.ReadSingle Method

Reads a 4-byte floating point value.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public override float ReadSingle ()

Return Value

Reads a 4-byte floating point value from the received network packet.

Expand image See Also

Tasks

Receiving Network Data

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader.ReadVector2 Method

PacketReader.ReadVector2 Method

Reads a Vector2 value.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public Vector2 ReadVector2 ()

Return Value

Vector data from the received network packet.

Expand image See Also

Tasks

Receiving Network Data

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader.ReadVector3 Method

PacketReader.ReadVector3 Method

Reads a Vector3 value.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public Vector3 ReadVector3 ()

Return Value

Vector data from the received network packet.

Expand image See Also

Tasks

Receiving Network Data

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader.ReadVector4 Method

PacketReader.ReadVector4 Method

Reads a Vector3 value.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public Vector4 ReadVector4 ()

Return Value

Vector data from the received network packet.

Expand image See Also

Tasks

Receiving Network Data

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader Properties

PacketReader Properties

Expand image Public Properties

 | Name | Description
Public Property | BaseStream | (Inherited from BinaryReader.)
Public Property | Length | Gets the length of the packet being read.
Public Property | Position | Gets or sets the current packet read position.

Expand image See Also

Reference

PacketReader Class
Microsoft.Xna.Framework.Net Namespace


PacketReader.Length Property

PacketReader.Length Property

Gets the length of the packet being read.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int Length { get; }

Property Value

Length of the packet.

Expand image See Also

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketReader.Position Property

PacketReader.Position Property

Gets or sets the current packet read position.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int Position { get; set; }

Property Value

Current position of the packet.

Expand image See Also

Reference

PacketReader Class
PacketReader Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter Class

PacketWriter Class
See Also Members
CollapseAll image

Provides common functionality for efficiently formatting outgoing network packets.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public class PacketWriter : BinaryWriter

Expand image See Also

Tasks

Sending Network Data

Reference

PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter Members

PacketWriter Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the PacketWriter type.

Expand image Public Constructors

 | Name | Description
Public Method | PacketWriter | Overloaded. Initializes a new instance of PacketWriter.

Expand image Protected Fields

 | Name | Description
Protected Field | OutStream | (Inherited from BinaryWriter.)

Expand image Public Properties

 | Name | Description
Public Property | BaseStream | (Inherited from BinaryWriter.)
Public Property | Length | Gets the length of the packet being written.
Public Property | Position | Gets or sets the current packet write position.

Expand image Public Methods

 | Name | Description
Public Method | Close | (Inherited from BinaryWriter.)
Public Method | Equals | (Inherited from Object.)
Public Method | Flush | (Inherited from BinaryWriter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Seek | (Inherited from BinaryWriter.)
Public Method | ToString | (Inherited from Object.)
Public Method | Write | Overloaded. Writes a value to an outgoing network packet.

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from BinaryWriter.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | Write7BitEncodedInt | (Inherited from BinaryWriter.)

Expand image See Also

Tasks

Sending Network Data

Reference

PacketWriter Class
Microsoft.Xna.Framework.Net Namespace


PacketWriter Fields

PacketWriter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | OutStream | (Inherited from BinaryWriter.)

Expand image See Also

Reference

PacketWriter Class
Microsoft.Xna.Framework.Net Namespace


PacketWriter Constructor

PacketWriter Constructor

Initializes a new instance of PacketWriter.

Expand image Overload List

Name | Description
PacketWriter () | Initializes an empty instance of PacketWriter.
PacketWriter (Int32) | Initializes a new instance of PacketWriter with the specified capacity.

Expand image See Also

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace


PacketWriter Constructor ()

PacketWriter Constructor ()
See Also
CollapseAll image

Initializes an empty instance of PacketWriter.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public PacketWriter ()

Expand image See Also

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter Constructor (Int32)

PacketWriter Constructor (Int32)
See Also
CollapseAll image

Initializes a new instance of PacketWriter with the specified capacity.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public PacketWriter (
         int capacity
)

Parameters

capacity
Capacity for the packet writer.

Expand image See Also

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter Methods

PacketWriter Methods

Expand image Public Methods

 | Name | Description
Public Method | Close | (Inherited from BinaryWriter.)
Public Method | Equals | (Inherited from Object.)
Public Method | Flush | (Inherited from BinaryWriter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Seek | (Inherited from BinaryWriter.)
Public Method | ToString | (Inherited from Object.)
Public Method | Write | Overloaded. Writes a value to an outgoing network packet.

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | (Inherited from BinaryWriter.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | Write7BitEncodedInt | (Inherited from BinaryWriter.)

Expand image See Also

Reference

PacketWriter Class
Microsoft.Xna.Framework.Net Namespace


PacketWriter.Write Method

PacketWriter.Write Method

Writes a value to an outgoing network packet.

Expand image Overload List

Name | Description
PacketWriter.Write (Color) | Writes a Color value to an outgoing network packet.
PacketWriter.Write (Double) | Writes a Double value to an outgoing network packet.
PacketWriter.Write (Matrix) | Writes a Matrix value to an outgoing network packet.
PacketWriter.Write (Quaternion) | Writes a Quaternion value to an outgoing network packet.
PacketWriter.Write (Single) | Writes a Single value to an outgoing network packet.
PacketWriter.Write (Vector2) | Writes a Vector2 value to an outgoing network packet.
PacketWriter.Write (Vector3) | Writes a Vector3 value to an outgoing network packet.
PacketWriter.Write (Vector4) | Writes a Vector4 value to an outgoing network packet.

Expand image See Also

Tasks

Sending Network Data

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace


PacketWriter.Write Method (Color)

PacketWriter.Write Method (Color)
See Also
CollapseAll image

Writes a Color value to an outgoing network packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void Write (
         Color value
)

Parameters

value
Value to be written.

Expand image See Also

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter.Write Method (Double)

PacketWriter.Write Method (Double)
See Also
CollapseAll image

Writes a Double value to an outgoing network packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public override void Write (
         double value
)

Parameters

value
Value to be written.

Expand image See Also

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter.Write Method (Matrix)

PacketWriter.Write Method (Matrix)
See Also
CollapseAll image

Writes a Matrix value to an outgoing network packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void Write (
         Matrix value
)

Parameters

value
Value being written.

Expand image See Also

Tasks

Sending Network Data

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter.Write Method (Quaternion)

PacketWriter.Write Method (Quaternion)
See Also
CollapseAll image

Writes a Quaternion value to an outgoing network packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void Write (
         Quaternion value
)

Parameters

value
Value being written.

Expand image See Also

Tasks

Sending Network Data

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter.Write Method (Single)

PacketWriter.Write Method (Single)
See Also
CollapseAll image

Writes a Single value to an outgoing network packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public override void Write (
         float value
)

Parameters

value
Value to be written.

Expand image See Also

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter.Write Method (Vector2)

PacketWriter.Write Method (Vector2)
See Also
CollapseAll image

Writes a Vector2 value to an outgoing network packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void Write (
         Vector2 value
)

Parameters

value
Value being written.

Expand image See Also

Tasks

Sending Network Data

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter.Write Method (Vector3)

PacketWriter.Write Method (Vector3)
See Also
CollapseAll image

Writes a Vector3 value to an outgoing network packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void Write (
         Vector3 value
)

Parameters

value
Value being written.

Expand image See Also

Tasks

Sending Network Data

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter.Write Method (Vector4)

PacketWriter.Write Method (Vector4)
See Also
CollapseAll image

Writes a Vector4 value to an outgoing network packet.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public void Write (
         Vector4 value
)

Parameters

value
Value being written.

Expand image See Also

Tasks

Sending Network Data

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter Properties

PacketWriter Properties

Expand image Public Properties

 | Name | Description
Public Property | BaseStream | (Inherited from BinaryWriter.)
Public Property | Length | Gets the length of the packet being written.
Public Property | Position | Gets or sets the current packet write position.

Expand image See Also

Reference

PacketWriter Class
Microsoft.Xna.Framework.Net Namespace


PacketWriter.Length Property

PacketWriter.Length Property

Gets the length of the packet being written.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int Length { get; }

Property Value

Length of the packet.

Expand image See Also

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


PacketWriter.Position Property

PacketWriter.Position Property

Gets or sets the current packet write position.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int Position { get; set; }

Property Value

Current position of the packet.

Expand image See Also

Reference

PacketWriter Class
PacketWriter Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


QualityOfService Class

QualityOfService Class
See Also Members
CollapseAll image

Describes the quality of the network connection between this machine and the host of a multiplayer session that was discovered with a matchmaking query.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public sealed class QualityOfService

Expand image See Also

Reference

QualityOfService Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


QualityOfService Members

QualityOfService Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the QualityOfService type.

Expand image Public Properties

 | Name | Description
Public Property | AverageRoundtripTime | Gets the average (median) round trip time of all the network packets that were sent during the quality of service measurement process.
Public Property | BytesPerSecondDownstream | Gets an estimate of the available downstream network bandwidth from the session host to this machine, measured in bytes per second.
Public Property | BytesPerSecondUpstream | Gets an estimate of the available upstream network bandwidth from this machine to the session host, measured in bytes per second.
Public Property | IsAvailable | Checks whether this quality of service operation has completed.
Public Property | MinimumRoundtripTime | Gets the minimum round trip time of any network packet that was sent during the quality of service measurement process.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

QualityOfService Class
Microsoft.Xna.Framework.Net Namespace


QualityOfService Methods

QualityOfService Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

QualityOfService Class
Microsoft.Xna.Framework.Net Namespace


QualityOfService Properties

QualityOfService Properties

Expand image Public Properties

 | Name | Description
Public Property | AverageRoundtripTime | Gets the average (median) round trip time of all the network packets that were sent during the quality of service measurement process.
Public Property | BytesPerSecondDownstream | Gets an estimate of the available downstream network bandwidth from the session host to this machine, measured in bytes per second.
Public Property | BytesPerSecondUpstream | Gets an estimate of the available upstream network bandwidth from this machine to the session host, measured in bytes per second.
Public Property | IsAvailable | Checks whether this quality of service operation has completed.
Public Property | MinimumRoundtripTime | Gets the minimum round trip time of any network packet that was sent during the quality of service measurement process.

Expand image See Also

Reference

QualityOfService Class
Microsoft.Xna.Framework.Net Namespace


QualityOfService.AverageRoundtripTime Property

QualityOfService.AverageRoundtripTime Property

Gets the average (median) round trip time of all the network packets that were sent during the quality of service measurement process.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public TimeSpan AverageRoundtripTime { get; }

Property Value

The average (median) round trip time of all the network packets that were sent during the quality of service measurement process. Will return zero if the query has not yet completed. You can check if the query is complete using IsAvailable.

Expand image See Also

Reference

QualityOfService Class
QualityOfService Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


QualityOfService.BytesPerSecondDownstream Property

QualityOfService.BytesPerSecondDownstream Property

Gets an estimate of the available downstream network bandwidth from the session host to this machine, measured in bytes per second.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int BytesPerSecondDownstream { get; }

Property Value

An estimate of the available downstream network bandwidth from the session host to this machine, measured in bytes per second. Will return zero if the query has not yet completed. You can check if the query is complete using IsAvailable.

Expand image Remarks

The bandwidth algorithm used for BytesPerSecondUpstream and BytesPerSecondDownstream gives only an estimate of bandwidth and there is a possibility it may not accurately reflect the true bandwidth provided by the player's internet service provider. To avoid inaccurately representing the true bandwidth to the player, games should avoid displaying BytesPerSecondUpstream and BytesPerSecondDownstream.

Even though the results of these properties provide only rough estimates, the values can be useful for relative comparisons or host stack ranking. For instance, these properties might be used for choosing a host gaming machine with a bandwidth twice as large as another gaming machine or sorting a list based on bandwidth.

Expand image See Also

Reference

QualityOfService Class
QualityOfService Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


QualityOfService.BytesPerSecondUpstream Property

QualityOfService.BytesPerSecondUpstream Property

Gets an estimate of the available upstream network bandwidth from this machine to the session host, measured in bytes per second.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public int BytesPerSecondUpstream { get; }

Property Value

An estimate of the available upstream network bandwidth from this machine to the session host, measured in bytes per second. Will return zero if the query has not yet completed. You can check if the query is complete using IsAvailable.

Expand image Remarks

The bandwidth algorithm used for BytesPerSecondUpstream and BytesPerSecondDownstream gives only an estimate of bandwidth and there is a possibility it may not accurately reflect the true bandwidth provided by the player's internet service provider. To avoid inaccurately representing the true bandwidth to the player, games should avoid displaying BytesPerSecondUpstream and BytesPerSecondDownstream.

Even though the results of these properties provide only rough estimates, the values can be useful for relative comparisons or host stack ranking. For instance, these properties might be used for choosing a host gaming machine with a bandwidth twice as large as another gaming machine or sorting a list based on bandwidth.

Expand image See Also

Reference

QualityOfService Class
QualityOfService Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


QualityOfService.IsAvailable Property

QualityOfService.IsAvailable Property

Checks whether this quality of service operation has completed.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsAvailable { get; }

Property Value

true if quality of service data is available; false otherwise.

Expand image Remarks

Matchmaking search results are returned before the quality of service probing has finished, so as to avoid an excessive delay before you can display the list of sessions to the user, but the quality of service checks continue in the background even after the search results are available. Initially the IsAvailable property will be set to false, and all the other properties will be zero, but after the probing finishes this will become true and the other properties will be filled in with some actual data.

Expand image See Also

Reference

QualityOfService Class
QualityOfService Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


QualityOfService.MinimumRoundtripTime Property

QualityOfService.MinimumRoundtripTime Property

Gets the minimum round trip time of any network packet that was sent during the quality of service measurement process.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public TimeSpan MinimumRoundtripTime { get; }

Property Value

The minimum round trip time of any network packet that was sent during the quality of service measurement process. Will return zero if the query has not yet completed. You can check if the query is complete using IsAvailable.

Expand image See Also

Reference

QualityOfService Class
QualityOfService Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


SendDataOptions Enumeration

SendDataOptions Enumeration

Defines options for network packet transmission.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
[FlagsAttribute]
public enum SendDataOptions

Expand image Members

Member name Description
None

Sends the data with no guarantees.

Packets of this type may be delivered in any order, with occasional packet loss.

This is the most efficient option in terms of network bandwidth and machine resource usage. However, it is recommended only in situations where your game can recover from occasional packet loss.

Reliable

Sends the data with reliable delivery, but no special ordering.

Packets of this type are resent until arrival at the destination. They may arrive out of order.

InOrder

Sends the data with guaranteed ordering, but without reliable delivery.

Occasionally, packets of this type are not delivered. However, any delivered packets always arrive in the order in which they are sent.

Use this option in situations where the transmitted value changes constantly. Old versions never arrive after a more recent version.

ReliableInOrder

Sends the data with reliability and arrival in the order originally sent.

Packets of this type are resent until arrival and ordered internally. This means they arrive in the same order in which they were sent.

In terms of network bandwidth usage, this is the strongest and most expensive option. Use this only when arrival and ordering are essential. Commonly, a game uses this option for a small percentage of packets. The majority of gameplay data is sent using None or Reliable.

Chat

Mark that this packet contains chat data, such as a player-to-player message string entered using the keyboard. To comply with international regulations, you must send such data without packet encryption. Therefore, you must use this flag to mark it. To maintain security, other game data should not use this flag. It is acceptable and efficient to mix encrypted and unencrypted data.

If you send packets both with and without this flag within a single frame, both the encrypyted and unencrypted data streams will be merged into a single wire packet. This option can be combined with either or both of the Reliable and InOrder flags. When you request in-order delivery for chat packets, they will be ordered relative to other chat packets, but they may arrive out of order with respect to other non-chat data.

Expand image See Also

Reference

Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WriteLeaderboardsEventArgs Class

WriteLeaderboardsEventArgs Class
See Also Members
CollapseAll image

Represents the arguments passed to a WriteArbitratedLeaderboard. WriteUnarbitratedLeaderboard, or WriteTrueSkill event.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public sealed class WriteLeaderboardsEventArgs : EventArgs

Expand image See Also

Reference

WriteLeaderboardsEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WriteLeaderboardsEventArgs Members

WriteLeaderboardsEventArgs Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the WriteLeaderboardsEventArgs type.

Expand image Public Properties

 | Name | Description
Public Property | Gamer | Gets the gamer whose statistics need to be written to the leaderboard.
Public Property | IsLeaving | Indicates whether or not the player is leaving the session early.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

WriteLeaderboardsEventArgs Class
Microsoft.Xna.Framework.Net Namespace


WriteLeaderboardsEventArgs Properties

WriteLeaderboardsEventArgs Properties

Expand image Public Properties

 | Name | Description
Public Property | Gamer | Gets the gamer whose statistics need to be written to the leaderboard.
Public Property | IsLeaving | Indicates whether or not the player is leaving the session early.

Expand image See Also

Reference

WriteLeaderboardsEventArgs Class
Microsoft.Xna.Framework.Net Namespace


WriteLeaderboardsEventArgs.Gamer Property

WriteLeaderboardsEventArgs.Gamer Property

Gets the gamer whose statistics need to be written to the leaderboard.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public NetworkGamer Gamer { get; }

Property Value

The gamer whose statistics should be written.

Expand image See Also

Reference

WriteLeaderboardsEventArgs Class
WriteLeaderboardsEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


WriteLeaderboardsEventArgs.IsLeaving Property

WriteLeaderboardsEventArgs.IsLeaving Property

Indicates whether or not the player is leaving the session early.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Expand image Syntax

C#
public bool IsLeaving { get; }

Property Value

When true, the player is leaving the session early.

Expand image See Also

Reference

WriteLeaderboardsEventArgs Class
WriteLeaderboardsEventArgs Members
Microsoft.Xna.Framework.Net Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


Microsoft.Xna.Framework.Storage Namespace

Microsoft.Xna.Framework.Storage Namespace

Contains classes that allow reading and writing of files.

Expand image Classes

 | Name | Description
Public Class | StorageContainer | Represents a logical collection of storage files.
Public Class | StorageDevice | Represents a storage device for user data, such as a memory unit or hard drive.
Public Class | StorageDeviceNotConnectedException | The exception that is thrown when the requested StorageDevice is not connected.

Expand image See Also

Tasks

Creating a File
Opening a File for Reading/Writing
Copying a File
Renaming a File
Enumerating Save Game Files
Deleting a Save Game File
Reading Game Data from Title Storage
Saving Data to a Save Game File
Getting a StorageDevice Asynchronously

Concepts

What Is Storage?


StorageContainer Class

StorageContainer Class
See Also Members
CollapseAll image

Represents a logical collection of storage files.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public class StorageContainer : IDisposable

Expand image See Also

Concepts

What Is Storage?

Reference

StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer Members

StorageContainer Members
See Also Events Methods Properties
CollapseAll image

The following tables list the members exposed by the StorageContainer type.

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | Gets the name of the title.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | StorageDevice | Gets the StorageDevice that holds the files in this container.

Expand image Public Methods

 | Name | Description
Public Method | CreateDirectory | Creates a new directory in the StorageContainer scope.
Public Method | CreateFile | Creates a file at a specified path in the StorageContainer.
Public Method | DeleteDirectory | Deletes a directory in the StorageContainer scope.
Public Method | DeleteFile | Deletes a file in the StorageContainer.
Public Method | DirectoryExists | Determines whether the specified path refers to an existing directory in the StorageContainer.
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | FileExists | Determines whether the specified path refers to an existing file in the StorageContainer.
Public Method | GetDirectoryNames | Overloaded. Enumerates the directories in the root of a StorageContainer.
Public Method | GetFileNames | Overloaded. Enumerates files in a StorageContainer.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | OpenFile | Overloaded. Opens a file at a specified path in the StorageContainer.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime.

Expand image See Also

Concepts

What Is Storage?

Reference

StorageContainer Class
Microsoft.Xna.Framework.Storage Namespace


StorageContainer Methods

StorageContainer Methods

Expand image Public Methods

 | Name | Description
Public Method | CreateDirectory | Creates a new directory in the StorageContainer scope.
Public Method | CreateFile | Creates a file at a specified path in the StorageContainer.
Public Method | DeleteDirectory | Deletes a directory in the StorageContainer scope.
Public Method | DeleteFile | Deletes a file in the StorageContainer.
Public Method | DirectoryExists | Determines whether the specified path refers to an existing directory in the StorageContainer.
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | FileExists | Determines whether the specified path refers to an existing file in the StorageContainer.
Public Method | GetDirectoryNames | Overloaded. Enumerates the directories in the root of a StorageContainer.
Public Method | GetFileNames | Overloaded. Enumerates files in a StorageContainer.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | OpenFile | Overloaded. Opens a file at a specified path in the StorageContainer.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

StorageContainer Class
Microsoft.Xna.Framework.Storage Namespace


StorageContainer.CreateDirectory Method

StorageContainer.CreateDirectory Method

Creates a new directory in the StorageContainer scope.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public void CreateDirectory (
         string directory
)

Parameters

directory
The relative path of the directory to delete within the StorageContainer scope.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.CreateFile Method

StorageContainer.CreateFile Method

Creates a file at a specified path in the StorageContainer.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public Stream CreateFile (
         string file
)

Parameters

file
The relative path of the file to be created in the StorageContainer.

Return Value

A new file with read/write access.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.DeleteDirectory Method

StorageContainer.DeleteDirectory Method

Deletes a directory in the StorageContainer scope.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public void DeleteDirectory (
         string directory
)

Parameters

directory
The relative path of the directory to delete within the StorageContainer scope.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.DeleteFile Method

StorageContainer.DeleteFile Method

Deletes a file in the StorageContainer.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public void DeleteFile (
         string file
)

Parameters

file
The relative path of the file to delete within the StorageContainer.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.DirectoryExists Method

StorageContainer.DirectoryExists Method

Determines whether the specified path refers to an existing directory in the StorageContainer.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public bool DirectoryExists (
         string directory
)

Parameters

directory
The path to test.

Return Value

true if path refers to an existing directory in the StorageContainer and is not null; otherwise, false.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.Dispose Method

StorageContainer.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image Remarks

After the StorageContainer is opened on a StorageDevice, changes to the files within the container are cached until the container is disposed. If the storage device is removed or the Xbox 360 is powered down before the container is disposed, any changes are lost.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
BeginOpenContainer
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.FileExists Method

StorageContainer.FileExists Method

Determines whether the specified path refers to an existing file in the StorageContainer.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public bool FileExists (
         string file
)

Parameters

file
The path and file name to test.

Return Value

true if path refers to an existing file in the StorageContainer and is not null; otherwise, false.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.Finalize Method

StorageContainer.Finalize Method

Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
protected override void Finalize ()

Expand image Remarks

This method overrides System.Object.Finalize. Application code should not call this method. An object's Finalize method is automatically invoked during garbage collection unless a call to the GC.SuppressFinalize method disables finalization by the garbage collector.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.GetDirectoryNames Method

StorageContainer.GetDirectoryNames Method

Enumerates the directories in the root of a StorageContainer.

Expand image Overload List

Name | Description
StorageContainer.GetDirectoryNames () | Enumerates the directories in the root of a StorageContainer.
StorageContainer.GetDirectoryNames (String) | Enumerates the directories in the root of a StorageContainer that conform to a search pattern.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace


StorageContainer.GetDirectoryNames Method ()

StorageContainer.GetDirectoryNames Method ()
See Also
CollapseAll image

Enumerates the directories in the root of a StorageContainer.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public string[] GetDirectoryNames ()

Return Value

An array of relative paths of directories in the root of the StorageContainer. A zero-length array specifies that there are no directories in the root.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.GetDirectoryNames Method (String)

StorageContainer.GetDirectoryNames Method (String)
See Also
CollapseAll image

Enumerates the directories in the root of a StorageContainer that conform to a search pattern.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public string[] GetDirectoryNames (
         string searchPattern
)

Parameters

searchPattern
A search pattern. Both single-character ("?") and multicharacter ("*") wildcards are supported.

Return Value

An array of relative paths of directories in the root of the StorageContainer. A zero-length array specifies that there are no directories in the root.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.GetFileNames Method

StorageContainer.GetFileNames Method

Enumerates files in a StorageContainer.

Expand image Overload List

Name | Description
StorageContainer.GetFileNames () | Enumerates files in the root directory of a StorageContainer.
StorageContainer.GetFileNames (String) | Enumerates files in the root directory of a StorageContainer that match a given pattern.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace


StorageContainer.GetFileNames Method ()

StorageContainer.GetFileNames Method ()
See Also
CollapseAll image

Enumerates files in the root directory of a StorageContainer.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public string[] GetFileNames ()

Return Value

An array of relative paths of files in the root directory of StorageContainer scope. A zero-length array specifies that there are no files.

Expand image Remarks

GetFileNames applies only to the root directory of the StorageContainer. It does not examine any subdirectories.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.GetFileNames Method (String)

StorageContainer.GetFileNames Method (String)
See Also
CollapseAll image

Enumerates files in the root directory of a StorageContainer that match a given pattern.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public string[] GetFileNames (
         string searchPattern
)

Parameters

searchPattern
A search pattern. Both single-character ("?") and multicharacter ("*") wildcards are supported.

Return Value

An array of relative paths of files in the the root directory of StorageContainer scope that match searchPattern. A zero-length array specifies that there are no files that match.

Expand image Remarks

GetFileNames applies only to the root directory of the StorageContainer. It does not examine any subdirectories.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.OpenFile Method

StorageContainer.OpenFile Method

Opens a file at a specified path in the StorageContainer.

Expand image Overload List

Name | Description
StorageContainer.OpenFile (String, FileMode) | Opens a file in the StorageContainer.
StorageContainer.OpenFile (String, FileMode, FileAccess) | Opens a file in the StorageContainer in the designated mode with the specified read/write access.
StorageContainer.OpenFile (String, FileMode, FileAccess, FileShare) | Opens a file in the StorageContainer in the designated mode with the specified read/write access and sharing permission.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace


StorageContainer.OpenFile Method (String, FileMode)

StorageContainer.OpenFile Method (String, FileMode)
See Also
CollapseAll image

Opens a file in the StorageContainer.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public Stream OpenFile (
         string file,
         FileMode fileMode
)

Parameters

file
Relative path of the file within the StorageContainer.
fileMode
One of the enumeration values that specifies how to open the file.

Return Value

An unshared file with read/write access that is opened in the specified mode.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.OpenFile Method (String, FileMode, FileAccess)

StorageContainer.OpenFile Method (String, FileMode, FileAccess)
See Also
CollapseAll image

Opens a file in the StorageContainer in the designated mode with the specified read/write access.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public Stream OpenFile (
         string file,
         FileMode fileMode,
         FileAccess fileAccess
)

Parameters

file
Relative path of the file within the StorageContainer.
fileMode
One of the enumeration values that specifies how to open the file.
fileAccess
One of the enumeration values that specifies whether the file is opened with read, write, or read/write access.

Return Value

An unshared file opened in the designated mode with the specified access.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.OpenFile Method (String, FileMode, FileAccess, FileShare)

StorageContainer.OpenFile Method (String, FileMode, FileAccess, FileShare)
See Also
CollapseAll image

Opens a file in the StorageContainer in the designated mode with the specified read/write access and sharing permission.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public Stream OpenFile (
         string file,
         FileMode fileMode,
         FileAccess fileAccess,
         FileShare fileShare
)

Parameters

file
Relative path of the file within the StorageContainer.
fileMode
One of the enumeration values that specifies how to open the file.
fileAccess
One of the enumeration values that specifies whether the file is opened with read, write, or read/write access.
fileShare
A bitwise combination of enumeration values that specify the type of access other Stream objects have to this file.

Return Value

A file opened in the designated mode with the specified access and sharing options.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer Properties

StorageContainer Properties

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | Gets the name of the title.
Public Property | IsDisposed | Gets a value that indicates whether the object is disposed.
Public Property | StorageDevice | Gets the StorageDevice that holds the files in this container.

Expand image See Also

Reference

StorageContainer Class
Microsoft.Xna.Framework.Storage Namespace


StorageContainer.DisplayName Property

StorageContainer.DisplayName Property

Gets the name of the title.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public string DisplayName { get; }

Property Value

The name of the title.

Expand image Remarks

This is the same as the displayName passed to BeginOpenContainer.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.IsDisposed Property

StorageContainer.IsDisposed Property

Gets a value that indicates whether the object is disposed.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public bool IsDisposed { get; }

Property Value

true if the object is disposed; false otherwise.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer.StorageDevice Property

StorageContainer.StorageDevice Property

Gets the StorageDevice that holds the files in this container.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public StorageDevice StorageDevice { get; }

Property Value

The StorageDevice that holds the files in this container.

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageContainer Events

StorageContainer Events

Expand image Public Events

 | Name | Description
Public Event | Disposing | Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime.

Expand image See Also

Reference

StorageContainer Class
Microsoft.Xna.Framework.Storage Namespace


StorageContainer.Disposing Event

StorageContainer.Disposing Event

Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public event EventHandler<EventArgs> Disposing

Expand image See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice Class

StorageDevice Class
See Also Members
CollapseAll image

Represents a storage device for user data, such as a memory unit or hard drive.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public sealed class StorageDevice

Expand image See Also

Concepts

What Is Storage?

Reference

StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice Members

StorageDevice Members
See Also Events Methods Properties
CollapseAll image

The following tables list the members exposed by the StorageDevice type.

Expand image Public Properties

 | Name | Description
Public Property | FreeSpace | Gets the amount of free space on the device.
Public Property | IsConnected | Gets whether the device is connected.
Public Property | TotalSpace | Gets the total amount of space on the device.

Expand image Public Methods

 | Name | Description
Public Method | BeginOpenContainer | Begins the process for opening a StorageContainer containing any files for the specified title.
 | BeginShowSelector | Overloaded. Overloaded methods for showing the storage device selector asynchronously.
Public Method | DeleteContainer | Deletes a storage container without opening it.
Public Method | EndOpenContainer | Ends the process for opening a StorageContainer.
 | EndShowSelector | Ends the display of the storage selector user interface.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Public Events

Name | Description
DeviceChanged | Occurs when a device is removed or inserted.

Expand image See Also

Concepts

What Is Storage?

Reference

StorageDevice Class
Microsoft.Xna.Framework.Storage Namespace


StorageDevice Methods

StorageDevice Methods

Expand image Public Methods

 | Name | Description
Public Method | BeginOpenContainer | Begins the process for opening a StorageContainer containing any files for the specified title.
 | BeginShowSelector | Overloaded. Overloaded methods for showing the storage device selector asynchronously.
Public Method | DeleteContainer | Deletes a storage container without opening it.
Public Method | EndOpenContainer | Ends the process for opening a StorageContainer.
 | EndShowSelector | Ends the display of the storage selector user interface.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

StorageDevice Class
Microsoft.Xna.Framework.Storage Namespace


StorageDevice.BeginOpenContainer Method

StorageDevice.BeginOpenContainer Method

Begins the process for opening a StorageContainer containing any files for the specified title.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public IAsyncResult BeginOpenContainer (
         string displayName,
         AsyncCallback callback,
         Object state
)

Parameters

displayName
A constant human-readable string that names the file.
callback
An AsyncCallback that represents the method called when the operation is complete.
state
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | displayName is null.
InvalidOperationException | A container is already open for the PlayerIndex set in BeginShowSelector. A new container cannot be opened until all previous containers used by this PlayerIndex are disposed.

Expand image Remarks

After the container is opened, changes to the files within the container are cached until the container is disposed. For this reason, only one container per profile can be opened concurrently on the same device.

If the storage device is removed or the Xbox 360 console is powered down before the container is disposed, any changes are lost.

Call the Dispose method to dispose a StorageContainer.

Expand image See Also

Overview

Working with Asynchronous Methods in XNA Game Studio

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice.BeginShowSelector Method

StorageDevice.BeginShowSelector Method

Overloaded methods for showing the storage device selector asynchronously.

Expand image Overload List

Name | Description
StorageDevice.BeginShowSelector (AsyncCallback, Object) | Begins the process for displaying the storage device selector user interface, and for specifying a callback implemented when the player chooses a device.
StorageDevice.BeginShowSelector (Int32, Int32, AsyncCallback, Object) | Begins the process for displaying the storage device selector user interface, and for specifying the size of the data to be written to the storage device and the callback implemented when the player chooses a device.
StorageDevice.BeginShowSelector (PlayerIndex, AsyncCallback, Object) | Begins the process for displaying the storage device selector user interface; specifies the callback implemented when the player chooses a device.
StorageDevice.BeginShowSelector (PlayerIndex, Int32, Int32, AsyncCallback, Object) | Begins the process for displaying the storage device selector user interface, for specifying the player who requested the save operation, for setting the size of data to be written to the storage device, and for naming the callback implemented when the player chooses a device.

Expand image See Also

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace


StorageDevice.BeginShowSelector Method (AsyncCallback, Object)

StorageDevice.BeginShowSelector Method (AsyncCallback, Object)
See Also
CollapseAll image

Begins the process for displaying the storage device selector user interface, and for specifying a callback implemented when the player chooses a device.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public static IAsyncResult BeginShowSelector (
         AsyncCallback callback,
         Object state
)

Parameters

callback
An AsyncCallback that represents the method called when the player chooses a device.
state
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Expand image See Also

Tasks

What Is Storage?
Getting a StorageDevice Asynchronously

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice.BeginShowSelector Method (Int32, Int32, AsyncCallback, Object)

StorageDevice.BeginShowSelector Method (Int32, Int32, AsyncCallback, Object)
See Also
CollapseAll image

Begins the process for displaying the storage device selector user interface, and for specifying the size of the data to be written to the storage device and the callback implemented when the player chooses a device.

The request is performed asynchronously.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public static IAsyncResult BeginShowSelector (
         int sizeInBytes,
         int directoryCount,
         AsyncCallback callback,
         Object state
)

Parameters

sizeInBytes
The size, in bytes, of data to write to the storage device.
directoryCount
The number of directories to write to the storage device.
callback
An AsyncCallback that represents the method called when the player chooses a device.
state
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Expand image See Also

Tasks

What Is Storage?
Getting a StorageDevice Asynchronously
Working with Asynchronous Methods in XNA Game Studio

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice.BeginShowSelector Method (PlayerIndex, AsyncCallback, Object)

StorageDevice.BeginShowSelector Method (PlayerIndex, AsyncCallback, Object)
See Also
CollapseAll image

Begins the process for displaying the storage device selector user interface; specifies the callback implemented when the player chooses a device.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public static IAsyncResult BeginShowSelector (
         PlayerIndex player,
         AsyncCallback callback,
         Object state
)

Parameters

player
The PlayerIndex that represents the player who requested the save operation. On Windows, the only valid option is PlayerIndex.One.
callback
An AsyncCallback that represents the method called when the player chooses a device.
state
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Expand image See Also

Tasks

What Is Storage?
Getting a StorageDevice Asynchronously
Working with Asynchronous Methods in XNA Game Studio

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice.BeginShowSelector Method (PlayerIndex, Int32, Int32, AsyncCallback, Object)

StorageDevice.BeginShowSelector Method (PlayerIndex, Int32, Int32, AsyncCallback, Object)
See Also
CollapseAll image

Begins the process for displaying the storage device selector user interface, for specifying the player who requested the save operation, for setting the size of data to be written to the storage device, and for naming the callback implemented when the player chooses a device.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public static IAsyncResult BeginShowSelector (
         PlayerIndex player,
         int sizeInBytes,
         int directoryCount,
         AsyncCallback callback,
         Object state
)

Parameters

player
The PlayerIndex that represents the player who requested the save operation. On Windows, the only valid option is PlayerIndex.One.
sizeInBytes
The size, in bytes, of the data to write to the storage device.
directoryCount
The number of directories to write to the storage device.
callback
An AsyncCallback that represents the method called when the player chooses a device.
state
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Expand image See Also

Tasks

What Is Storage?
Getting a StorageDevice Asynchronously
Working with Asynchronous Methods in XNA Game Studio

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice.DeleteContainer Method

StorageDevice.DeleteContainer Method

Deletes a storage container without opening it. You can do this even if the container is corrupted.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public void DeleteContainer (
         string titleName
)

Parameters

titleName
The name of the storage container to delete.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | titleName is null.
InvalidOperationException

The container is currently open. A container cannot be deleted if it is open.

Note
No exception will be thrown if the container does not exist.

Expand image Remarks

The string passed to titleName must be the same string used with StorageDevice.BeginOpenContainer.

Usually a storage container is closed with StorageContainer.Dispose so that it can be re-opened with its data intact. Use DeleteContainer only when you want to delete the data permanently or when you determine the storage container has been corrupted.

See the What Is Storage? for more information about using storage containers in your title.

Expand image See Also

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice.EndOpenContainer Method

StorageDevice.EndOpenContainer Method

Ends the process for opening a StorageContainer.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public StorageContainer EndOpenContainer (
         IAsyncResult result
)

Parameters

result
The IAsyncResult returned from BeginOpenContainer.

Return Value

A StorageContainer containing any files for the title.

Expand image See Also

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice.EndShowSelector Method

StorageDevice.EndShowSelector Method

Ends the display of the storage selector user interface.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public static StorageDevice EndShowSelector (
         IAsyncResult result
)

Parameters

result
The IAsyncResult returned from BeginShowSelector.

Return Value

Returns the storage device selected by the gamer, or null if the user cancelled the selection.

Expand image See Also

Tasks

What Is Storage?
Getting a StorageDevice Asynchronously

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice Properties

StorageDevice Properties

Expand image Public Properties

 | Name | Description
Public Property | FreeSpace | Gets the amount of free space on the device.
Public Property | IsConnected | Gets whether the device is connected.
Public Property | TotalSpace | Gets the total amount of space on the device.

Expand image See Also

Reference

StorageDevice Class
Microsoft.Xna.Framework.Storage Namespace


StorageDevice.FreeSpace Property

StorageDevice.FreeSpace Property

Gets the amount of free space on the device.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public long FreeSpace { get; }

Property Value

Free space on the device, in bytes.

Expand image Exceptions

Exception type | Condition
StorageDeviceNotConnectedException | The storage device bound to the container is not connected.

Expand image See Also

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice.IsConnected Property

StorageDevice.IsConnected Property

Gets whether the device is connected.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public bool IsConnected { get; }

Property Value

true if the device is connected; false otherwise.

Expand image See Also

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice.TotalSpace Property

StorageDevice.TotalSpace Property

Gets the total amount of space on the device.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public long TotalSpace { get; }

Property Value

Total amount of space on the device, in bytes.

Expand image Exceptions

Exception type | Condition
StorageDeviceNotConnectedException | The storage device bound to the container is not connected.

Expand image See Also

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDevice Events

StorageDevice Events

Expand image Public Events

Name | Description
DeviceChanged | Occurs when a device is removed or inserted.

Expand image See Also

Reference

StorageDevice Class
Microsoft.Xna.Framework.Storage Namespace


StorageDevice.DeviceChanged Event

StorageDevice.DeviceChanged Event

Occurs when a device is removed or inserted.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public static event EventHandler<EventArgs> DeviceChanged

Expand image See Also

Reference

StorageDevice Class
StorageDevice Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDeviceNotConnectedException Class

StorageDeviceNotConnectedException Class
See Also Members
CollapseAll image

The exception that is thrown when the requested StorageDevice is not connected.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public class StorageDeviceNotConnectedException : ExternalException

Expand image See Also

Reference

StorageDeviceNotConnectedException Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDeviceNotConnectedException Members

StorageDeviceNotConnectedException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the StorageDeviceNotConnectedException type.

Expand image Public Constructors

 | Name | Description
Public Method | StorageDeviceNotConnectedException | Overloaded. Initializes a new instance of this class.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | ErrorCode | (Inherited from ExternalException.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

StorageDeviceNotConnectedException Class
Microsoft.Xna.Framework.Storage Namespace


StorageDeviceNotConnectedException Constructor

StorageDeviceNotConnectedException Constructor

Initializes a new instance of this class.

Expand image Overload List

Name | Description
StorageDeviceNotConnectedException () | Initializes a new instance of this class.
StorageDeviceNotConnectedException (SerializationInfo, StreamingContext) | Initializes a new instance of this class during deserialization.
StorageDeviceNotConnectedException (String) | Initializes a new instance of this class with a specified error message.
StorageDeviceNotConnectedException (String, Exception) | Initializes a new instance of this class with a specified error message and a reference to the inner exception that is the cause of this exception.

Expand image See Also

Reference

StorageDeviceNotConnectedException Class
StorageDeviceNotConnectedException Members
Microsoft.Xna.Framework.Storage Namespace


StorageDeviceNotConnectedException Constructor ()

StorageDeviceNotConnectedException Constructor ()
See Also
CollapseAll image

Initializes a new instance of this class.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public StorageDeviceNotConnectedException ()

Expand image Remarks

This constructor initializes the Message property of the new instance to a system-supplied message that describes the error, such as "A file read or write operation failed." This message takes into account the current system culture.

The following table shows the initial property values for an instance of StorageDeviceNotConnectedException.

Property | Value
InnerException | A null reference.
Message | The localized error message string.

Expand image See Also

Reference

StorageDeviceNotConnectedException Class
StorageDeviceNotConnectedException Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDeviceNotConnectedException Constructor (SerializationInfo, StreamingContext)

StorageDeviceNotConnectedException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Note
This constructor is available only when developing for Windows.
Initializes a new instance of this class during deserialization.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
protected StorageDeviceNotConnectedException (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
The information needed to serialize an object.
context
The source or destination for the serialization stream.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or a null reference if the InnerException property does not supply the inner exception value to the constructor.

Expand image See Also

Reference

StorageDeviceNotConnectedException Class
StorageDeviceNotConnectedException Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Windows 7, Windows Vista, Windows XP


StorageDeviceNotConnectedException Constructor (String)

StorageDeviceNotConnectedException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of this class with a specified error message.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public StorageDeviceNotConnectedException (
         string message
)

Parameters

message
A message that describes the error.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

The following table shows the initial property values for an instance of StorageDeviceNotConnectedException.

Property | Value
InnerException | A null reference.
Message | The localized error message string.

Expand image See Also

Reference

StorageDeviceNotConnectedException Class
StorageDeviceNotConnectedException Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDeviceNotConnectedException Constructor (String, Exception)

StorageDeviceNotConnectedException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of this class with a specified error message and a reference to the inner exception that is the cause of this exception.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Expand image Syntax

C#
public StorageDeviceNotConnectedException (
         string message,
         Exception innerException
)

Parameters

message
A message that describes the error.
innerException
The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Expand image Remarks

The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or a null reference if the InnerException property does not supply the inner exception value to the constructor.

The following table shows the initial property values for an instance of StorageDeviceNotConnectedException.

Property | Value
InnerException | A null reference.
Message | The localized error message string.

Expand image See Also

Reference

StorageDeviceNotConnectedException Class
StorageDeviceNotConnectedException Members
Microsoft.Xna.Framework.Storage Namespace

Expand image Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP


StorageDeviceNotConnectedException Methods

StorageDeviceNotConnectedException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

StorageDeviceNotConnectedException Class
Microsoft.Xna.Framework.Storage Namespace


StorageDeviceNotConnectedException Properties

StorageDeviceNotConnectedException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | ErrorCode | (Inherited from ExternalException.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

StorageDeviceNotConnectedException Class
Microsoft.Xna.Framework.Storage Namespace


Content Pipeline Class Library

Content Pipeline Class Library

The Content Pipeline class library is a library of classes, interfaces, and value types that are included in XNA Game Studio. This library provides access to XNA Framework Content Pipeline functionality and is designed to be the foundation on which Content Pipeline–related applications, components, and controls are built.

Expand image Namespaces

Microsoft.Xna.Framework.Content.Pipeline
Provides classes representing base types and building block functionality for use by more specialized object models, such as the Graphics DOM.
Microsoft.Xna.Framework.Content.Pipeline.Audio
Provides intermediate classes and types for representing and manipulating graphics audio data.
Microsoft.Xna.Framework.Content.Pipeline.Graphics
Provides intermediate classes and types for representing and manipulating graphics data.
Microsoft.Xna.Framework.Content.Pipeline.Processors
Provides base classes that represent processors used by the XNA Framework Content Pipeline when processing specific game asset types.
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Provides base classes that represent compilers and writers used by the XNA Framework Content Pipeline when processing specific game asset types.
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Provides base classes that represent the creation and writing of intermediate content for game asset types processed by the XNA Framework Content Pipeline.
Microsoft.Xna.Framework.Content.Pipeline.Tasks
Provides support for importing and processing game assets into the binary format that is used by the content loader of a game project.

Expand image See Also

Concepts

Adding Content to a Game
What Is Content?
Content Pipeline Content Catalog at XNA Creators Club Online


Microsoft.Xna.Framework.Content.Pipeline Namespace

Microsoft.Xna.Framework.Content.Pipeline Namespace

Provides classes representing base types and building block functionality for use by more specialized object models, such as the Graphics DOM.

Expand image Classes

 | Name | Description
Public Class | ChildCollection | Provides a collection of child objects for a content item.
Public Class | ContentBuildLogger | Provides methods for reporting informational messages or warnings from content importers and processors.
Public Class | ContentIdentity | Provides properties describing the origin of the game asset, such as the original source file and creation tool. This information is used for error reporting, and by processors that need to determine from what directory the asset was originally loaded.
Public Class | ContentImporter | Implements a file format importer for use with game assets.
Public Class | ContentImporterAttribute | Provides properties that identify and provide metadata about the importer, such as supported file extensions and caching information.
Public Class | ContentImporterContext | Provides properties that define logging behavior for the importer.
Public Class | ContentItem | Provides properties that define various aspects of content stored using the intermediate file format of the XNA Framework.
Public Class | ContentProcessor | Provides a base class to use when developing custom processor components. All processors must derive from this class.
Public Class | ContentProcessorAttribute | Gets any existing content processor components.
Public Class | ContentProcessorContext | Provides access to custom processor parameters, methods for converting member data, and triggering nested builds.
Public Class | EffectImporter | Provides methods for reading effect (.fx) files for use in the Content Pipeline.
Public Class | ExternalReference | Specifies external references to a data file for the content item.
Public Class | FbxImporter | Provides methods for reading AutoDesk (.fbx) files for use in the Content Pipeline.
Public Class | FontDescriptionImporter | Provides methods for reading .spritefont files for use in the Content Pipeline.
Public Class | InvalidContentException | Thrown when errors are encountered in content during processing.
Public Class | Mp3Importer | Provides methods for reading MP3 audio files for use in the Content Pipeline.
Public Class | NamedValueDictionary | Base class for dictionaries that map string identifiers to data values.
Public Class | OpaqueDataDictionary | Provides properties that define opaque data for a game asset.
Public Class | PipelineComponentScanner | Implements a scanner object containing the available importers and processors for an application.
Public Class | PipelineException | Thrown when errors are encountered during a content pipeline build.
Public Class | ProcessorParameter | Represents a processor parameter.
Public Class | ProcessorParameterCollection | Represents a collection of processor parameters, usually for a single processor.
Public Class | TextureImporter | Provides methods for reading texture files for use in the Content Pipeline.
Public Class | VideoContent | Provides a base class for all video objects.
Public Class | WavImporter | Provides methods for reading .wav audio files for use in the Content Pipeline.
Public Class | WmaImporter | Provides methods for reading Windows Media Audio (.wma) files for use in the Content Pipeline.
Public Class | WmvImporter | Provides methods for reading Windows Media Video (.wmv) files for use in the Content Pipeline.
Public Class | XImporter | Provides methods for reading DirectX Object (.x) files for use in the Content Pipeline.
Public Class | XmlImporter | Implements an importer for reading intermediate XML files.

Expand image Interfaces

 | Name | Description
Public Interface | IContentImporter | Accesses a statically typed ContentImporter instance from generic code using dynamic typing.
Public Interface | IContentProcessor | Provides methods and properties for accessing a statically typed ContentProcessor subclass, using dynamically typed object data.

Expand image Enumerations

 | Name | Description
Public Enumeration | TargetPlatform | Identifiers for the target platform.


ChildCollection Generic Class

ChildCollection Generic Class
See Also Members
CollapseAll image

Provides a collection of child objects for a content item.

Links from a child object to its parent are maintained as the collection contents are modified.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class ChildCollection<TParent,TChild> : Collection<TChild>  where TParent : class
   where TChild : class

Expand image See Also

Reference

ChildCollection Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ChildCollection Members

ChildCollection Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the ChildCollection type.

Expand image Protected Constructors

 | Name | Description
Protected Method | ChildCollection | Creates an instance of ChildCollection.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | Removes all children from the collection.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetParent | Gets the parent of a child object.
Protected Method | InsertItem | Inserts a child object into the collection at the specified location.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | Removes a child object from the collection.
Protected Method | SetItem | Modifies the value of the child object at the specified location.
Protected Method | SetParent | Modifies the value of the parent object of the specified child object.

Expand image See Also

Reference

ChildCollection Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ChildCollection Constructor

ChildCollection Constructor

Creates an instance of ChildCollection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ChildCollection (
         TParent parent
)

Parameters

parent
Parent object of the child objects returned in the collection.

Expand image See Also

Reference

ChildCollection Generic Class
ChildCollection Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ChildCollection Methods

ChildCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | Removes all children from the collection.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetParent | Gets the parent of a child object.
Protected Method | InsertItem | Inserts a child object into the collection at the specified location.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | Removes a child object from the collection.
Protected Method | SetItem | Modifies the value of the child object at the specified location.
Protected Method | SetParent | Modifies the value of the parent object of the specified child object.

Expand image See Also

Reference

ChildCollection Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ChildCollection.ClearItems Method

ChildCollection.ClearItems Method

Removes all children from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void ClearItems ()

Expand image See Also

Reference

ChildCollection Generic Class
ChildCollection Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ChildCollection.GetParent Method

ChildCollection.GetParent Method

Gets the parent of a child object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected abstract TParent GetParent (
         TChild child
)

Parameters

child
The child of the parent being retrieved.

Return Value

The parent of the child object.

Expand image See Also

Reference

ChildCollection Generic Class
ChildCollection Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ChildCollection.InsertItem Method

ChildCollection.InsertItem Method

Inserts a child object into the collection at the specified location.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void InsertItem (
         int index,
         TChild item
)

Parameters

index
The position in the collection.
item
The child object being inserted.

Expand image See Also

Reference

ChildCollection Generic Class
ChildCollection Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ChildCollection.RemoveItem Method

ChildCollection.RemoveItem Method

Removes a child object from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void RemoveItem (
         int index
)

Parameters

index
The index of the item being removed.

Expand image See Also

Reference

ChildCollection Generic Class
ChildCollection Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ChildCollection.SetItem Method

ChildCollection.SetItem Method

Modifies the value of the child object at the specified location.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void SetItem (
         int index,
         TChild item
)

Parameters

index
The index of the child object being modified.
item
The new value for the child object.

Expand image See Also

Reference

ChildCollection Generic Class
ChildCollection Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ChildCollection.SetParent Method

ChildCollection.SetParent Method

Modifies the value of the parent object of the specified child object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected abstract void SetParent (
         TChild child,
         TParent parent
)

Parameters

child
The child of the parent being modified.
parent
The new value for the parent object.

Expand image See Also

Reference

ChildCollection Generic Class
ChildCollection Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ChildCollection Properties

ChildCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image See Also

Reference

ChildCollection Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentBuildLogger Class

ContentBuildLogger Class
See Also Members
CollapseAll image

Provides methods for reporting informational messages or warnings from content importers and processors.

Do not use this class to report errors. Instead, report errors by throwing a PipelineException or InvalidContentException.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class ContentBuildLogger

Expand image See Also

Reference

ContentBuildLogger Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentBuildLogger Members

ContentBuildLogger Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the ContentBuildLogger type.

Expand image Protected Constructors

 | Name | Description
Protected Method | ContentBuildLogger | Initializes a new instance of ContentBuildLogger.

Expand image Public Properties

 | Name | Description
Public Property | LoggerRootDirectory | Gets or sets the base reference path used when reporting errors during the content build process.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | LogImportantMessage | Outputs a high-priority status message from a content importer or processor.
Public Method | LogMessage | Outputs a low priority status message from a content importer or processor.
Public Method | LogWarning | Outputs a warning message from a content importer or processor.
Public Method | PopFile | Outputs a message indicating that a content asset has completed processing.
Public Method | PushFile | Outputs a message indicating that a content asset has begun processing.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetCurrentFilename | Gets the filename currently being processed, for use in warning and error messages.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentBuildLogger Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentBuildLogger Constructor

ContentBuildLogger Constructor

Initializes a new instance of ContentBuildLogger.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ContentBuildLogger ()

Expand image See Also

Reference

ContentBuildLogger Class
ContentBuildLogger Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentBuildLogger Methods

ContentBuildLogger Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | LogImportantMessage | Outputs a high-priority status message from a content importer or processor.
Public Method | LogMessage | Outputs a low priority status message from a content importer or processor.
Public Method | LogWarning | Outputs a warning message from a content importer or processor.
Public Method | PopFile | Outputs a message indicating that a content asset has completed processing.
Public Method | PushFile | Outputs a message indicating that a content asset has begun processing.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetCurrentFilename | Gets the filename currently being processed, for use in warning and error messages.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentBuildLogger Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentBuildLogger.GetCurrentFilename Method

ContentBuildLogger.GetCurrentFilename Method

Gets the filename currently being processed, for use in warning and error messages.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected string GetCurrentFilename (
         ContentIdentity contentIdentity
)

Parameters

contentIdentity
Identity of a content item. If specified, GetCurrentFilename uses this value to refine the search. If no value os specified, the current PushFile state is used.

Return Value

Name of the file being processed.

Expand image See Also

Reference

ContentBuildLogger Class
ContentBuildLogger Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentBuildLogger.LogImportantMessage Method

ContentBuildLogger.LogImportantMessage Method

Outputs a high-priority status message from a content importer or processor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract void LogImportantMessage (
         string message,
         params Object[] messageArgs
)

Parameters

message
Message being reported.
messageArgs
[ParamArrayAttribute] Arguments for the reported message.

Expand image Remarks

Use LogImportantMessage only for important information, because these messages appear in the Output window of Visual Studio. Importers and processors should use this functionality only for unusual or unexpected situations.

Expand image See Also

Reference

ContentBuildLogger Class
ContentBuildLogger Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentBuildLogger.LogMessage Method

ContentBuildLogger.LogMessage Method

Outputs a low priority status message from a content importer or processor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract void LogMessage (
         string message,
         params Object[] messageArgs
)

Parameters

message
Message being reported.
messageArgs
[ParamArrayAttribute] Arguments for the reported message.

Expand image Remarks

This message will not usually appear in the Build Output window of Visual Studio, but it can be viewed if the content pipeline is called directly from an MSBuild task.

Expand image See Also

Reference

ContentBuildLogger Class
ContentBuildLogger Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentBuildLogger.LogWarning Method

ContentBuildLogger.LogWarning Method

Outputs a warning message from a content importer or processor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract void LogWarning (
         string helpLink,
         ContentIdentity contentIdentity,
         string message,
         params Object[] messageArgs
)

Parameters

helpLink
Link to an existing online help topic containing related information.
contentIdentity
Identity of the content item that generated the message.
message
Message being reported.
messageArgs
[ParamArrayAttribute] Arguments for the reported message.

Expand image Remarks

Use LogWarning only for important information, because these messages appear in the Error List window of Visual Studio. The message text should indicate what steps need to be taken to correct the problem.

Expand image See Also

Reference

ContentBuildLogger Class
ContentBuildLogger Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentBuildLogger.PopFile Method

ContentBuildLogger.PopFile Method

Outputs a message indicating that a content asset has completed processing.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void PopFile ()

Expand image See Also

Reference

ContentBuildLogger Class
ContentBuildLogger Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentBuildLogger.PushFile Method

ContentBuildLogger.PushFile Method

Outputs a message indicating that a content asset has begun processing.

All logger warnings or error exceptions from this time forward to the next PopFile call refer to this file.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void PushFile (
         string filename
)

Parameters

filename
Name of the file containing future messages.

Expand image See Also

Reference

ContentBuildLogger Class
ContentBuildLogger Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentBuildLogger Properties

ContentBuildLogger Properties

Expand image Public Properties

 | Name | Description
Public Property | LoggerRootDirectory | Gets or sets the base reference path used when reporting errors during the content build process.

Expand image See Also

Reference

ContentBuildLogger Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentBuildLogger.LoggerRootDirectory Property

ContentBuildLogger.LoggerRootDirectory Property

Gets or sets the base reference path used when reporting errors during the content build process.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string LoggerRootDirectory { get; set; }

Property Value

Current name of the base directory or the value to be set.

Expand image Remarks

When building XNA content, all errors are displayed in the Error List Window of Visual Studio. Along with the data that triggered the error, the Error List displays the path and filename where the offending data was encountered.

By default, the path of the offending file that is reported in the Error List is always expressed as it relates to the location of the project file that references it.

When set, the LoggerRootDirectory property specifies an explicit base path for error reporting that overrides the default operation. All offending files reported in the Error List will be expressed as they relate to the base path set in LoggerRootDirectory.

Expand image See Also

Reference

ContentBuildLogger Class
ContentBuildLogger Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentIdentity Class

ContentIdentity Class
See Also Members
CollapseAll image

Provides properties describing the origin of the game asset, such as the original source file and creation tool. This information is used for error reporting, and by processors that need to determine from what directory the asset was originally loaded.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[SerializableAttribute]
public class ContentIdentity

Expand image See Also

Reference

ContentIdentity Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentIdentity Members

ContentIdentity Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the ContentIdentity type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentIdentity | Overloaded. Initializes a new instance of ContentIdentity.

Expand image Public Properties

 | Name | Description
Public Property | FragmentIdentifier | Gets or sets the specific location of the content item within the larger source file.
Public Property | SourceFilename | Gets or sets the file name of the asset source.
Public Property | SourceTool | Gets or sets the creation tool of the asset.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentIdentity Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentIdentity Constructor

ContentIdentity Constructor

Initializes a new instance of ContentIdentity.

Expand image Overload List

Name | Description
ContentIdentity () | Initializes a new instance of ContentIdentity.
ContentIdentity (String) | Initializes a new instance of ContentIdentity with the specified values.
ContentIdentity (String, String) | Initializes a new instance of ContentIdentity with the specified values.
ContentIdentity (String, String, String) | Initializes a new instance of ContentIdentity with the specified values.

Expand image See Also

Reference

ContentIdentity Class
ContentIdentity Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentIdentity Constructor ()

ContentIdentity Constructor ()
See Also
CollapseAll image

Initializes a new instance of ContentIdentity.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentIdentity ()

Expand image See Also

Reference

ContentIdentity Class
ContentIdentity Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentIdentity Constructor (String)

ContentIdentity Constructor (String)
See Also
CollapseAll image

Initializes a new instance of ContentIdentity with the specified values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentIdentity (
         string sourceFilename
)

Parameters

sourceFilename
The absolute path to the file name of the asset source.

Expand image See Also

Reference

ContentIdentity Class
ContentIdentity Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentIdentity Constructor (String, String)

ContentIdentity Constructor (String, String)
See Also
CollapseAll image

Initializes a new instance of ContentIdentity with the specified values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentIdentity (
         string sourceFilename,
         string sourceTool
)

Parameters

sourceFilename
The absolute path to the file name of the asset source.
sourceTool
The name of the digital content creation (DCC) tool that created the asset.

Expand image See Also

Reference

ContentIdentity Class
ContentIdentity Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentIdentity Constructor (String, String, String)

ContentIdentity Constructor (String, String, String)
See Also
CollapseAll image

Initializes a new instance of ContentIdentity with the specified values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentIdentity (
         string sourceFilename,
         string sourceTool,
         string fragmentIdentifier
)

Parameters

sourceFilename
The absolute path to the file name of the asset source.
sourceTool
The name of the digital content creation (DCC) tool that created the asset.
fragmentIdentifier

Specific location of the content item within the larger source file. For example, this could be a line number in the file.

Expand image See Also

Reference

ContentIdentity Class
ContentIdentity Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentIdentity Methods

ContentIdentity Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentIdentity Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentIdentity Properties

ContentIdentity Properties

Expand image Public Properties

 | Name | Description
Public Property | FragmentIdentifier | Gets or sets the specific location of the content item within the larger source file.
Public Property | SourceFilename | Gets or sets the file name of the asset source.
Public Property | SourceTool | Gets or sets the creation tool of the asset.

Expand image See Also

Reference

ContentIdentity Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentIdentity.FragmentIdentifier Property

ContentIdentity.FragmentIdentifier Property

Gets or sets the specific location of the content item within the larger source file.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string FragmentIdentifier { get; set; }

Property Value

Location of the content item. This location can be in various forms. For example, this could indicate a line number within the source file.

Expand image See Also

Reference

ContentIdentity Class
ContentIdentity Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentIdentity.SourceFilename Property

ContentIdentity.SourceFilename Property

Gets or sets the file name of the asset source.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string SourceFilename { get; set; }

Property Value

The absolute path to the file name of the asset source.

Expand image See Also

Reference

ContentIdentity Class
ContentIdentity Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentIdentity.SourceTool Property

ContentIdentity.SourceTool Property

Gets or sets the creation tool of the asset.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string SourceTool { get; set; }

Property Value

The name of the digital content creation (DCC) tool that created the asset.

Expand image See Also

Reference

ContentIdentity Class
ContentIdentity Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporter Generic Class

ContentImporter Generic Class
See Also Members
CollapseAll image

Implements a file format importer for use with game assets.

Importers, either provided by the framework or written by a developer, must derive from ContentImporter, as well as being marked with a ContentImporterAttribute.

An importer should produce results in the standard intermediate object model. If an asset has information not supported by the object model, the importer should output it as opaque data (key/value attributes attached to the relevant object). By following this procedure, a content pipeline can access specialized digital content creation (DCC) tool information, even when that information has not been fully standardized into the official object model.

You can also design custom importers that accept and import types containing specific third-party extensions to the object model.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class ContentImporter<T> : IContentImporter

Expand image See Also

Reference

ContentImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporter Members

ContentImporter Members
See Also Constructors Methods Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the ContentImporter type.

Expand image Protected Constructors

 | Name | Description
Protected Method | ContentImporter | Initializes a new instance of ContentImporter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the framework when importing a game asset.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import | Called by the framework when importing a game asset.

Expand image See Also

Reference

ContentImporter Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentImporter Constructor

ContentImporter Constructor

Initializes a new instance of ContentImporter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ContentImporter ()

Expand image See Also

Reference

ContentImporter Generic Class
ContentImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporter Methods

ContentImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the framework when importing a game asset.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import | Called by the framework when importing a game asset.

Expand image See Also

Reference

ContentImporter Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentImporter.Import Method

ContentImporter.Import Method

Called by the framework when importing a game asset. This is the method called by XNA when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract T Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

ContentImporter Generic Class
ContentImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import Method

Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import Method
See Also
CollapseAll image

Called by the framework when importing a game asset. This is the method called by XNA when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private Object Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

ContentImporter Generic Class
ContentImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterAttribute Class

ContentImporterAttribute Class
See Also Members
CollapseAll image

Provides properties that identify and provide metadata about the importer, such as supported file extensions and caching information.

Importers are required to initialize this attribute.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class ContentImporterAttribute : Attribute

Expand image See Also

Reference

ContentImporterAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterAttribute Members

ContentImporterAttribute Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the ContentImporterAttribute type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentImporterAttribute | Overloaded. Initializes a new instance of ContentImporterAttribute.

Expand image Public Properties

 | Name | Description
Public Property | CacheImportedData | Gets and sets the caching of the content during importation.
Public Property | DefaultProcessor | Gets or sets the name of the default processor for content read by this importer.
Public Property | DisplayName | Gets or sets the string representing the importer in a user interface.
Public Property | FileExtensions | Gets the supported file name extensions of the importer.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentImporterAttribute Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentImporterAttribute Constructor

ContentImporterAttribute Constructor

Initializes a new instance of ContentImporterAttribute.

Expand image Overload List

Name | Description
ContentImporterAttribute (String) | Initializes a new instance of ContentImporterAttribute and sets the file name extension supported by the importer.
ContentImporterAttribute (String[]) | Initializes a new instance of ContentImporterAttribute and sets the file name extensions supported by the importer.

Expand image See Also

Reference

ContentImporterAttribute Class
ContentImporterAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentImporterAttribute Constructor (String)

ContentImporterAttribute Constructor (String)
See Also
CollapseAll image

Initializes a new instance of ContentImporterAttribute and sets the file name extension supported by the importer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentImporterAttribute (
         string fileExtension
)

Parameters

fileExtension
The list of file name extensions supported by the importer. Prefix each extension with a '.'.

Expand image See Also

Reference

ContentImporterAttribute Class
ContentImporterAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterAttribute Constructor (String[])

ContentImporterAttribute Constructor (String[])
See Also
CollapseAll image

Initializes a new instance of ContentImporterAttribute and sets the file name extensions supported by the importer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentImporterAttribute (
         params string[] fileExtensions
)

Parameters

fileExtensions
[ParamArrayAttribute] The list of file name extensions supported by the importer. Prefix each extension with a '.'.

Expand image See Also

Reference

ContentImporterAttribute Class
ContentImporterAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterAttribute Methods

ContentImporterAttribute Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentImporterAttribute Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentImporterAttribute Properties

ContentImporterAttribute Properties

Expand image Public Properties

 | Name | Description
Public Property | CacheImportedData | Gets and sets the caching of the content during importation.
Public Property | DefaultProcessor | Gets or sets the name of the default processor for content read by this importer.
Public Property | DisplayName | Gets or sets the string representing the importer in a user interface.
Public Property | FileExtensions | Gets the supported file name extensions of the importer.

Expand image See Also

Reference

ContentImporterAttribute Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentImporterAttribute.CacheImportedData Property

ContentImporterAttribute.CacheImportedData Property

Gets and sets the caching of the content during importation.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool CacheImportedData { get; set; }

Property Value

If true, imported content is cached in an intermediate file (managed by XNA). By default, caching is not enabled.

Caching provides significantly faster iteration times when changing the processing code for a file format. A good example would be a third-party digital content creation (DCC) tool that needs to execute before importation can occur. However, caching is not appropriate for all importers—for example, caching bulky content that is quick to import, such as bitmap images.

Expand image See Also

Reference

ContentImporterAttribute Class
ContentImporterAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterAttribute.DefaultProcessor Property

ContentImporterAttribute.DefaultProcessor Property

Gets or sets the name of the default processor for content read by this importer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string DefaultProcessor { get; set; }

Property Value

Name of the processor to be used as the default.

Expand image See Also

Reference

ContentImporterAttribute Class
ContentImporterAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterAttribute.DisplayName Property

ContentImporterAttribute.DisplayName Property

Gets or sets the string representing the importer in a user interface. This name is not used by the content pipeline and should not be passed to the BuildAssets task (a custom MSBuild task used by XNA Game Studio). It is used for display purposes only.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual string DisplayName { get; set; }

Property Value

Name displayed in the user interface.

Expand image See Also

Reference

ContentImporterAttribute Class
ContentImporterAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterAttribute.FileExtensions Property

ContentImporterAttribute.FileExtensions Property

Gets the supported file name extensions of the importer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IEnumerable<string> FileExtensions { get; }

Property Value

An enumerated list of supported file name extensions. Extensions are prefixed by '.' .

Expand image See Also

Reference

ContentImporterAttribute Class
ContentImporterAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterContext Class

ContentImporterContext Class
See Also Members
CollapseAll image

Provides properties that define logging behavior for the importer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class ContentImporterContext

Expand image See Also

Reference

ContentImporterContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterContext Members

ContentImporterContext Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the ContentImporterContext type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentImporterContext | Initializes a new instance of ContentImporterContext.

Expand image Public Properties

 | Name | Description
Public Property | IntermediateDirectory | The absolute path to the root of the build intermediate (object) directory.
Public Property | Logger | Gets the logger for an importer.
Public Property | OutputDirectory | The absolute path to the root of the build output (binaries) directory.

Expand image Public Methods

 | Name | Description
Public Method | AddDependency | Adds a dependency to the specified file.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentImporterContext Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentImporterContext Constructor

ContentImporterContext Constructor

Initializes a new instance of ContentImporterContext.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentImporterContext ()

Expand image See Also

Reference

ContentImporterContext Class
ContentImporterContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterContext Methods

ContentImporterContext Methods

Expand image Public Methods

 | Name | Description
Public Method | AddDependency | Adds a dependency to the specified file.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentImporterContext Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentImporterContext.AddDependency Method

ContentImporterContext.AddDependency Method

Adds a dependency to the specified file. This causes a rebuild of the file, when modified, on subsequent incremental builds.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract void AddDependency (
         string filename
)

Parameters

filename
Name of an asset file.

Expand image Remarks

Do not call this method for the main file passed to the Import method. It is only required for additional files needing to be read by the importer.

Expand image See Also

Reference

ContentImporterContext Class
ContentImporterContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterContext Properties

ContentImporterContext Properties

Expand image Public Properties

 | Name | Description
Public Property | IntermediateDirectory | The absolute path to the root of the build intermediate (object) directory.
Public Property | Logger | Gets the logger for an importer.
Public Property | OutputDirectory | The absolute path to the root of the build output (binaries) directory.

Expand image See Also

Reference

ContentImporterContext Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentImporterContext.IntermediateDirectory Property

ContentImporterContext.IntermediateDirectory Property

The absolute path to the root of the build intermediate (object) directory.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract string IntermediateDirectory { get; }

Property Value

The directory for storing temporary build files.

Expand image See Also

Reference

ContentImporterContext Class
ContentImporterContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterContext.Logger Property

ContentImporterContext.Logger Property

Gets the logger for an importer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract ContentBuildLogger Logger { get; }

Property Value

Logger that contains information on warnings and debug messages generated during importation.

Expand image See Also

Reference

ContentImporterContext Class
ContentImporterContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentImporterContext.OutputDirectory Property

ContentImporterContext.OutputDirectory Property

The absolute path to the root of the build output (binaries) directory.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract string OutputDirectory { get; }

Property Value

The output directory for the final build results.

Expand image See Also

Reference

ContentImporterContext Class
ContentImporterContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentItem Class

ContentItem Class
See Also Members
CollapseAll image

Provides properties that define various aspects of content stored using the intermediate file format of the XNA Framework.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class ContentItem

Expand image See Also

Reference

ContentItem Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentItem Members

ContentItem Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the ContentItem type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentItem | Initializes a new instance of ContentItem.

Expand image Public Properties

 | Name | Description
Public Property | Identity | Gets or sets the identity of the content item.
Public Property | Name | Gets or sets the name of the content item.
Public Property | OpaqueData | Gets the opaque data of the content item.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentItem Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentItem Constructor

ContentItem Constructor

Initializes a new instance of ContentItem.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentItem ()

Expand image See Also

Reference

ContentItem Class
ContentItem Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentItem Methods

ContentItem Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentItem Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentItem Properties

ContentItem Properties

Expand image Public Properties

 | Name | Description
Public Property | Identity | Gets or sets the identity of the content item.
Public Property | Name | Gets or sets the name of the content item.
Public Property | OpaqueData | Gets the opaque data of the content item.

Expand image See Also

Reference

ContentItem Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentItem.Identity Property

ContentItem.Identity Property

Gets or sets the identity of the content item.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentIdentity Identity { get; set; }

Property Value

The identity of the content item.

Expand image See Also

Reference

ContentItem Class
ContentItem Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentItem.Name Property

ContentItem.Name Property

Gets or sets the name of the content item.

This name is case-sensitive.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string Name { get; set; }

Property Value

The name of the content item.

Expand image See Also

Reference

ContentItem Class
ContentItem Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentItem.OpaqueData Property

ContentItem.OpaqueData Property

Gets the opaque data of the content item.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public OpaqueDataDictionary OpaqueData { get; }

Property Value

The opaque data of the content item, stored as a set of key/value pairs.

Expand image See Also

Reference

ContentItem Class
ContentItem Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessor Generic Class

ContentProcessor Generic Class
See Also Members
CollapseAll image

Provides a base class to use when developing custom processor components. All processors must derive from this class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class ContentProcessor<TInput,TOutput> : IContentProcessor

Expand image See Also

Reference

ContentProcessor Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessor Members

ContentProcessor Members
See Also Constructors Methods Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the ContentProcessor type.

Expand image Protected Constructors

 | Name | Description
Protected Method | ContentProcessor | Initializes a new instance of the ContentProcessor class.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes the specified input data and returns the result.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.InputType | Gets the expected object type of the input parameter to IContentProcessor.Process.
Explicit Interface Implementation | Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.OutputType | Gets the object type returned by IContentProcessor.Process.
Explicit Interface Implementation | Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process | Processes the specified input data and returns the result.

Expand image See Also

Reference

ContentProcessor Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessor Constructor

ContentProcessor Constructor

Initializes a new instance of the ContentProcessor class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ContentProcessor ()

Expand image See Also

Reference

ContentProcessor Generic Class
ContentProcessor Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessor Methods

ContentProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes the specified input data and returns the result.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.InputType | Gets the expected object type of the input parameter to IContentProcessor.Process.
Explicit Interface Implementation | Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.OutputType | Gets the object type returned by IContentProcessor.Process.
Explicit Interface Implementation | Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process | Processes the specified input data and returns the result.

Expand image See Also

Reference

ContentProcessor Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process Method

Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process Method
See Also
CollapseAll image

Processes the specified input data and returns the result.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private Object Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process (
         Object input,
         ContentProcessorContext context
)

Parameters

input
Existing content object being processed.
context
Contains any required custom process parameters.

Return Value

The processed input.

Expand image See Also

Reference

ContentProcessor Generic Class
ContentProcessor Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessor.Process Method

ContentProcessor.Process Method

Processes the specified input data and returns the result.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract TOutput Process (
         TInput input,
         ContentProcessorContext context
)

Parameters

input
Existing content object being processed.
context
Contains any required custom process parameters.

Return Value

A typed object representing the processed input.

Expand image See Also

Reference

ContentProcessor Generic Class
ContentProcessor Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessor Properties

ContentProcessor Properties

Expand image See Also

Reference

ContentProcessor Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessor.Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.InputType Property

ContentProcessor.Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.InputType Property
See Also
CollapseAll image

Gets the expected object type of the input parameter to IContentProcessor.Process.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private Type Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.InputType { get; }

Property Value

Object type of the input parameter.

Expand image See Also

Reference

ContentProcessor Generic Class
ContentProcessor Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessor.Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.OutputType Property

ContentProcessor.Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.OutputType Property
See Also
CollapseAll image

Gets the object type returned by IContentProcessor.Process.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private Type Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.OutputType { get; }

Property Value

Type of object returned by the processor.

Expand image See Also

Reference

ContentProcessor Generic Class
ContentProcessor Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorAttribute Class

ContentProcessorAttribute Class
See Also Members
CollapseAll image

Gets any existing content processor components.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class ContentProcessorAttribute : Attribute

Expand image Remarks

If you are developing a custom processor, it must use this attribute. The processor must also extend the ContentProcessor class.

Expand image See Also

Reference

ContentProcessorAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorAttribute Members

ContentProcessorAttribute Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the ContentProcessorAttribute type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentProcessorAttribute | Initializes an instance of ContentProcessorAttribute.

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | Gets or sets the string representing the processor in a user interface.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentProcessorAttribute Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessorAttribute Constructor

ContentProcessorAttribute Constructor

Initializes an instance of ContentProcessorAttribute.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentProcessorAttribute ()

Expand image See Also

Reference

ContentProcessorAttribute Class
ContentProcessorAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorAttribute Methods

ContentProcessorAttribute Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentProcessorAttribute Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessorAttribute Properties

ContentProcessorAttribute Properties

Expand image Public Properties

 | Name | Description
Public Property | DisplayName | Gets or sets the string representing the processor in a user interface.

Expand image See Also

Reference

ContentProcessorAttribute Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessorAttribute.DisplayName Property

ContentProcessorAttribute.DisplayName Property

Gets or sets the string representing the processor in a user interface. This name is not used by the content pipeline and should not be passed to the BuildAssets task (a custom MSBuild task used by XNA Game Studio). It is used for display purposes only.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual string DisplayName { get; set; }

Property Value

Name displayed in the user interface.

Expand image See Also

Reference

ContentProcessorAttribute Class
ContentProcessorAttribute Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext Class

ContentProcessorContext Class
See Also Members
CollapseAll image

Provides access to custom processor parameters, methods for converting member data, and triggering nested builds.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class ContentProcessorContext

Expand image Remarks

The context object, passed into a content processor, indicates any custom parameters or requests. For instance, a mesh processor could use this to force any textures used by the processor to be built when the mesh object is built.

Expand image See Also

Reference

ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext Members

ContentProcessorContext Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the ContentProcessorContext type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentProcessorContext | Initializes a new instance of ContentProcessorContext.

Expand image Public Properties

 | Name | Description
Public Property | BuildConfiguration | Gets the name of the current content build configuration.
Public Property | IntermediateDirectory | Gets the path of the directory that will contain any intermediate files generated by the content processor.
Public Property | Logger | Gets the logger interface used for status messages or warnings.
Public Property | OutputDirectory | Gets the output path of the content processor.
Public Property | OutputFilename | Gets the output file name of the content processor.
Public Property | Parameters | Gets the collection of parameters used by the content processor.
Public Property | TargetPlatform | Gets the current content build target platform.
Public Property | TargetProfile | Gets the current content build target profile.

Expand image Public Methods

 | Name | Description
Public Method | AddDependency | Adds a dependency to the specified file.
Public Method | AddOutputFile | Add a file name to the list of related output files maintained by the build item.
Public Method | BuildAndLoadAsset | Overloaded. Initiates a nested build of the specified asset and then loads the result into memory.
Public Method | BuildAsset | Overloaded. Initiates a nested build of an asset.
Public Method | Convert | Overloaded. Converts a content item object using the specified content processor.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentProcessorContext Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessorContext Constructor

ContentProcessorContext Constructor

Initializes a new instance of ContentProcessorContext.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentProcessorContext ()

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext Methods

ContentProcessorContext Methods

Expand image Public Methods

 | Name | Description
Public Method | AddDependency | Adds a dependency to the specified file.
Public Method | AddOutputFile | Add a file name to the list of related output files maintained by the build item.
Public Method | BuildAndLoadAsset | Overloaded. Initiates a nested build of the specified asset and then loads the result into memory.
Public Method | BuildAsset | Overloaded. Initiates a nested build of an asset.
Public Method | Convert | Overloaded. Converts a content item object using the specified content processor.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentProcessorContext Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessorContext.AddDependency Method

ContentProcessorContext.AddDependency Method

Adds a dependency to the specified file. This causes a rebuild of the file, when modified, on subsequent incremental builds.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract void AddDependency (
         string filename
)

Parameters

filename
Name of an asset file.

Expand image Remarks

Do not call this method for data that has already been loaded by an importer or passed to the BuildAndLoadAsset method. It is only required for additional files needing to be read by the processor.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.AddOutputFile Method

ContentProcessorContext.AddOutputFile Method

Add a file name to the list of related output files maintained by the build item. This allows tracking build items that build multiple output files.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract void AddOutputFile (
         string filename
)

Parameters

filename
The name of the file.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.BuildAndLoadAsset Method

ContentProcessorContext.BuildAndLoadAsset Method

Initiates a nested build of the specified asset and then loads the result into memory.

Expand image Overload List

Name | Description
ContentProcessorContext.BuildAndLoadAsset (Generic ExternalReference, String) | Initiates a nested build of the specified asset and then loads the result into memory.
ContentProcessorContext.BuildAndLoadAsset (Generic ExternalReference, String, OpaqueDataDictionary, String) | Initiates a nested build of the specified asset and then loads the result into memory.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessorContext.BuildAndLoadAsset Generic Method (Generic ExternalReference, String)

ContentProcessorContext.BuildAndLoadAsset Generic Method (Generic ExternalReference, String)
See Also
CollapseAll image

Initiates a nested build of the specified asset and then loads the result into memory.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TOutput BuildAndLoadAsset<TInput,TOutput> (
         ExternalReference<TInput> sourceAsset,
         string processorName
)

Type Parameters

TInput
Type of the input.
TOutput
Type of the converted output.

Parameters

sourceAsset
Reference to the source asset.
processorName
Optional processor for this content.

Return Value

Copy of the final converted content.

Expand image Remarks

An example of usage would be a mesh processor calling BuildAndLoadAsset to build any associated textures and replace the original .tga file references with an embedded copy of the converted texture.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.BuildAndLoadAsset Generic Method (Generic ExternalReference, String, OpaqueDataDictionary, String)

ContentProcessorContext.BuildAndLoadAsset Generic Method (Generic ExternalReference, String, OpaqueDataDictionary, String)
See Also
CollapseAll image

Initiates a nested build of the specified asset and then loads the result into memory.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract TOutput BuildAndLoadAsset<TInput,TOutput> (
         ExternalReference<TInput> sourceAsset,
         string processorName,
         OpaqueDataDictionary processorParameters,
         string importerName
)

Type Parameters

TInput
Type of the input.
TOutput
Type of the converted output.

Parameters

sourceAsset
Reference to the source asset.
processorName
Optional processor for this content.
processorParameters
Optional collection of named values available as input to the content processor.
importerName
Optional importer for this content.

Return Value

Copy of the final converted content.

Expand image Remarks

An example of usage would be a mesh processor calling BuildAndLoadAsset to build any associated textures and replace the original .tga file references with an embedded copy of the converted texture.

Expand image See Also

Conceptual

Parameterized Processors

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.BuildAsset Method

ContentProcessorContext.BuildAsset Method

Initiates a nested build of an asset.

Expand image Overload List

Name | Description
ContentProcessorContext.BuildAsset (Generic ExternalReference, String) | Initiates a nested build of an additional asset.
ContentProcessorContext.BuildAsset (Generic ExternalReference, String, OpaqueDataDictionary, String, String) | Initiates a nested build of an additional asset.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessorContext.BuildAsset Generic Method (Generic ExternalReference, String)

ContentProcessorContext.BuildAsset Generic Method (Generic ExternalReference, String)
See Also
CollapseAll image

Initiates a nested build of an additional asset.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference<TOutput> BuildAsset<TInput,TOutput> (
         ExternalReference<TInput> sourceAsset,
         string processorName
)

Type Parameters

TInput
Type of the input.
TOutput
Type of the output.

Parameters

sourceAsset
Reference to the source asset.
processorName
Optional processor for this content.

Return Value

Reference to the final compiled content. The build work is not required to complete before returning. Therefore, this file may not be up to date when BuildAsset returns but it will be available for loading by the game at runtime.

Expand image Remarks

An example of usage for BuildAsset is being called by a mesh processor to request that any related textures used are also built, replacing the original TGA file references with new references to the converted texture files.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.BuildAsset Generic Method (Generic ExternalReference, String, OpaqueDataDictionary, String, String)

ContentProcessorContext.BuildAsset Generic Method (Generic ExternalReference, String, OpaqueDataDictionary, String, String)
See Also
CollapseAll image

Initiates a nested build of an additional asset.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract ExternalReference<TOutput> BuildAsset<TInput,TOutput> (
         ExternalReference<TInput> sourceAsset,
         string processorName,
         OpaqueDataDictionary processorParameters,
         string importerName,
         string assetName
)

Type Parameters

TInput
Type of the input.
TOutput
Type of the output.

Parameters

sourceAsset
Reference to the source asset.
processorName
Optional processor for this content.
processorParameters
Optional collection of named values available as input to the content processor.
importerName
Optional importer for this content.
assetName
Optional name of the final compiled content.

Return Value

Reference to the final compiled content. The build work is not required to complete before returning. Therefore, this file may not be up to date when BuildAsset returns but it will be available for loading by the game at runtime.

Expand image Remarks

An example of usage for BuildAsset is being called by a mesh processor to request that any related textures used are also built, replacing the original TGA file references with new references to the converted texture files.

Expand image See Also

Conceptual

Parameterized Processors

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.Convert Method

ContentProcessorContext.Convert Method

Converts a content item object using the specified content processor.

Expand image Overload List

Name | Description
ContentProcessorContext.Convert (TInput, String) | Converts a content item object using the specified content processor.
ContentProcessorContext.Convert (TInput, String, OpaqueDataDictionary) | Converts a content item object using the specified content processor.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessorContext.Convert Generic Method (TInput, String)

ContentProcessorContext.Convert Generic Method (TInput, String)
See Also
CollapseAll image

Converts a content item object using the specified content processor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TOutput Convert<TInput,TOutput> (
         TInput input,
         string processorName
)

Type Parameters

TInput
Type of the input content.
TOutput
Type of the converted output.

Parameters

input
Source content to be converted.
processorName
Optional processor for this content.

Return Value

Reference of the final converted content.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.Convert Generic Method (TInput, String, OpaqueDataDictionary)

ContentProcessorContext.Convert Generic Method (TInput, String, OpaqueDataDictionary)
See Also
CollapseAll image

Converts a content item object using the specified content processor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract TOutput Convert<TInput,TOutput> (
         TInput input,
         string processorName,
         OpaqueDataDictionary processorParameters
)

Type Parameters

TInput
Type of the input content.
TOutput
Type of the converted output.

Parameters

input
Source content to be converted.
processorName
Optional processor for this content.
processorParameters
Optional paramters for the processor.

Return Value

Reference of the final converted content.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext Properties

ContentProcessorContext Properties

Expand image Public Properties

 | Name | Description
Public Property | BuildConfiguration | Gets the name of the current content build configuration.
Public Property | IntermediateDirectory | Gets the path of the directory that will contain any intermediate files generated by the content processor.
Public Property | Logger | Gets the logger interface used for status messages or warnings.
Public Property | OutputDirectory | Gets the output path of the content processor.
Public Property | OutputFilename | Gets the output file name of the content processor.
Public Property | Parameters | Gets the collection of parameters used by the content processor.
Public Property | TargetPlatform | Gets the current content build target platform.
Public Property | TargetProfile | Gets the current content build target profile.

Expand image See Also

Reference

ContentProcessorContext Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ContentProcessorContext.BuildConfiguration Property

ContentProcessorContext.BuildConfiguration Property

Gets the name of the current content build configuration.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract string BuildConfiguration { get; }

Property Value

Name of the build configuration.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.IntermediateDirectory Property

ContentProcessorContext.IntermediateDirectory Property

Gets the path of the directory that will contain any intermediate files generated by the content processor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract string IntermediateDirectory { get; }

Property Value

The path of the directory that will contain any intermediate files that the content processor will produce.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.Logger Property

ContentProcessorContext.Logger Property

Gets the logger interface used for status messages or warnings.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract ContentBuildLogger Logger { get; }

Property Value

Logger interface used by the processor.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.OutputDirectory Property

ContentProcessorContext.OutputDirectory Property

Gets the output path of the content processor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract string OutputDirectory { get; }

Property Value

The directory path of the output file that the content processor will produce.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.OutputFilename Property

ContentProcessorContext.OutputFilename Property

Gets the output file name of the content processor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract string OutputFilename { get; }

Property Value

The name of the output file that the content processor will produce.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.Parameters Property

ContentProcessorContext.Parameters Property

Gets the collection of parameters used by the content processor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract OpaqueDataDictionary Parameters { get; }

Property Value

Collection of content processor parameters.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.TargetPlatform Property

ContentProcessorContext.TargetPlatform Property

Gets the current content build target platform.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract TargetPlatform TargetPlatform { get; }

Property Value

Name of the target platform for the current content build.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentProcessorContext.TargetProfile Property

ContentProcessorContext.TargetProfile Property

Gets the current content build target profile.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract GraphicsProfile TargetProfile { get; }

Property Value

The enumeration that identifies the graphics profile of the device.

Expand image See Also

Reference

ContentProcessorContext Class
ContentProcessorContext Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectImporter Class

EffectImporter Class
See Also Members
CollapseAll image

Provides methods for reading effect (.fx) files for use in the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class EffectImporter : ContentImporter<EffectContent>

Expand image See Also

Reference

EffectImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectImporter Members

EffectImporter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the EffectImporter type.

Expand image Public Constructors

 | Name | Description
Public Method | EffectImporter | Initializes a new instance of EffectImporter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing an .fx file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


EffectImporter Constructor

EffectImporter Constructor

Initializes a new instance of EffectImporter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public EffectImporter ()

Expand image See Also

Reference

EffectImporter Class
EffectImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectImporter Methods

EffectImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing an .fx file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


EffectImporter.Import Method

EffectImporter.Import Method

Called by the XNA Framework when importing an .fx file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override EffectContent Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

EffectImporter Class
EffectImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ExternalReference Generic Class

ExternalReference Generic Class
See Also Members
CollapseAll image

Specifies external references to a data file for the content item.

While the object model is instantiated, reference file names are absolute. When the file containing the external reference is serialized to disk, file names are relative to the file. This allows movement of the content tree to a different location without breaking internal links.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class ExternalReference<T> : ContentItem

Expand image See Also

Reference

ExternalReference Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ExternalReference Members

ExternalReference Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the ExternalReference type.

Expand image Public Constructors

 | Name | Description
Public Method | ExternalReference | Overloaded. Initializes a new instance of ExternalReference.

Expand image Public Properties

 | Name | Description
Public Property | Filename | Gets and sets the file name of an ExternalReference.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ExternalReference Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ExternalReference Constructor

ExternalReference Constructor

Initializes a new instance of ExternalReference.

Expand image Overload List

Name | Description
ExternalReference () | Initializes a new instance of ExternalReference.
ExternalReference (String) | Initializes a new instance of ExternalReference.
ExternalReference (String, ContentIdentity) | Initializes a new instance of ExternalReference, specifying the file path relative to another content item.

Expand image See Also

Reference

ExternalReference Generic Class
ExternalReference Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


ExternalReference Constructor ()

ExternalReference Constructor ()
See Also
CollapseAll image

Initializes a new instance of ExternalReference.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference ()

Expand image See Also

Reference

ExternalReference Generic Class
ExternalReference Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ExternalReference Constructor (String)

ExternalReference Constructor (String)
See Also
CollapseAll image

Initializes a new instance of ExternalReference.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference (
         string filename
)

Parameters

filename
The name of the referenced file.

Expand image See Also

Reference

ExternalReference Generic Class
ExternalReference Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ExternalReference Constructor (String, ContentIdentity)

ExternalReference Constructor (String, ContentIdentity)
See Also
CollapseAll image

Initializes a new instance of ExternalReference, specifying the file path relative to another content item.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference (
         string filename,
         ContentIdentity relativeToContent
)

Parameters

filename
The name of the referenced file.
relativeToContent
The content that the path specified in filename is relative to.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | filename, relativeToContent, or the SourceFilename property of relativeToContent is null.

Expand image Remarks

This method constructs a reference to the specified file. If the file name contains a relative path, it is made absolute based on the SourceFilename property of relativeToContent. This can be useful in a custom content processor for constructing references to texture or effect files relative to the Identity property of the mesh being processed.

Expand image See Also

Reference

ExternalReference Generic Class
ExternalReference Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ExternalReference Methods

ExternalReference Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ExternalReference Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ExternalReference Properties

ExternalReference Properties

Expand image Public Properties

 | Name | Description
Public Property | Filename | Gets and sets the file name of an ExternalReference.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image See Also

Reference

ExternalReference Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ExternalReference.Filename Property

ExternalReference.Filename Property

Gets and sets the file name of an ExternalReference.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string Filename { get; set; }

Property Value

The absolute file name of the external data reference.

Expand image See Also

Reference

ExternalReference Generic Class
ExternalReference Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FbxImporter Class

FbxImporter Class
See Also Members
CollapseAll image

Provides methods for reading AutoDesk (.fbx) files for use in the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class FbxImporter : ContentImporter<NodeContent>

Expand image See Also

Reference

FbxImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FbxImporter Members

FbxImporter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the FbxImporter type.

Expand image Public Constructors

 | Name | Description
Public Method | FbxImporter | Initializes a new instance of FbxImporter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing an .fbx file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FbxImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


FbxImporter Constructor

FbxImporter Constructor

Initializes a new instance of FbxImporter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public FbxImporter ()

Expand image See Also

Reference

FbxImporter Class
FbxImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FbxImporter Methods

FbxImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing an .fbx file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FbxImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


FbxImporter.Import Method

FbxImporter.Import Method

Called by the XNA Framework when importing an .fbx file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[SecurityPermissionAttribute(Demand, UnmanagedCode)]
public override NodeContent Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

FbxImporter Class
FbxImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescriptionImporter Class

FontDescriptionImporter Class
See Also Members
CollapseAll image

Provides methods for reading .spritefont files for use in the Content Pipeline.
Note
As with most types of software, font files are licensed rather than sold. Font licenses vary from vendor to vendor, but most don't allow redistribution of the fonts, and that includes redistribution of reproductions such as bitmaps containing the rasterized character set. This is even true of many of the licenses covering fonts that Microsoft supplies with applications and Windows. Be careful, therefore, to ensure that you have the required license rights to redistribute any font you include as a bitmap containing the rasterized character set in your game!

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentImporterAttribute(".spritefont")]
public class FontDescriptionImporter : ContentImporter<FontDescription>

Expand image See Also

Reference

FontDescriptionImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescriptionImporter Members

FontDescriptionImporter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the FontDescriptionImporter type.

Expand image Public Constructors

 | Name | Description
Public Method | FontDescriptionImporter | Initializes a new instance of FontDescriptionImporter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing a .spritefont file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FontDescriptionImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


FontDescriptionImporter Constructor

FontDescriptionImporter Constructor

Initializes a new instance of FontDescriptionImporter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public FontDescriptionImporter ()

Expand image See Also

Reference

FontDescriptionImporter Class
FontDescriptionImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescriptionImporter Methods

FontDescriptionImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing a .spritefont file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FontDescriptionImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


FontDescriptionImporter.Import Method

FontDescriptionImporter.Import Method

Called by the XNA Framework when importing a .spritefont file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override FontDescription Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | filename is null.
SecurityException | Sufficient permissions are not available to access filename.
FileNotFoundException | The file identified by the filename does not exist.
UriFormatException | The format of filename is not correct.
InvalidContentException | The XML in filename is either badly formed or does not represent a FontDescription object.

Expand image See Also

Reference

FontDescriptionImporter Class
FontDescriptionImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IContentImporter Interface

IContentImporter Interface

Accesses a statically typed ContentImporter instance from generic code using dynamic typing.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public interface IContentImporter

Expand image See Also

Reference

IContentImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IContentImporter Members

IContentImporter Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the IContentImporter type.

Expand image Public Methods

 | Name | Description
Public Method | Import | Imports an asset from the specified file.

Expand image See Also

Reference

IContentImporter Interface
Microsoft.Xna.Framework.Content.Pipeline Namespace


IContentImporter Methods

IContentImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Import | Imports an asset from the specified file.

Expand image See Also

Reference

IContentImporter Interface
Microsoft.Xna.Framework.Content.Pipeline Namespace


IContentImporter.Import Method

IContentImporter.Import Method

Imports an asset from the specified file.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Object Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of the game asset file.
context
A ContentImporterContext class containing information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

IContentImporter Interface
IContentImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IContentProcessor Interface

IContentProcessor Interface

Provides methods and properties for accessing a statically typed ContentProcessor subclass, using dynamically typed object data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public interface IContentProcessor

Expand image See Also

Reference

IContentProcessor Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IContentProcessor Members

IContentProcessor Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the IContentProcessor type.

Expand image Public Properties

 | Name | Description
Public Property | InputType | Gets the expected object type of the input parameter to IContentProcessor.Process.
Public Property | OutputType | Gets the object type returned by IContentProcessor.Process.

Expand image Public Methods

 | Name | Description
Public Method | Process | Processes the specified input data and returns the result.

Expand image See Also

Reference

IContentProcessor Interface
Microsoft.Xna.Framework.Content.Pipeline Namespace


IContentProcessor Methods

IContentProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Process | Processes the specified input data and returns the result.

Expand image See Also

Reference

IContentProcessor Interface
Microsoft.Xna.Framework.Content.Pipeline Namespace


IContentProcessor.Process Method

IContentProcessor.Process Method

Processes the specified input data and returns the result.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Object Process (
         Object input,
         ContentProcessorContext context
)

Parameters

input
Existing content object being processed.
context
Contains any required custom process parameters.

Return Value

An object representing the processed input.

Expand image See Also

Reference

IContentProcessor Interface
IContentProcessor Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IContentProcessor Properties

IContentProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | InputType | Gets the expected object type of the input parameter to IContentProcessor.Process.
Public Property | OutputType | Gets the object type returned by IContentProcessor.Process.

Expand image See Also

Reference

IContentProcessor Interface
Microsoft.Xna.Framework.Content.Pipeline Namespace


IContentProcessor.InputType Property

IContentProcessor.InputType Property

Gets the expected object type of the input parameter to IContentProcessor.Process.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Type InputType { get; }

Property Value

Object type of the input parameter.

Expand image See Also

Reference

IContentProcessor Interface
IContentProcessor Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IContentProcessor.OutputType Property

IContentProcessor.OutputType Property

Gets the object type returned by IContentProcessor.Process.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Type OutputType { get; }

Property Value

Type of object returned by the processor.

Expand image See Also

Reference

IContentProcessor Interface
IContentProcessor Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


InvalidContentException Class

InvalidContentException Class
See Also Members
CollapseAll image

Thrown when errors are encountered in content during processing.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[SerializableAttribute]
public class InvalidContentException : Exception

Expand image Remarks

InvalidContentException is an exception that any importer or content processor can throw to indicate a problem with the current content file. Exceptions of this type are presented differently from all other exceptions the pipeline throws. Exceptions of this type indicate a problem in the content. Other exceptions the content pipeline throws indicate a problem with the pipeline code itself. The InvalidContentException class has properties that identify the content file with the problem, if available.

Expand image See Also

Reference

InvalidContentException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


InvalidContentException Members

InvalidContentException Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the InvalidContentException type.

Expand image Public Constructors

 | Name | Description
Public Method | InvalidContentException | Overloaded. Creates an instance of InvalidContentException.

Expand image Public Properties

 | Name | Description
Public Property | ContentIdentity | Gets or sets the identity of the content item that caused the exception.
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetObjectData | When overridden in a derived class, returns information about the exception.
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

InvalidContentException Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


InvalidContentException Constructor

InvalidContentException Constructor

Creates an instance of InvalidContentException.

Expand image Overload List

Name | Description
InvalidContentException () | Initializes a new instance of the InvalidContentException class
InvalidContentException (SerializationInfo, StreamingContext) | Initializes a new instance of the InvalidContentException class with information on serialization and streaming context for the related content item.
InvalidContentException (String) | Initializes a new instance of the InvalidContentException class with the specified error message.
InvalidContentException (String, ContentIdentity) | Initializes a new instance of the InvalidContentException class with the specified error message and the identity of the content throwing the exception.
InvalidContentException (String, ContentIdentity, Exception) | Initializes a new instance of the InvalidContentException class with the specified error message, the identity of the content throwing the exception, and a reference to the inner exception that is the cause of this exception.
InvalidContentException (String, Exception) | Initializes a new instance of the InvalidContentException class with the specified error message and a reference to the inner exception that is the cause of this exception.

Expand image See Also

Reference

InvalidContentException Class
InvalidContentException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


InvalidContentException Constructor ()

InvalidContentException Constructor ()
See Also
CollapseAll image

Initializes a new instance of the InvalidContentException class

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public InvalidContentException ()

Expand image See Also

Reference

InvalidContentException Class
InvalidContentException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


InvalidContentException Constructor (SerializationInfo, StreamingContext)

InvalidContentException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Initializes a new instance of the InvalidContentException class with information on serialization and streaming context for the related content item.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected InvalidContentException (
         SerializationInfo serializationInfo,
         StreamingContext streamingContext
)

Parameters

serializationInfo
Information necessary for serialization and deserialization of the content item.
streamingContext
Information necessary for the source and destination of a given serialized stream. Also provides an additional caller-defined context.

Expand image See Also

Reference

InvalidContentException Class
InvalidContentException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


InvalidContentException Constructor (String)

InvalidContentException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of the InvalidContentException class with the specified error message.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public InvalidContentException (
         string message
)

Parameters

message
A message that describes the error.

Expand image See Also

Reference

InvalidContentException Class
InvalidContentException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


InvalidContentException Constructor (String, ContentIdentity)

InvalidContentException Constructor (String, ContentIdentity)
See Also
CollapseAll image

Initializes a new instance of the InvalidContentException class with the specified error message and the identity of the content throwing the exception.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public InvalidContentException (
         string message,
         ContentIdentity contentIdentity
)

Parameters

message
A message that describes the error.
contentIdentity
Information about the content item that caused this error, including the file name. In some cases, a location within the file (of the problem) is specified.

Expand image See Also

Reference

InvalidContentException Class
InvalidContentException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


InvalidContentException Constructor (String, ContentIdentity, Exception)

InvalidContentException Constructor (String, ContentIdentity, Exception)
See Also
CollapseAll image

Initializes a new instance of the InvalidContentException class with the specified error message, the identity of the content throwing the exception, and a reference to the inner exception that is the cause of this exception.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public InvalidContentException (
         string message,
         ContentIdentity contentIdentity,
         Exception innerException
)

Parameters

message
A message that describes the error.
contentIdentity
Information about the content item that caused this error, including the file name. In some cases, a location within the file (of the problem) is specified.
innerException
The exception that is the cause of the current exception. If innerException is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Expand image See Also

Reference

InvalidContentException Class
InvalidContentException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


InvalidContentException Constructor (String, Exception)

InvalidContentException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of the InvalidContentException class with the specified error message and a reference to the inner exception that is the cause of this exception.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public InvalidContentException (
         string message,
         Exception innerException
)

Parameters

message
A message that describes the error.
innerException
The exception that is the cause of the current exception. If innerException is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Expand image See Also

Reference

InvalidContentException Class
InvalidContentException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


InvalidContentException Methods

InvalidContentException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetObjectData | When overridden in a derived class, returns information about the exception.
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

InvalidContentException Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


InvalidContentException.GetObjectData Method

InvalidContentException.GetObjectData Method

When overridden in a derived class, returns information about the exception.

In addition to the base behavior, this method provides serialization functionality.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override void GetObjectData (
         SerializationInfo info,
         StreamingContext context
)

Parameters

info
Information necessary for serialization and deserialization of the content item.
context
Information necessary for the source and destination of a given serialized stream. Also provides an additional caller-defined context.

Expand image See Also

Reference

InvalidContentException Class
InvalidContentException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


InvalidContentException Properties

InvalidContentException Properties

Expand image Public Properties

 | Name | Description
Public Property | ContentIdentity | Gets or sets the identity of the content item that caused the exception.
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

InvalidContentException Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


InvalidContentException.ContentIdentity Property

InvalidContentException.ContentIdentity Property

Gets or sets the identity of the content item that caused the exception.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentIdentity ContentIdentity { get; set; }

Property Value

The identity of the bad content item.

Expand image See Also

Reference

InvalidContentException Class
InvalidContentException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Mp3Importer Class

Mp3Importer Class
See Also Members
CollapseAll image

Provides methods for reading MP3 audio files for use in the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class Mp3Importer : ContentImporter<AudioContent>

Expand image See Also

Reference

Mp3Importer Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Mp3Importer Members

Mp3Importer Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the Mp3Importer type.

Expand image Public Constructors

 | Name | Description
Public Method | Mp3Importer | Initializes a new instance of Mp3Importer.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing an MP3 audio file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Mp3Importer Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


Mp3Importer Constructor

Mp3Importer Constructor

Initializes a new instance of Mp3Importer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Mp3Importer ()

Expand image See Also

Reference

Mp3Importer Class
Mp3Importer Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Mp3Importer Methods

Mp3Importer Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing an MP3 audio file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Mp3Importer Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


Mp3Importer.Import Method

Mp3Importer.Import Method

Called by the XNA Framework when importing an MP3 audio file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override AudioContent Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

Mp3Importer Class
Mp3Importer Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary Generic Class

NamedValueDictionary Generic Class
See Also Members
CollapseAll image

Base class for dictionaries that map string identifiers to data values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class NamedValueDictionary<T> : IDictionary<string, T>, ICollection<KeyValuePair<string, T>>, IEnumerable<KeyValuePair<string, T>>, IEnumerable

Expand image See Also

Reference

NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary Members

NamedValueDictionary Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the NamedValueDictionary type.

Expand image Public Constructors

 | Name | Description
Public Method | NamedValueDictionary | Initializes an instance of NamedValueDictionary.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of items in the dictionary.
Public Property | Item | Gets or sets the specified item.
Public Property | Keys | Gets all keys contained in the dictionary.
Public Property | Values | Gets all values contained in the dictionary.

Expand image Protected Properties

 | Name | Description
Protected Property | DefaultSerializerType | Specifies the type hint for the intermediate serializer.

Expand image Public Methods

 | Name | Description
Public Method | Add | Adds the specified key and value to the dictionary.
Public Method | Clear | Removes all keys and values from the dictionary.
Public Method | ContainsKey | Determines whether the specified key is present in the dictionary.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that iterates through items in a dictionary.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Remove | Removes the specified key and value from the dictionary.
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | Gets the value associated with the specified key.

Expand image Protected Methods

 | Name | Description
Protected Method | AddItem | Adds an element to the dictionary.
Protected Method | ClearItems | Removes all elements from the dictionary.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | Removes the specified element from the dictionary.
Protected Method | SetItem | Modifies the value of an existing element.

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.IsReadOnly | Gets a value indicating if this object is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Add | Adds an item to the collection.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Contains | Determines whether the collection contains a specific value.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.CopyTo | Copies the elements of the collection to an array, starting at a specified index.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that can iterate through this collection.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Remove | Removes the first occurrence of the specified object from the collection.

Expand image See Also

Reference

NamedValueDictionary Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


NamedValueDictionary Constructor

NamedValueDictionary Constructor

Initializes an instance of NamedValueDictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public NamedValueDictionary ()

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary Methods

NamedValueDictionary Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | Adds the specified key and value to the dictionary.
Public Method | Clear | Removes all keys and values from the dictionary.
Public Method | ContainsKey | Determines whether the specified key is present in the dictionary.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator that iterates through items in a dictionary.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Remove | Removes the specified key and value from the dictionary.
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | Gets the value associated with the specified key.

Expand image Protected Methods

 | Name | Description
Protected Method | AddItem | Adds an element to the dictionary.
Protected Method | ClearItems | Removes all elements from the dictionary.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | Removes the specified element from the dictionary.
Protected Method | SetItem | Modifies the value of an existing element.

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.IsReadOnly | Gets a value indicating if this object is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Add | Adds an item to the collection.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Contains | Determines whether the collection contains a specific value.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.CopyTo | Copies the elements of the collection to an array, starting at a specified index.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that can iterate through this collection.
Explicit Interface Implementation | System.Collections.Generic.ICollection{T}.Remove | Removes the first occurrence of the specified object from the collection.

Expand image See Also

Reference

NamedValueDictionary Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


NamedValueDictionary.Add Method

NamedValueDictionary.Add Method

Adds the specified key and value to the dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Add (
         string key,
         T value
)

Parameters

key
Identity of the key of the new data pair.
value
The value of the new data pair.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.AddItem Method

NamedValueDictionary.AddItem Method

Adds an element to the dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual void AddItem (
         string key,
         T value
)

Parameters

key
Identity of the key of the new element.
value
The value of the new element.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.Clear Method

NamedValueDictionary.Clear Method

Removes all keys and values from the dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Clear ()

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.ClearItems Method

NamedValueDictionary.ClearItems Method

Removes all elements from the dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual void ClearItems ()

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.ContainsKey Method

NamedValueDictionary.ContainsKey Method

Determines whether the specified key is present in the dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool ContainsKey (
         string key
)

Parameters

key
Identity of a key.

Return Value

true if the value is present; false otherwise.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.GetEnumerator Method

NamedValueDictionary.GetEnumerator Method

Gets an enumerator that iterates through items in a dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IEnumerator<KeyValuePair<string, T>> GetEnumerator ()

Return Value

Enumerator for iterating through the dictionary.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.Remove Method

NamedValueDictionary.Remove Method

Removes the specified key and value from the dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Remove (
         string key
)

Parameters

key
Identity of the key to be removed.

Return Value

true if the value is present; false otherwise.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.RemoveItem Method

NamedValueDictionary.RemoveItem Method

Removes the specified element from the dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual bool RemoveItem (
         string key
)

Parameters

key
Identity of the key of the data pair to be removed.

Return Value

true if the value is present; false otherwise.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.SetItem Method

NamedValueDictionary.SetItem Method

Modifies the value of an existing element.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual void SetItem (
         string key,
         T value
)

Parameters

key
Identity of the element to be modified.
value
The value to be set.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection{T}.Add Method

System.Collections.Generic.ICollection{T}.Add Method

Adds an item to the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.Add (
         KeyValuePair<string, T> item
)

Parameters

item
The item to add to the collection.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection{T}.Contains Method

System.Collections.Generic.ICollection{T}.Contains Method

Determines whether the collection contains a specific value.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.Contains (
         KeyValuePair<string, T> item
)

Parameters

item
The object to locate in the collection.

Return Value

true if the collection contains the object; false otherwise.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection{T}.CopyTo Method

System.Collections.Generic.ICollection{T}.CopyTo Method

Copies the elements of the collection to an array, starting at a specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection{T}.CopyTo (
         KeyValuePair<string, T>[] array,
         int arrayIndex
)

Parameters

array
The index at which to begin the copy.
arrayIndex
The destination array.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection{T}.Remove Method

System.Collections.Generic.ICollection{T}.Remove Method

Removes the first occurrence of the specified object from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.Remove (
         KeyValuePair<string, T> item
)

Parameters

item
The item to remove from the collection.

Return Value

true if the item was successfully removed from the collection; false otherwise.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that can iterate through this collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

An enumerator that can iterate through this collection

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.TryGetValue Method

NamedValueDictionary.TryGetValue Method

Gets the value associated with the specified key.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool TryGetValue (
         string key,
         out T value
)

Parameters

key
Identity of the key of the element whose value is to be retrieved.
value
[OutAttribute] The current value of the element.

Return Value

true if the value is present; false otherwise.

Expand image Remarks

If the key was not found, value gets the appropriate default value for the type T. For example, 0 (zero) for integer types, false for Boolean types, and a null reference for reference types.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary Properties

NamedValueDictionary Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of items in the dictionary.
Public Property | Item | Gets or sets the specified item.
Public Property | Keys | Gets all keys contained in the dictionary.
Public Property | Values | Gets all values contained in the dictionary.

Expand image Protected Properties

 | Name | Description
Protected Property | DefaultSerializerType | Specifies the type hint for the intermediate serializer.

Expand image See Also

Reference

NamedValueDictionary Generic Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


NamedValueDictionary.Count Property

NamedValueDictionary.Count Property

Gets the number of items in the dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of items.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.DefaultSerializerType Property

NamedValueDictionary.DefaultSerializerType Property

Specifies the type hint for the intermediate serializer. Values of this type do not store an explicit type attribute in the related XML source.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal virtual Type DefaultSerializerType { get; }

Property Value

The type used by the serializer.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.Item Property

NamedValueDictionary.Item Property

Gets or sets the specified item.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T this [
         string key
] { get; set; }

Property Value

Identity of a key.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.Keys Property

NamedValueDictionary.Keys Property

Gets all keys contained in the dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ICollection<string> Keys { get; }

Property Value

Collection of keys for the dictionary.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.System.Collections.Generic.ICollection{T}.IsReadOnly Property

NamedValueDictionary.System.Collections.Generic.ICollection{T}.IsReadOnly Property
See Also
CollapseAll image

Gets a value indicating if this object is read-only.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection{T}.IsReadOnly { get; }

Property Value

true if the object is read-only; false otherwise.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NamedValueDictionary.Values Property

NamedValueDictionary.Values Property

Gets all values contained in the dictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ICollection<T> Values { get; }

Property Value

Collection of values for the dictionary.

Expand image See Also

Reference

NamedValueDictionary Generic Class
NamedValueDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


OpaqueDataDictionary Class

OpaqueDataDictionary Class
See Also Members
CollapseAll image

Provides properties that define opaque data for a game asset.

Opaque data is any data that is not explicitly supported by the XNA object model. In addition, the opaque data can be of any managed data type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class OpaqueDataDictionary : NamedValueDictionary<Object>

Expand image See Also

Reference

OpaqueDataDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


OpaqueDataDictionary Members

OpaqueDataDictionary Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the OpaqueDataDictionary type.

Expand image Public Constructors

 | Name | Description
Public Method | OpaqueDataDictionary | Initializes a new instance of OpaqueDataDictionary.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from NamedValueDictionary.)
Public Property | Item | (Inherited from NamedValueDictionary.)
Public Property | Keys | (Inherited from NamedValueDictionary.)
Public Property | Values | (Inherited from NamedValueDictionary.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from NamedValueDictionary.)
 | AddItem | Overloaded. Adds an element to the dictionary.
Public Method | Clear | (Inherited from NamedValueDictionary.)
Public Method | ContainsKey | (Inherited from NamedValueDictionary.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetContentAsXml | Gets the data contents and returns it as a single XML string.
Public Method | GetEnumerator | (Inherited from NamedValueDictionary.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetValue | Gets the value of the specified key/value pair of the asset.
Public Method | Remove | (Inherited from NamedValueDictionary.)
 | SetItem | Overloaded. Modifies the value of an existing element.
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | (Inherited from NamedValueDictionary.)

Expand image Protected Methods

 | Name | Description
Protected Method | AddItem | (Inherited from NamedValueDictionary.)
Protected Method | ClearItems | (Inherited from NamedValueDictionary.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from NamedValueDictionary.)
Protected Method | SetItem | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

OpaqueDataDictionary Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


OpaqueDataDictionary Constructor

OpaqueDataDictionary Constructor

Initializes a new instance of OpaqueDataDictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public OpaqueDataDictionary ()

Expand image See Also

Reference

OpaqueDataDictionary Class
OpaqueDataDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


OpaqueDataDictionary Methods

OpaqueDataDictionary Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from NamedValueDictionary.)
 | AddItem | Overloaded. Adds an element to the dictionary.
Public Method | Clear | (Inherited from NamedValueDictionary.)
Public Method | ContainsKey | (Inherited from NamedValueDictionary.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetContentAsXml | Gets the data contents and returns it as a single XML string.
Public Method | GetEnumerator | (Inherited from NamedValueDictionary.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetValue | Gets the value of the specified key/value pair of the asset.
Public Method | Remove | (Inherited from NamedValueDictionary.)
 | SetItem | Overloaded. Modifies the value of an existing element.
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | (Inherited from NamedValueDictionary.)

Expand image Protected Methods

 | Name | Description
Protected Method | AddItem | (Inherited from NamedValueDictionary.)
Protected Method | ClearItems | (Inherited from NamedValueDictionary.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from NamedValueDictionary.)
Protected Method | SetItem | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

OpaqueDataDictionary Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


OpaqueDataDictionary.AddItem Method

OpaqueDataDictionary.AddItem Method

Adds an element to the dictionary.

Expand image Overload List

Name Description

Expand image See Also

Reference

OpaqueDataDictionary Class
OpaqueDataDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


OpaqueDataDictionary.GetContentAsXml Method

OpaqueDataDictionary.GetContentAsXml Method

Gets the data contents and returns it as a single XML string. This format is useful for doing deep equality comparison or object hashing.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string GetContentAsXml ()

Return Value

Data contents of the entry.

Expand image See Also

Reference

OpaqueDataDictionary Class
OpaqueDataDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


OpaqueDataDictionary.GetValue Generic Method

OpaqueDataDictionary.GetValue Generic Method

Gets the value of the specified key/value pair of the asset.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T GetValue<T> (
         string key,
         T defaultValue
)

Type Parameters

T

Parameters

key
The name of the key.
defaultValue
The value to return if the key cannot be found. This can be null for reference types, 0 for primitive types, and a zero-filled structure for structure types.

Return Value

The value of the retrieved opaque data.

Expand image Remarks

GetValue looks only for values of a specific type. If the entry is of a different type, the defaultvalue is returned.

Expand image See Also

Reference

OpaqueDataDictionary Class
OpaqueDataDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


OpaqueDataDictionary.SetItem Method

OpaqueDataDictionary.SetItem Method

Modifies the value of an existing element.

Expand image Overload List

Name Description

Expand image See Also

Reference

OpaqueDataDictionary Class
OpaqueDataDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


OpaqueDataDictionary Properties

OpaqueDataDictionary Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from NamedValueDictionary.)
Public Property | Item | (Inherited from NamedValueDictionary.)
Public Property | Keys | (Inherited from NamedValueDictionary.)
Public Property | Values | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

OpaqueDataDictionary Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


PipelineComponentScanner Class

PipelineComponentScanner Class
See Also Members
CollapseAll image

Implements a scanner object containing the available importers and processors for an application. Designed for internal use only.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class PipelineComponentScanner

Expand image See Also

Reference

PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner Members

PipelineComponentScanner Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the PipelineComponentScanner type.

Expand image Public Constructors

 | Name | Description
Public Method | PipelineComponentScanner | Initializes a new instance of PipelineComponentScanner.

Expand image Public Properties

 | Name | Description
Public Property | Errors | Gets the list of error messages produced by the last call to Update.
Public Property | ImporterAttributes | Gets a dictionary that maps importer names to their associated metadata attributes.
Public Property | ImporterNames | Gets the names of all available importers.
Public Property | ImporterOutputTypes | Gets a dictionary that maps importer names to the fully qualified name of their return types.
Public Property | ProcessorAttributes | Gets a dictionary that maps processor names to their associated metadata attributes.
Public Property | ProcessorInputTypes | Gets a dictionary that maps processor names to the fully qualified name of supported input types.
Public Property | ProcessorNames | Gets the names of all available importers.
Public Property | ProcessorOutputTypes | Gets a dictionary that maps processor names to the fully qualified name of their output types.
Public Property | ProcessorParameters | A collection of supported processor parameters.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Overloaded. Updates the scanner object with the latest available assembly states.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PipelineComponentScanner Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


PipelineComponentScanner Constructor

PipelineComponentScanner Constructor

Initializes a new instance of PipelineComponentScanner.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public PipelineComponentScanner ()

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner Methods

PipelineComponentScanner Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Update | Overloaded. Updates the scanner object with the latest available assembly states.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PipelineComponentScanner Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


PipelineComponentScanner.Update Method

PipelineComponentScanner.Update Method

Updates the scanner object with the latest available assembly states.

Expand image Overload List

Name | Description
PipelineComponentScanner.Update (Generic IEnumerable) | Updates the scanner object with the latest available assembly states.
PipelineComponentScanner.Update (Generic IEnumerable, Generic IEnumerable) | Updates the scanner object with the latest available assembly states.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


PipelineComponentScanner.Update Method (Generic IEnumerable)

PipelineComponentScanner.Update Method (Generic IEnumerable)
See Also
CollapseAll image

Updates the scanner object with the latest available assembly states.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Update (
         IEnumerable<string> pipelineAssemblies
)

Parameters

pipelineAssemblies
Enumerated list of available assemblies.

Return Value

true if an actual scan was required, indicating the collection contents may have changed. false if no assembly changes were detected since the previous call.

Expand image Remarks

After Update is called, the Importer* and Processor* properties contain any new information. If any errors occurred during the scan, they are stored in the Errors property.

Since Update uses assembly file time stamps, trivial reject situations (where nothing has changed) are detected. Therefore, Update can be called frequently.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner.Update Method (Generic IEnumerable, Generic IEnumerable)

PipelineComponentScanner.Update Method (Generic IEnumerable, Generic IEnumerable)
See Also
CollapseAll image

Updates the scanner object with the latest available assembly states.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Update (
         IEnumerable<string> pipelineAssemblies,
         IEnumerable<string> pipelineAssemblyDependencies
)

Parameters

pipelineAssemblies
Enumerated list of available assemblies.
pipelineAssemblyDependencies
Enumerated list of dependent assemblies.

Return Value

true if an actual scan was required, indicating the collection contents may have changed. false if no assembly changes were detected since the previous call.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner Properties

PipelineComponentScanner Properties

Expand image Public Properties

 | Name | Description
Public Property | Errors | Gets the list of error messages produced by the last call to Update.
Public Property | ImporterAttributes | Gets a dictionary that maps importer names to their associated metadata attributes.
Public Property | ImporterNames | Gets the names of all available importers.
Public Property | ImporterOutputTypes | Gets a dictionary that maps importer names to the fully qualified name of their return types.
Public Property | ProcessorAttributes | Gets a dictionary that maps processor names to their associated metadata attributes.
Public Property | ProcessorInputTypes | Gets a dictionary that maps processor names to the fully qualified name of supported input types.
Public Property | ProcessorNames | Gets the names of all available importers.
Public Property | ProcessorOutputTypes | Gets a dictionary that maps processor names to the fully qualified name of their output types.
Public Property | ProcessorParameters | A collection of supported processor parameters.

Expand image See Also

Reference

PipelineComponentScanner Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


PipelineComponentScanner.Errors Property

PipelineComponentScanner.Errors Property

Gets the list of error messages produced by the last call to Update.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IList<string> Errors { get; }

Property Value

Collection of the latest error descriptions.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner.ImporterAttributes Property

PipelineComponentScanner.ImporterAttributes Property

Gets a dictionary that maps importer names to their associated metadata attributes.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IDictionary<string, ContentImporterAttribute> ImporterAttributes { get; }

Property Value

Importer names and their related metadata values.

Expand image Remarks

Call ImporterAttributes to look up the DisplayName value for an importer object and which file extensions are supported.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner.ImporterNames Property

PipelineComponentScanner.ImporterNames Property

Gets the names of all available importers.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IEnumerable<string> ImporterNames { get; }

Property Value

List of available importer names.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner.ImporterOutputTypes Property

PipelineComponentScanner.ImporterOutputTypes Property

Gets a dictionary that maps importer names to the fully qualified name of their return types.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IDictionary<string, string> ImporterOutputTypes { get; }

Property Value

Importer names and their related return types.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner.ProcessorAttributes Property

PipelineComponentScanner.ProcessorAttributes Property

Gets a dictionary that maps processor names to their associated metadata attributes.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IDictionary<string, ContentProcessorAttribute> ProcessorAttributes { get; }

Property Value

Processor names and their related metadata values.

Expand image Remarks

Call ProcessorAttributes to look up the DisplayName value for an processor object.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner.ProcessorInputTypes Property

PipelineComponentScanner.ProcessorInputTypes Property

Gets a dictionary that maps processor names to the fully qualified name of supported input types.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IDictionary<string, string> ProcessorInputTypes { get; }

Property Value

Processor names and the input types they support.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner.ProcessorNames Property

PipelineComponentScanner.ProcessorNames Property

Gets the names of all available importers.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IEnumerable<string> ProcessorNames { get; }

Property Value

List of available processor names.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner.ProcessorOutputTypes Property

PipelineComponentScanner.ProcessorOutputTypes Property

Gets a dictionary that maps processor names to the fully qualified name of their output types.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IDictionary<string, string> ProcessorOutputTypes { get; }

Property Value

Processor names and their related output types.

Expand image See Also

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineComponentScanner.ProcessorParameters Property

PipelineComponentScanner.ProcessorParameters Property

A collection of supported processor parameters.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IDictionary<string, ProcessorParameterCollection> ProcessorParameters { get; }

Property Value

Collection of processor parameters.

Expand image See Also

Conceptual

Parameterized Processors

Reference

PipelineComponentScanner Class
PipelineComponentScanner Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineException Class

PipelineException Class
See Also Members
CollapseAll image

Thrown when errors are encountered during a content pipeline build.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[SerializableAttribute]
public class PipelineException : Exception

Expand image See Also

Reference

PipelineException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineException Members

PipelineException Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the PipelineException type.

Expand image Public Constructors

 | Name | Description
Public Method | PipelineException | Overloaded. Creates an instance of PipelineException.

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PipelineException Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


PipelineException Constructor

PipelineException Constructor

Creates an instance of PipelineException.

Expand image Overload List

Name | Description
PipelineException () | Creates an instance of PipelineException.
PipelineException (SerializationInfo, StreamingContext) | Creates an instance of PipelineException with information on serialization and streaming context for the related content item.
PipelineException (String) | Initializes a new instance of the PipelineException class with the specified error message.
PipelineException (String, Exception) | Initializes a new instance of the PipelineException class with the specified error message and a reference to the inner exception that is the cause of this exception.
PipelineException (String, Object[]) | Initializes a new instance of the PipelineException class with the specified error message.

Expand image See Also

Reference

PipelineException Class
PipelineException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


PipelineException Constructor ()

PipelineException Constructor ()
See Also
CollapseAll image

Creates an instance of PipelineException.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public PipelineException ()

Expand image See Also

Reference

PipelineException Class
PipelineException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineException Constructor (SerializationInfo, StreamingContext)

PipelineException Constructor (SerializationInfo, StreamingContext)
See Also
CollapseAll image

Creates an instance of PipelineException with information on serialization and streaming context for the related content item.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected PipelineException (
         SerializationInfo serializationInfo,
         StreamingContext streamingContext
)

Parameters

serializationInfo
Information necessary for serialization and deserialization of the content item.
streamingContext
Information necessary for the source and destination of a given serialized stream. Also provides an additional caller-defined context.

Expand image See Also

Reference

PipelineException Class
PipelineException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineException Constructor (String)

PipelineException Constructor (String)
See Also
CollapseAll image

Initializes a new instance of the PipelineException class with the specified error message.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public PipelineException (
         string message
)

Parameters

message
A message that describes the error.

Expand image See Also

Reference

PipelineException Class
PipelineException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineException Constructor (String, Exception)

PipelineException Constructor (String, Exception)
See Also
CollapseAll image

Initializes a new instance of the PipelineException class with the specified error message and a reference to the inner exception that is the cause of this exception.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public PipelineException (
         string message,
         Exception innerException
)

Parameters

message
A message that describes the error.
innerException
The exception that is the cause of the current exception. If innerException is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Expand image See Also

Reference

PipelineException Class
PipelineException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineException Constructor (String, Object[])

PipelineException Constructor (String, Object[])
See Also
CollapseAll image

Initializes a new instance of the PipelineException class with the specified error message.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public PipelineException (
         string message,
         params Object[] messageArgs
)

Parameters

message
A message that describes the error.
messageArgs
[ParamArrayAttribute] Array of strings specifying message-related arguments.

Expand image See Also

Reference

PipelineException Class
PipelineException Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PipelineException Methods

PipelineException Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetBaseException | (Inherited from Exception.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Exception.)
Public Method | ToString | (Inherited from Exception.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PipelineException Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


PipelineException Properties

PipelineException Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | (Inherited from Exception.)
Public Property | InnerException | (Inherited from Exception.)
Public Property | Message | (Inherited from Exception.)
Public Property | StackTrace | (Inherited from Exception.)

Expand image Protected Properties

 | Name | Description
Protected Property | HResult | (Inherited from Exception.)

Expand image See Also

Reference

PipelineException Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ProcessorParameter Class

ProcessorParameter Class
See Also Members
CollapseAll image

Represents a processor parameter. Processor parameters are automatically discovered by the content pipeline. Therefore, only custom processor developers should use this class directly.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[SerializableAttribute]
public sealed class ProcessorParameter

Expand image See Also

Reference

ProcessorParameter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ProcessorParameter Members

ProcessorParameter Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the ProcessorParameter type.

Expand image Public Properties

 | Name | Description
Public Property | DefaultValue | Default value of the parameter, as specified by the [DefaultValue] attribute.
Public Property | Description | Description of the parameter, as specified by the [Description] attribute.
Public Property | DisplayName | Name of the parameter displayed in the designer, as specified by the [DisplayName] attribute.
Public Property | IsEnum | Gets a value indicating whether the paramter is an enumeration.
Public Property | PossibleEnumValues | Available options for enumerated type parameters.
Public Property | PropertyName | Name of the property, as defined in the C# code.
Public Property | PropertyType | Type of the parameter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ProcessorParameter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ProcessorParameter Methods

ProcessorParameter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ProcessorParameter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ProcessorParameter Properties

ProcessorParameter Properties

Expand image Public Properties

 | Name | Description
Public Property | DefaultValue | Default value of the parameter, as specified by the [DefaultValue] attribute.
Public Property | Description | Description of the parameter, as specified by the [Description] attribute.
Public Property | DisplayName | Name of the parameter displayed in the designer, as specified by the [DisplayName] attribute.
Public Property | IsEnum | Gets a value indicating whether the paramter is an enumeration.
Public Property | PossibleEnumValues | Available options for enumerated type parameters.
Public Property | PropertyName | Name of the property, as defined in the C# code.
Public Property | PropertyType | Type of the parameter.

Expand image See Also

Reference

ProcessorParameter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ProcessorParameter.DefaultValue Property

ProcessorParameter.DefaultValue Property

Default value of the parameter, as specified by the [DefaultValue] attribute.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Object DefaultValue { get; set; }

Property Value

Default value of the processor parameter.

Expand image Remarks

Not all types are supported. For a complete list of supported values, see Parameterized Processors.

DefaultValue is treated as a suggestion to the designer UI and is not enforced by the content pipeline. This value may be null.

Expand image See Also

Reference

ProcessorParameter Class
ProcessorParameter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ProcessorParameter.Description Property

ProcessorParameter.Description Property

Description of the parameter, as specified by the [Description] attribute.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string Description { get; set; }

Property Value

Parameter description.

Expand image Remarks

The description appears as a tooltip, displayed by the designer UI. This value may be null.

Expand image See Also

Reference

ProcessorParameter Class
ProcessorParameter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ProcessorParameter.DisplayName Property

ProcessorParameter.DisplayName Property

Name of the parameter displayed in the designer, as specified by the [DisplayName] attribute.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string DisplayName { get; set; }

Property Value

Friendly name of the parameter.

Expand image See Also

Reference

ProcessorParameter Class
ProcessorParameter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ProcessorParameter.IsEnum Property

ProcessorParameter.IsEnum Property

Gets a value indicating whether the paramter is an enumeration.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool IsEnum { get; }

Property Value

true if the parameter is an enumeration; false otherwise.

Expand image See Also

Reference

ProcessorParameter Class
ProcessorParameter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ProcessorParameter.PossibleEnumValues Property

ProcessorParameter.PossibleEnumValues Property

Available options for enumerated type parameters. For parameters of other types, this value is null.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ReadOnlyCollection<string> PossibleEnumValues { get; }

Property Value

Available values for the parameter.

Expand image See Also

Reference

ProcessorParameter Class
ProcessorParameter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ProcessorParameter.PropertyName Property

ProcessorParameter.PropertyName Property

Name of the property, as defined in the C# code.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string PropertyName { get; }

Property Value

Name of the property used to identify a specific processor parameter.

Expand image Remarks

Corresponds to the property name, as defined in the C# code. This differs from the friendly parameter name, stored in the DisplayName property.

Expand image See Also

Reference

ProcessorParameter Class
ProcessorParameter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ProcessorParameter.PropertyType Property

ProcessorParameter.PropertyType Property

Type of the parameter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string PropertyType { get; }

Property Value

Type of the processor parameter. For a list of accepted types, see Parameterized Processors.

Expand image See Also

Reference

ProcessorParameter Class
ProcessorParameter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ProcessorParameterCollection Class

ProcessorParameterCollection Class
See Also Members
CollapseAll image

Represents a collection of processor parameters, usually for a single processor. This class is primarily designed for internal use or for custom processor developers.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[SerializableAttribute]
public sealed class ProcessorParameterCollection : ReadOnlyCollection<ProcessorParameter>

Expand image See Also

Reference

ProcessorParameterCollection Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ProcessorParameterCollection Members

ProcessorParameterCollection Members

The following tables list the members exposed by the ProcessorParameterCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from ReadOnlyCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ProcessorParameterCollection Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ProcessorParameterCollection Methods

ProcessorParameterCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from ReadOnlyCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ProcessorParameterCollection Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


ProcessorParameterCollection Properties

ProcessorParameterCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

ProcessorParameterCollection Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


TargetPlatform Enumeration

TargetPlatform Enumeration

Identifiers for the target platform.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public enum TargetPlatform

Expand image Members

Member name | Description
Windows | All supported versions of Windows (excluding Windows Phone)
Xbox360 | Xbox 360 video game and entertainment system
WindowsPhone | Windows Phone

Expand image See Also

Reference

Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureImporter Class

TextureImporter Class
See Also Members
CollapseAll image

Provides methods for reading texture files for use in the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[SecurityPermissionAttribute(Demand, UnmanagedCode)]
public class TextureImporter : ContentImporter<TextureContent>

Expand image See Also

Reference

TextureImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureImporter Members

TextureImporter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the TextureImporter type.

Expand image Public Constructors

 | Name | Description
Public Method | TextureImporter | Initializes a new instance of TextureImporter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing an texture file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


TextureImporter Constructor

TextureImporter Constructor

Initializes a new instance of TextureImporter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TextureImporter ()

Expand image See Also

Reference

TextureImporter Class
TextureImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureImporter Methods

TextureImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing an texture file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


TextureImporter.Import Method

TextureImporter.Import Method

Called by the XNA Framework when importing an texture file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override TextureContent Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

TextureImporter Class
TextureImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoContent Class

VideoContent Class
See Also Members
CollapseAll image

Provides a base class for all video objects.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class VideoContent : ContentItem, IDisposable

Expand image See Also

Reference

VideoContent Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoContent Members

VideoContent Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the VideoContent type.

Expand image Public Constructors

 | Name | Description
Public Method | VideoContent | Initializes a new copy of the VideoContent class for the specified video file.

Expand image Public Properties

 | Name | Description
Public Property | BitsPerSecond | Gets the bit rate for this video.
Public Property | Duration | Gets the duration of this video.
Public Property | Filename | Gets or sets the file name for this video.
Public Property | FramesPerSecond | Gets the frame rate for this video.
Public Property | Height | Gets the height of this video.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | VideoSoundtrackType | Gets or sets the type of soundtrack accompanying the video.
Public Property | Width | Gets the width of this video.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VideoContent Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


VideoContent Constructor

VideoContent Constructor

Initializes a new copy of the VideoContent class for the specified video file.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VideoContent (
         string filename
)

Parameters

filename
The file name of the video to import.

Expand image See Also

Reference

VideoContent Class
VideoContent Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoContent Methods

VideoContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VideoContent Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


VideoContent.Dispose Method

VideoContent.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

VideoContent Class
VideoContent Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoContent Properties

VideoContent Properties

Expand image Public Properties

 | Name | Description
Public Property | BitsPerSecond | Gets the bit rate for this video.
Public Property | Duration | Gets the duration of this video.
Public Property | Filename | Gets or sets the file name for this video.
Public Property | FramesPerSecond | Gets the frame rate for this video.
Public Property | Height | Gets the height of this video.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | VideoSoundtrackType | Gets or sets the type of soundtrack accompanying the video.
Public Property | Width | Gets the width of this video.

Expand image See Also

Reference

VideoContent Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


VideoContent.BitsPerSecond Property

VideoContent.BitsPerSecond Property

Gets the bit rate for this video.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int BitsPerSecond { get; }

Property Value

The number of bits per second encoded in this video.

Expand image See Also

Reference

VideoContent Class
VideoContent Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoContent.Duration Property

VideoContent.Duration Property

Gets the duration of this video.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TimeSpan Duration { get; }

Property Value

The length of this video.

Expand image See Also

Reference

VideoContent Class
VideoContent Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoContent.Filename Property

VideoContent.Filename Property

Gets or sets the file name for this video.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentSerializerAttribute]
public string Filename { get; set; }

Property Value

The file name for this video.

Expand image See Also

Reference

VideoContent Class
VideoContent Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoContent.FramesPerSecond Property

VideoContent.FramesPerSecond Property

Gets the frame rate for this video.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public float FramesPerSecond { get; }

Property Value

The number of frames per second encoded for this video.

Expand image See Also

Reference

VideoContent Class
VideoContent Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoContent.Height Property

VideoContent.Height Property

Gets the height of this video.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Height { get; }

Property Value

The height of this video, in pixels.

Expand image See Also

Reference

VideoContent Class
VideoContent Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoContent.VideoSoundtrackType Property

VideoContent.VideoSoundtrackType Property

Gets or sets the type of soundtrack accompanying the video.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentSerializerAttribute]
public VideoSoundtrackType VideoSoundtrackType { get; set; }

Property Value

The soundtrack type.

Expand image See Also

Reference

VideoContent Class
VideoContent Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoContent.Width Property

VideoContent.Width Property

Gets the width of this video.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Width { get; }

Property Value

The width of this video, in pixels.

Expand image See Also

Reference

VideoContent Class
VideoContent Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


WavImporter Class

WavImporter Class
See Also Members
CollapseAll image

Provides methods for reading .wav audio files for use in the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class WavImporter : ContentImporter<AudioContent>

Expand image See Also

Reference

WavImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


WavImporter Members

WavImporter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the WavImporter type.

Expand image Public Constructors

 | Name | Description
Public Method | WavImporter | Initializes a new instance of WavImporter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing a .wav audio file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

WavImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


WavImporter Constructor

WavImporter Constructor

Initializes a new instance of WavImporter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public WavImporter ()

Expand image See Also

Reference

WavImporter Class
WavImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


WavImporter Methods

WavImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing a .wav audio file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

WavImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


WavImporter.Import Method

WavImporter.Import Method

Called by the XNA Framework when importing a .wav audio file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override AudioContent Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

WavImporter Class
WavImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


WmaImporter Class

WmaImporter Class
See Also Members
CollapseAll image

Provides methods for reading Windows Media Audio (.wma) files for use in the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class WmaImporter : ContentImporter<AudioContent>

Expand image See Also

Reference

WmaImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


WmaImporter Members

WmaImporter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the WmaImporter type.

Expand image Public Constructors

 | Name | Description
Public Method | WmaImporter | Initializes a new instance of WmaImporter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing a .wma audio file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

WmaImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


WmaImporter Constructor

WmaImporter Constructor

Initializes a new instance of WmaImporter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public WmaImporter ()

Expand image See Also

Reference

WmaImporter Class
WmaImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


WmaImporter Methods

WmaImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing a .wma audio file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

WmaImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


WmaImporter.Import Method

WmaImporter.Import Method

Called by the XNA Framework when importing a .wma audio file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override AudioContent Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

WmaImporter Class
WmaImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


WmvImporter Class

WmvImporter Class
See Also Members
CollapseAll image

Provides methods for reading Windows Media Video (.wmv) files for use in the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class WmvImporter : ContentImporter<VideoContent>

Expand image See Also

Reference

WmvImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


WmvImporter Members

WmvImporter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the WmvImporter type.

Expand image Public Constructors

 | Name | Description
Public Method | WmvImporter | Initializes a new instance of WmvImporter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing a Windows Media Video (.wmv) file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

WmvImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


WmvImporter Constructor

WmvImporter Constructor

Initializes a new instance of WmvImporter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public WmvImporter ()

Expand image See Also

Reference

WmvImporter Class
WmvImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


WmvImporter Methods

WmvImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing a Windows Media Video (.wmv) file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

WmvImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


WmvImporter.Import Method

WmvImporter.Import Method

Called by the XNA Framework when importing a Windows Media Video (.wmv) file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override VideoContent Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

WmvImporter Class
WmvImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


XImporter Class

XImporter Class
See Also Members
CollapseAll image

Provides methods for reading DirectX Object (.x) files for use in the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[SecurityPermissionAttribute(Demand, UnmanagedCode)]
public class XImporter : ContentImporter<NodeContent>, IDisposable

Expand image See Also

Reference

XImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


XImporter Members

XImporter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the XImporter type.

Expand image Public Constructors

 | Name | Description
Public Method | XImporter | Initializes a new instance of XImporter.

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the managed/unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing a DirectX Object (.x) file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

XImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


XImporter Constructor

XImporter Constructor

Initializes a new instance of XImporter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public XImporter ()

Expand image See Also

Reference

XImporter Class
XImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


XImporter Methods

XImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Dispose | Overloaded. Immediately releases the managed/unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the XNA Framework when importing a DirectX Object (.x) file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

XImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


XImporter.Dispose Method

XImporter.Dispose Method

Immediately releases the managed/unmanaged resources used by this object.

Expand image Overload List

Name | Description
XImporter.Dispose () | Immediately releases the unmanaged resources used by this object.
XImporter.Dispose (Boolean) | Immediately releases the managed and/or unmanaged resources used by this object.

Expand image See Also

Reference

XImporter Class
XImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace


XImporter.Dispose Method ()

XImporter.Dispose Method ()
See Also
CollapseAll image

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

XImporter Class
XImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


XImporter.Dispose Method (Boolean)

XImporter.Dispose Method (Boolean)
See Also
CollapseAll image

Immediately releases the managed and/or unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual void Dispose (
         bool
)

Parameters

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

XImporter Class
XImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


XImporter.Import Method

XImporter.Import Method

Called by the XNA Framework when importing a DirectX Object (.x) file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override NodeContent Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of a game asset file.
context
Contains information for importing a game asset, such as a logger interface.

Return Value

Resulting game asset.

Expand image See Also

Reference

XImporter Class
XImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


XmlImporter Class

XmlImporter Class
See Also Members
CollapseAll image

Implements an importer for reading intermediate XML files. This is a wrapper around IntermediateSerializer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class XmlImporter : ContentImporter<Object>

Expand image See Also

Reference

XmlImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


XmlImporter Members

XmlImporter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the XmlImporter type.

Expand image Public Constructors

 | Name | Description
Public Method | XmlImporter | Initializes a new instance of XmlImporter.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the framework when importing an intermediate file containing a game asset.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

XmlImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


XmlImporter Constructor

XmlImporter Constructor

Initializes a new instance of XmlImporter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public XmlImporter ()

Expand image See Also

Reference

XmlImporter Class
XmlImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


XmlImporter Methods

XmlImporter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Import | Called by the framework when importing an intermediate file containing a game asset.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

XmlImporter Class
Microsoft.Xna.Framework.Content.Pipeline Namespace


XmlImporter.Import Method

XmlImporter.Import Method

Called by the framework when importing an intermediate file containing a game asset.

Namespace: Microsoft.Xna.Framework.Content.Pipeline
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override Object Import (
         string filename,
         ContentImporterContext context
)

Parameters

filename
Name of the intermediate file.
context
Contains information for importing the intermediate file, such as a logger interface.

Return Value

Object representing the game asset contained by the intermediate file.

Expand image See Also

Reference

XmlImporter Class
XmlImporter Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Provides intermediate classes and types for representing and manipulating graphics audio data.

Expand image Classes

 | Name | Description
Public Class | AudioContent | Encapsulates and provides operations, such as format conversions, on the source audio. This type is produced by the audio importers and used by audio processors to produce compiled audio assets.
Public Class | AudioFormat | Encapsulates the native audio format (WAVEFORMATEX) information of the audio content.

Expand image Enumerations

 | Name | Description
Public Enumeration | AudioFileType | Type of the audio file.
Public Enumeration | ConversionFormat | Target formats supported for audio source conversions.
Public Enumeration | ConversionQuality | Compression quality of the audio content.


AudioContent Class

AudioContent Class
See Also Members
CollapseAll image

Encapsulates and provides operations, such as format conversions, on the source audio. This type is produced by the audio importers and used by audio processors to produce compiled audio assets.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public class AudioContent : ContentItem, IDisposable

Expand image See Also

Reference

AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent Members

AudioContent Members
See Also Constructors Methods Properties
CollapseAll image

AudioContent members.

The following tables list the members exposed by the AudioContent type.

Expand image Public Constructors

 | Name | Description
Public Method | AudioContent | Initializes a new instance of AudioContent.

Expand image Public Properties

 | Name | Description
Public Property | Data | Gets the raw audio data.
Public Property | Duration | Gets the duration (in milliseconds) of the audio data.
Public Property | FileName | Gets the file name containing the audio data.
Public Property | FileType | Gets the AudioFileType of this audio source.
Public Property | Format | Gets the AudioFormat of this audio source.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | LoopLength | Gets the loop length, in samples.
Public Property | LoopStart | Gets the loop start, in samples.
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image Public Methods

 | Name | Description
Public Method | ConvertFormat | Transcodes the source audio to the target format and quality.
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Releases unmanaged resources and performs other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AudioContent Class
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace


AudioContent Constructor

AudioContent Constructor

Initializes a new instance of AudioContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public AudioContent (
         string audioFileName,
         AudioFileType audioFileType
)

Parameters

audioFileName
Name of the audio source file to be processed.
audioFileType
Type of the processed audio: WAV, MP3 or WMA.

Expand image Remarks

Constructs the object from the specified source file, in the format specified.

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent Methods

AudioContent Methods

Expand image Public Methods

 | Name | Description
Public Method | ConvertFormat | Transcodes the source audio to the target format and quality.
Public Method | Dispose | Immediately releases the unmanaged resources used by this object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | Releases unmanaged resources and performs other cleanup operations before garbage collection reclaims the object.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AudioContent Class
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace


AudioContent.ConvertFormat Method

AudioContent.ConvertFormat Method

Transcodes the source audio to the target format and quality.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public void ConvertFormat (
         ConversionFormat formatType,
         ConversionQuality quality,
         string targetFileName
)

Parameters

formatType
Format of the processed source audio: WAV, MP3 or WMA.
quality

Quality of the processed source audio. It can be one of the following:

  • Low (96 kbps)
  • Medium (128 kbps)
  • Best (192 kbps)
targetFileName
Name of the file containing the processed source audio.

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent.Dispose Method

AudioContent.Dispose Method

Immediately releases the unmanaged resources used by this object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public void Dispose ()

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent.Finalize Method

AudioContent.Finalize Method

Releases unmanaged resources and performs other cleanup operations before garbage collection reclaims the object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
protected override void Finalize ()

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent Properties

AudioContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Data | Gets the raw audio data.
Public Property | Duration | Gets the duration (in milliseconds) of the audio data.
Public Property | FileName | Gets the file name containing the audio data.
Public Property | FileType | Gets the AudioFileType of this audio source.
Public Property | Format | Gets the AudioFormat of this audio source.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | LoopLength | Gets the loop length, in samples.
Public Property | LoopStart | Gets the loop start, in samples.
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image See Also

Reference

AudioContent Class
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace


AudioContent.Data Property

AudioContent.Data Property

Gets the raw audio data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public ReadOnlyCollection<byte> Data { get; }

Property Value

If unprocessed, the source data; otherwise, the processed data.

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent.Duration Property

AudioContent.Duration Property

Gets the duration (in milliseconds) of the audio data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public TimeSpan Duration { get; }

Property Value

Duration of the audio data.

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent.FileName Property

AudioContent.FileName Property

Gets the file name containing the audio data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
[ContentSerializerAttribute]
public string FileName { get; }

Property Value

The name of the file containing this data.

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent.FileType Property

AudioContent.FileType Property

Gets the AudioFileType of this audio source.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public AudioFileType FileType { get; }

Property Value

The AudioFileType of this audio source.

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent.Format Property

AudioContent.Format Property

Gets the AudioFormat of this audio source.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public AudioFormat Format { get; }

Property Value

The AudioFormat of this audio source.

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent.LoopLength Property

AudioContent.LoopLength Property

Gets the loop length, in samples.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public int LoopLength { get; }

Property Value

The number of samples in the loop.

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioContent.LoopStart Property

AudioContent.LoopStart Property

Gets the loop start, in samples.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public int LoopStart { get; }

Property Value

The start of the loop.

Expand image See Also

Reference

AudioContent Class
AudioContent Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioFileType Enumeration

AudioFileType Enumeration

Type of the audio file.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public enum AudioFileType

Expand image Members

Member name | Description
Mp3 | The MP3 format
Wav | The WAV format
Wma | The WMA format

Expand image See Also

Reference

Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioFormat Class

AudioFormat Class
See Also Members
CollapseAll image

Encapsulates the native audio format (WAVEFORMATEX) information of the audio content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public sealed class AudioFormat

Expand image See Also

Reference

AudioFormat Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioFormat Members

AudioFormat Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the AudioFormat type.

Expand image Public Properties

 | Name | Description
Public Property | AverageBytesPerSecond | Gets the average bytes processed per second.
Public Property | BitsPerSample | Gets the bit depth of the audio content.
Public Property | BlockAlign | Gets the number of bytes per sample block, taking channels into consideration.
Public Property | ChannelCount | Gets the number of channels.
Public Property | Format | Gets the format of the audio content.
Public Property | NativeWaveFormat | Gets the raw byte buffer for the format.
Public Property | SampleRate | Gets the sample rate of the audio content.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AudioFormat Class
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace


AudioFormat Methods

AudioFormat Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AudioFormat Class
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace


AudioFormat Properties

AudioFormat Properties

Expand image Public Properties

 | Name | Description
Public Property | AverageBytesPerSecond | Gets the average bytes processed per second.
Public Property | BitsPerSample | Gets the bit depth of the audio content.
Public Property | BlockAlign | Gets the number of bytes per sample block, taking channels into consideration.
Public Property | ChannelCount | Gets the number of channels.
Public Property | Format | Gets the format of the audio content.
Public Property | NativeWaveFormat | Gets the raw byte buffer for the format.
Public Property | SampleRate | Gets the sample rate of the audio content.

Expand image See Also

Reference

AudioFormat Class
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace


AudioFormat.AverageBytesPerSecond Property

AudioFormat.AverageBytesPerSecond Property

Gets the average bytes processed per second.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public int AverageBytesPerSecond { get; }

Property Value

Average bytes processed per second.

Expand image See Also

Reference

AudioFormat Class
AudioFormat Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioFormat.BitsPerSample Property

AudioFormat.BitsPerSample Property

Gets the bit depth of the audio content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public int BitsPerSample { get; }

Property Value

If the audio has not been processed, the source bit depth; otherwise, the bit depth of the new format.

Expand image See Also

Reference

AudioFormat Class
AudioFormat Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioFormat.BlockAlign Property

AudioFormat.BlockAlign Property

Gets the number of bytes per sample block, taking channels into consideration. For example, for 16-bit stereo audio (PCM format), the size of each sample block is 4 bytes.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public int BlockAlign { get; }

Property Value

Number of bytes, per sample block.

Expand image See Also

Reference

AudioFormat Class
AudioFormat Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioFormat.ChannelCount Property

AudioFormat.ChannelCount Property

Gets the number of channels.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public int ChannelCount { get; }

Property Value

If the audio has not been processed, the source channel count; otherwise, the new channel count.

Expand image See Also

Reference

AudioFormat Class
AudioFormat Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioFormat.Format Property

AudioFormat.Format Property

Gets the format of the audio content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public int Format { get; }

Property Value

If the audio has not been processed, the format tag of the source content; otherwise, the new format tag.

Expand image See Also

Reference

AudioFormat Class
AudioFormat Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioFormat.NativeWaveFormat Property

AudioFormat.NativeWaveFormat Property

Gets the raw byte buffer for the format. For non-PCM formats, this buffer contains important format-specific information beyond the basic format information exposed in other properties of the AudioFormat type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public ReadOnlyCollection<byte> NativeWaveFormat { get; }

Property Value

The raw byte buffer represented in a collection.

Expand image See Also

AudioFormat Class
AudioFormat Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AudioFormat.SampleRate Property

AudioFormat.SampleRate Property

Gets the sample rate of the audio content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public int SampleRate { get; }

Property Value

If the audio has not been processed, the source sample rate; otherwise, the new sample rate.

Expand image See Also

Reference

AudioFormat Class
AudioFormat Members
Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ConversionFormat Enumeration

ConversionFormat Enumeration

Target formats supported for audio source conversions.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public enum ConversionFormat

Expand image Members

Member name | Description
Adpcm | A PCM encoding technique using 4 bits
Pcm | 8/16-bit mono/stereo PCM audio 8KHz-48KHz
WindowsMedia | Windows Media CBR formats (64 kbps, 128 kbps, 192 kbps)
Xma | The Xbox compression format

Expand image See Also

Reference

Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ConversionQuality Enumeration

ConversionQuality Enumeration

Compression quality of the audio content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Audio
Assembly: (in )

Expand image Syntax

C#
public enum ConversionQuality

Expand image Members

Member name | Description
Low | High compression yielding lower file size, but could compromise audio quality
Medium | Moderate compression resulting in a compromise between audio quality and file size
Best | Lowest compression, but the best audio quality

Expand image See Also

Reference

Microsoft.Xna.Framework.Content.Pipeline.Audio Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Provides intermediate classes and types for representing and manipulating graphics data.

Expand image Classes

 | Name | Description
Public Class | AlphaTestMaterialContent | Provides properties for modifying an effect that supports alpha testing.
Public Class | AnimationChannel | Provides methods and properties for maintaining an animation channel.
Public Class | AnimationChannelDictionary | Collection of animation data channels, one per bone or rigid object.
Public Class | AnimationContent | Provides properties for maintaining an animation.
Public Class | AnimationContentDictionary | Collection of named animations.
Public Class | AnimationKeyframe | Provides methods and properties for managing a keyframe.
Public Class | BasicMaterialContent | Provides properties for modifying a traditional fixed-function–style material, as supported by most 3D modeling packages.
Public Class | BitmapContent | Provides properties and methods for creating and maintaining a bitmap resource.
Public Class | BoneContent | Represents an animation skeleton.
Public Class | BoneWeightCollection | Collection of bone weights of a vertex.
Public Class | DualTextureMaterialContent | Provides properties for modifying an effect that supports two-layer multitexturing.
Public Class | Dxt1BitmapContent | Provides methods and properties for managing compressed textures (DXT1).
Public Class | Dxt3BitmapContent | Provides methods and properties for managing compressed textures (DXT3).
Public Class | Dxt5BitmapContent | Provides methods and properties for managing compressed textures (DXT5).
Public Class | DxtBitmapContent | Provides methods and properties for managing compressed textures (DXT1, DXT3, DXT5).
Public Class | EffectContent | Contains the source code for a DirectX Effect, loaded from a .fx file.
Public Class | EffectMaterialContent | Provides support for representing DirectX Effect materials.
Public Class | EnvironmentMapMaterialContent | Provides properties for modifying an effect that supports environment mapping.
Public Class | FontDescription | Provides information to the FontDescriptionProcessor describing which font to rasterize, which font size to utilize, and which Unicode characters to include in the processor output.
Public Class | GeometryContent | Provides properties that define various aspects of a geometry batch.
Public Class | GeometryContentCollection | Provides methods for maintaining a collection of geometry batches that make up a mesh.
Public Class | IndexCollection | Provides methods for maintaining a list of index values.
Public Class | IndirectPositionCollection | Provides methods for maintaining a list of vertex positions.
Public Class | MaterialContent | Provides methods and properties for maintaining a collection of named texture references.
Public Class | MeshBuilder | Provides support for writing a custom importer for mesh objects.
Public Class | MeshContent | Provides properties and methods that define various aspects of a mesh.
Public Class | MeshHelper | Provides methods for manipulating mesh data.
Public Class | MipmapChain | Provides methods for accessing a mipmap chain.
Public Class | MipmapChainCollection | Provides methods for maintaining a mipmap chain.
Public Class | NodeContent | Provides a base class for graphics types that define local coordinate systems.
Public Class | NodeContentCollection | Provides a collection of all NodeContent objects in a spatial hierarchy.
Public Class | PixelBitmapContent | Provides methods for maintaining a 2D array of pixel values.
Public Class | PositionCollection | Provides a collection of vertex position values.
Public Class | SkinnedMaterialContent | Provides properties for modifying an effect for rendering skinned character models.
Public Class | Texture2DContent | Represents a regular two-dimensional texture.
Public Class | Texture3DContent | Represents a three-dimensional volume texture.
Public Class | TextureContent | Provides a base class for all texture objects.
Public Class | TextureCubeContent | Provides validation for a cube map texture, which contains an array of six image faces.
Public Class | TextureReferenceDictionary | Provides a collection of named references to texture files.
Public Class | VectorConverter | Provides methods for converting data between different packed vector representations.
Public Class | VertexChannel | Provides methods and properties for maintaining a vertex channel.
Public Class | VertexChannel | Provides methods and properties for maintaining a vertex channel.
Public Class | VertexChannelCollection | Provides methods and properties for managing a list of vertex data channels.
Public Class | VertexChannelNames | Provides properties for managing a collection of vertex channel names.
Public Class | VertexContent | Provides methods and properties for maintaining the vertex data of a GeometryContent.

Expand image Structures

 | Name | Description
Public Structure | BoneWeight | Provides properties for managing a bone weight.

Expand image Enumerations

 | Name | Description
Public Enumeration | FontDescriptionStyle | Flags that describe style information to be applied to text.


AlphaTestMaterialContent Class

AlphaTestMaterialContent Class
See Also Members
CollapseAll image

Provides properties for modifying an effect that supports alpha testing.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class AlphaTestMaterialContent : MaterialContent

Expand image See Also

Reference

AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent Members

AlphaTestMaterialContent Members
See Also Constructors Fields Properties
CollapseAll image

The following tables list the members exposed by the AlphaTestMaterialContent type.

Expand image Public Constructors

 | Name | Description
Public Method | AlphaTestMaterialContent | Creates an instance of this object.

Expand image Public Fields

 | Name | Description
Public Field | AlphaFunctionKey | Specifies the key of the key/data pair for the alpha test.
Public Field | AlphaKey | Specifies the key of the key/data pair for the alpha property.
Public Field | DiffuseColorKey | Specifies the key of the key/data pair for the material diffuse color.
Public Field | ReferenceAlphaKey | Specifies the key of the key/data pair for the reference alpha value.
Public Field | TextureKey | Specifies the key of the key/data pair for the current texture.
Public Field | VertexColorEnabledKey | Specifies the key of the key/data pair for the vertex color enabled setting.

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha.
Public Property | AlphaFunction | Gets or sets the compare function for alpha test. The default value is Greater.
Public Property | DiffuseColor | Gets or sets the material diffuse color, which ranges from 0 to 1.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | ReferenceAlpha | Gets or sets the reference alpha value. The default value is 0.
Public Property | Texture | Gets or sets the current texture.
Public Property | Textures | (Inherited from MaterialContent.)
Public Property | VertexColorEnabled | Gets or sets whether vertex color is enabled.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

AlphaTestMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AlphaTestMaterialContent Fields

AlphaTestMaterialContent Fields

Expand image Public Fields

 | Name | Description
Public Field | AlphaFunctionKey | Specifies the key of the key/data pair for the alpha test.
Public Field | AlphaKey | Specifies the key of the key/data pair for the alpha property.
Public Field | DiffuseColorKey | Specifies the key of the key/data pair for the material diffuse color.
Public Field | ReferenceAlphaKey | Specifies the key of the key/data pair for the reference alpha value.
Public Field | TextureKey | Specifies the key of the key/data pair for the current texture.
Public Field | VertexColorEnabledKey | Specifies the key of the key/data pair for the vertex color enabled setting.

Expand image See Also

Reference

AlphaTestMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AlphaTestMaterialContent.AlphaFunctionKey Field

AlphaTestMaterialContent.AlphaFunctionKey Field

Specifies the key of the key/data pair for the alpha test.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string AlphaFunctionKey

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent.AlphaKey Field

AlphaTestMaterialContent.AlphaKey Field

Specifies the key of the key/data pair for the alpha property.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string AlphaKey

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent.DiffuseColorKey Field

AlphaTestMaterialContent.DiffuseColorKey Field

Specifies the key of the key/data pair for the material diffuse color.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string DiffuseColorKey

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent.ReferenceAlphaKey Field

AlphaTestMaterialContent.ReferenceAlphaKey Field

Specifies the key of the key/data pair for the reference alpha value.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string ReferenceAlphaKey

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent.TextureKey Field

AlphaTestMaterialContent.TextureKey Field

Specifies the key of the key/data pair for the current texture.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string TextureKey

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent.VertexColorEnabledKey Field

AlphaTestMaterialContent.VertexColorEnabledKey Field

Specifies the key of the key/data pair for the vertex color enabled setting.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string VertexColorEnabledKey

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent Constructor

AlphaTestMaterialContent Constructor

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public AlphaTestMaterialContent ()

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent Methods

AlphaTestMaterialContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

AlphaTestMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AlphaTestMaterialContent Properties

AlphaTestMaterialContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha.
Public Property | AlphaFunction | Gets or sets the compare function for alpha test. The default value is Greater.
Public Property | DiffuseColor | Gets or sets the material diffuse color, which ranges from 0 to 1.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | ReferenceAlpha | Gets or sets the reference alpha value. The default value is 0.
Public Property | Texture | Gets or sets the current texture.
Public Property | Textures | (Inherited from MaterialContent.)
Public Property | VertexColorEnabled | Gets or sets whether vertex color is enabled.

Expand image See Also

Reference

AlphaTestMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AlphaTestMaterialContent.Alpha Property

AlphaTestMaterialContent.Alpha Property

Gets or sets the material alpha.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<float> Alpha { get; set; }

Property Value

The material's alpha value.

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent.AlphaFunction Property

AlphaTestMaterialContent.AlphaFunction Property

Gets or sets the compare function for alpha test. The default value is Greater.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<CompareFunction> AlphaFunction { get; set; }

Property Value

The comparison function.

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent.DiffuseColor Property

AlphaTestMaterialContent.DiffuseColor Property

Gets or sets the material diffuse color, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> DiffuseColor { get; set; }

Property Value

The material's diffuse color.

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent.ReferenceAlpha Property

AlphaTestMaterialContent.ReferenceAlpha Property

Gets or sets the reference alpha value. The default value is 0.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<int> ReferenceAlpha { get; set; }

Property Value

The reference alpha value.

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent.Texture Property

AlphaTestMaterialContent.Texture Property

Gets or sets the current texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference<TextureContent> Texture { get; set; }

Property Value

The current texture.

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AlphaTestMaterialContent.VertexColorEnabled Property

AlphaTestMaterialContent.VertexColorEnabled Property

Gets or sets whether vertex color is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<bool> VertexColorEnabled { get; set; }

Property Value

True to enable per-vertex color; false otherwise.

Expand image See Also

Reference

AlphaTestMaterialContent Class
AlphaTestMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel Class

AnimationChannel Class
See Also Members
CollapseAll image

Provides methods and properties for maintaining an animation channel. An animation channel is a collection of keyframes describing the movement of a single bone or rigid object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class AnimationChannel : ICollection<AnimationKeyframe>, IEnumerable<AnimationKeyframe>, IEnumerable

Expand image See Also

Reference

AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel Members

AnimationChannel Members
See Also Constructors Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the AnimationChannel type.

Expand image Public Constructors

 | Name | Description
Public Method | AnimationChannel | Initializes a new instance of AnimationChannel.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of keyframes in the collection.
Public Property | Item | Gets the keyframe at the specified index position.

Expand image Public Methods

 | Name | Description
Public Method | Add | Adds a new keyframe to the collection, automatically sorting the contents according to keyframe times.
Public Method | Clear | Removes all keyframes from the collection.
Public Method | Contains | Searches the collection for the specified keyframe.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the keyframes.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Determines the index for the specified keyframe.
Public Method | Remove | Removes the specified keyframe from the collection.
Public Method | RemoveAt | Removes the keyframe at the specified index position.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.IsReadOnly | Returns a value indicating whether the object is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.Add | Adds a new keyframe to the collection, automatically sorting the contents according to keyframe times.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.CopyTo | Copies the elements of the animation channel to an array, starting at the specified index.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator that iterates through the keyframes of an animation channel.

Expand image See Also

Reference

AnimationChannel Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationChannel Constructor

AnimationChannel Constructor

Initializes a new instance of AnimationChannel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public AnimationChannel ()

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel Methods

AnimationChannel Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | Adds a new keyframe to the collection, automatically sorting the contents according to keyframe times.
Public Method | Clear | Removes all keyframes from the collection.
Public Method | Contains | Searches the collection for the specified keyframe.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Returns an enumerator that iterates through the keyframes.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Determines the index for the specified keyframe.
Public Method | Remove | Removes the specified keyframe from the collection.
Public Method | RemoveAt | Removes the keyframe at the specified index position.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.IsReadOnly | Returns a value indicating whether the object is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.Add | Adds a new keyframe to the collection, automatically sorting the contents according to keyframe times.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.CopyTo | Copies the elements of the animation channel to an array, starting at the specified index.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Gets an enumerator that iterates through the keyframes of an animation channel.

Expand image See Also

Reference

AnimationChannel Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationChannel.Add Method

AnimationChannel.Add Method

Adds a new keyframe to the collection, automatically sorting the contents according to keyframe times.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Add (
         AnimationKeyframe item
)

Parameters

item
Keyframe to be added to the channel.

Return Value

Index of the new keyframe.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel.Clear Method

AnimationChannel.Clear Method

Removes all keyframes from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Clear ()

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel.Contains Method

AnimationChannel.Contains Method

Searches the collection for the specified keyframe.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Contains (
         AnimationKeyframe item
)

Parameters

item
Keyframe being searched for.

Return Value

true if the keyframe exists; false otherwise.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel.GetEnumerator Method

AnimationChannel.GetEnumerator Method

Returns an enumerator that iterates through the keyframes.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IEnumerator<AnimationKeyframe> GetEnumerator ()

Return Value

Enumerator for the keyframe collection.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel.IndexOf Method

AnimationChannel.IndexOf Method

Determines the index for the specified keyframe.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int IndexOf (
         AnimationKeyframe item
)

Parameters

item
Identity of a keyframe.

Return Value

Index of the specified keyframe.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel.Remove Method

AnimationChannel.Remove Method

Removes the specified keyframe from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Remove (
         AnimationKeyframe item
)

Parameters

item
Keyframe being removed.

Return Value

true if the keyframe was removed; false otherwise.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel.RemoveAt Method

AnimationChannel.RemoveAt Method

Removes the keyframe at the specified index position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void RemoveAt (
         int index
)

Parameters

index
Index of the keyframe being removed.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.Add Method

System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.Add Method
See Also
CollapseAll image

Adds a new keyframe to the collection, automatically sorting the contents according to keyframe times.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.Add (
         AnimationKeyframe item
)

Parameters

item
Keyframe to be added to the channel.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.CopyTo Method

System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.CopyTo Method
See Also
CollapseAll image

Copies the elements of the animation channel to an array, starting at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.CopyTo (
         AnimationKeyframe[] array,
         int arrayIndex
)

Parameters

array
Array that will receive the copied animation channel elements.
arrayIndex
Starting index for copy operation.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Gets an enumerator that iterates through the keyframes of an animation channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

An enumerator for the AnimationChannnel.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel Properties

AnimationChannel Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of keyframes in the collection.
Public Property | Item | Gets the keyframe at the specified index position.

Expand image See Also

Reference

AnimationChannel Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationChannel.Count Property

AnimationChannel.Count Property

Gets the number of keyframes in the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of keyframes.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel.Item Property

AnimationChannel.Item Property

Gets the keyframe at the specified index position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public AnimationKeyframe this [
         int index
] { get; }

Property Value

Retrieved keyframe.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannel.System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.IsReadOnly Property

AnimationChannel.System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.IsReadOnly Property
See Also
CollapseAll image

Returns a value indicating whether the object is read-only.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationKeyframe>.IsReadOnly { get; }

Property Value

true if this object is read-only; false otherwise.

Expand image See Also

Reference

AnimationChannel Class
AnimationChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannelDictionary Class

AnimationChannelDictionary Class
See Also Members
CollapseAll image

Collection of animation data channels, one per bone or rigid object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class AnimationChannelDictionary : NamedValueDictionary<AnimationChannel>

Expand image Remarks

This collection is based on the name of the object being animated by each channel. Typically, target objects are an instance of BoneContent, but they can be any NodeContent subclass.

Expand image See Also

Reference

AnimationChannelDictionary Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannelDictionary Members

AnimationChannelDictionary Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the AnimationChannelDictionary type.

Expand image Public Constructors

 | Name | Description
Public Method | AnimationChannelDictionary | Initializes a new instance of AnimationChannelDictionary.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from NamedValueDictionary.)
Public Property | Item | (Inherited from NamedValueDictionary.)
Public Property | Keys | (Inherited from NamedValueDictionary.)
Public Property | Values | (Inherited from NamedValueDictionary.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from NamedValueDictionary.)
Public Method | Clear | (Inherited from NamedValueDictionary.)
Public Method | ContainsKey | (Inherited from NamedValueDictionary.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from NamedValueDictionary.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Remove | (Inherited from NamedValueDictionary.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | (Inherited from NamedValueDictionary.)

Expand image Protected Methods

 | Name | Description
Protected Method | AddItem | (Inherited from NamedValueDictionary.)
Protected Method | ClearItems | (Inherited from NamedValueDictionary.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from NamedValueDictionary.)
Protected Method | SetItem | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

AnimationChannelDictionary Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationChannelDictionary Constructor

AnimationChannelDictionary Constructor

Initializes a new instance of AnimationChannelDictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public AnimationChannelDictionary ()

Expand image See Also

Reference

AnimationChannelDictionary Class
AnimationChannelDictionary Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationChannelDictionary Methods

AnimationChannelDictionary Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from NamedValueDictionary.)
Public Method | Clear | (Inherited from NamedValueDictionary.)
Public Method | ContainsKey | (Inherited from NamedValueDictionary.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from NamedValueDictionary.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Remove | (Inherited from NamedValueDictionary.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | (Inherited from NamedValueDictionary.)

Expand image Protected Methods

 | Name | Description
Protected Method | AddItem | (Inherited from NamedValueDictionary.)
Protected Method | ClearItems | (Inherited from NamedValueDictionary.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from NamedValueDictionary.)
Protected Method | SetItem | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

AnimationChannelDictionary Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationChannelDictionary Properties

AnimationChannelDictionary Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from NamedValueDictionary.)
Public Property | Item | (Inherited from NamedValueDictionary.)
Public Property | Keys | (Inherited from NamedValueDictionary.)
Public Property | Values | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

AnimationChannelDictionary Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationContent Class

AnimationContent Class
See Also Members
CollapseAll image

Provides properties for maintaining an animation.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class AnimationContent : ContentItem

Expand image Remarks

An animation contains a collection of data channels, describing a complete set of movement for any number of bones or rigid objects. The channels are stored in the Animations dictionary. For character skinning, the animation data is usually attached to the root of a bone hierarchy. However, it can potentially belong to any node. For example, when used for rigid body animation.

Expand image See Also

Reference

AnimationContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationContent Members

AnimationContent Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the AnimationContent type.

Expand image Public Constructors

 | Name | Description
Public Method | AnimationContent | Initializes a new instance of AnimationContent.

Expand image Public Properties

 | Name | Description
Public Property | Channels | Gets the collection of animation data channels.
Public Property | Duration | Gets or sets the total length of the animation.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AnimationContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationContent Constructor

AnimationContent Constructor

Initializes a new instance of AnimationContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public AnimationContent ()

Expand image See Also

Reference

AnimationContent Class
AnimationContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationContent Methods

AnimationContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AnimationContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationContent Properties

AnimationContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Channels | Gets the collection of animation data channels.
Public Property | Duration | Gets or sets the total length of the animation.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image See Also

Reference

AnimationContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationContent.Channels Property

AnimationContent.Channels Property

Gets the collection of animation data channels. Each channel describes the movement of a single bone or rigid object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public AnimationChannelDictionary Channels { get; }

Property Value

Collection of animation channels.

Expand image See Also

Reference

AnimationContent Class
AnimationContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationContent.Duration Property

AnimationContent.Duration Property

Gets or sets the total length of the animation.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TimeSpan Duration { get; set; }

Property Value

Length of animation.

Expand image See Also

Reference

AnimationContent Class
AnimationContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationContentDictionary Class

AnimationContentDictionary Class
See Also Members
CollapseAll image

Collection of named animations.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class AnimationContentDictionary : NamedValueDictionary<AnimationContent>

Expand image See Also

Reference

AnimationContentDictionary Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationContentDictionary Members

AnimationContentDictionary Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the AnimationContentDictionary type.

Expand image Public Constructors

 | Name | Description
Public Method | AnimationContentDictionary | Initializes a new instance of AnimationContentDictionary.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from NamedValueDictionary.)
Public Property | Item | (Inherited from NamedValueDictionary.)
Public Property | Keys | (Inherited from NamedValueDictionary.)
Public Property | Values | (Inherited from NamedValueDictionary.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from NamedValueDictionary.)
Public Method | Clear | (Inherited from NamedValueDictionary.)
Public Method | ContainsKey | (Inherited from NamedValueDictionary.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from NamedValueDictionary.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Remove | (Inherited from NamedValueDictionary.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | (Inherited from NamedValueDictionary.)

Expand image Protected Methods

 | Name | Description
Protected Method | AddItem | (Inherited from NamedValueDictionary.)
Protected Method | ClearItems | (Inherited from NamedValueDictionary.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from NamedValueDictionary.)
Protected Method | SetItem | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

AnimationContentDictionary Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationContentDictionary Constructor

AnimationContentDictionary Constructor

Initializes a new instance of AnimationContentDictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public AnimationContentDictionary ()

Expand image See Also

Reference

AnimationContentDictionary Class
AnimationContentDictionary Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationContentDictionary Methods

AnimationContentDictionary Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from NamedValueDictionary.)
Public Method | Clear | (Inherited from NamedValueDictionary.)
Public Method | ContainsKey | (Inherited from NamedValueDictionary.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from NamedValueDictionary.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Remove | (Inherited from NamedValueDictionary.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | (Inherited from NamedValueDictionary.)

Expand image Protected Methods

 | Name | Description
Protected Method | AddItem | (Inherited from NamedValueDictionary.)
Protected Method | ClearItems | (Inherited from NamedValueDictionary.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from NamedValueDictionary.)
Protected Method | SetItem | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

AnimationContentDictionary Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationContentDictionary Properties

AnimationContentDictionary Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from NamedValueDictionary.)
Public Property | Item | (Inherited from NamedValueDictionary.)
Public Property | Keys | (Inherited from NamedValueDictionary.)
Public Property | Values | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

AnimationContentDictionary Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationKeyframe Class

AnimationKeyframe Class
See Also Members
CollapseAll image

Provides methods and properties for managing a keyframe. A keyframe describes the position of an animation channel at a single point in time.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class AnimationKeyframe : IComparable<AnimationKeyframe>

Expand image See Also

Reference

AnimationKeyframe Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationKeyframe Members

AnimationKeyframe Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the AnimationKeyframe type.

Expand image Public Constructors

 | Name | Description
Public Method | AnimationKeyframe | Initializes a new instance of AnimationKeyframe with the specified time offsetand transform.

Expand image Public Properties

 | Name | Description
Public Property | Time | Gets the time offset from the start of the animation to the position described by this keyframe.
Public Property | Transform | Gets or sets the position described by this keyframe.

Expand image Public Methods

 | Name | Description
Public Method | CompareTo | Compares this instance of a keyframe to another.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AnimationKeyframe Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationKeyframe Constructor

AnimationKeyframe Constructor

Initializes a new instance of AnimationKeyframe with the specified time offsetand transform.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public AnimationKeyframe (
         TimeSpan time,
         Matrix transform
)

Parameters

time
Time offset of the keyframe.
transform
Position of the keyframe.

Expand image See Also

Reference

AnimationKeyframe Class
AnimationKeyframe Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationKeyframe Methods

AnimationKeyframe Methods

Expand image Public Methods

 | Name | Description
Public Method | CompareTo | Compares this instance of a keyframe to another.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

AnimationKeyframe Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationKeyframe.CompareTo Method

AnimationKeyframe.CompareTo Method

Compares this instance of a keyframe to another.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int CompareTo (
         AnimationKeyframe other
)

Parameters

other
Keyframe being compared to.

Return Value

Indication of their relative values.

Expand image See Also

Reference

AnimationKeyframe Class
AnimationKeyframe Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationKeyframe Properties

AnimationKeyframe Properties

Expand image Public Properties

 | Name | Description
Public Property | Time | Gets the time offset from the start of the animation to the position described by this keyframe.
Public Property | Transform | Gets or sets the position described by this keyframe.

Expand image See Also

Reference

AnimationKeyframe Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


AnimationKeyframe.Time Property

AnimationKeyframe.Time Property

Gets the time offset from the start of the animation to the position described by this keyframe.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TimeSpan Time { get; }

Property Value

Offset from the animation start time.

Expand image See Also

Reference

AnimationKeyframe Class
AnimationKeyframe Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


AnimationKeyframe.Transform Property

AnimationKeyframe.Transform Property

Gets or sets the position described by this keyframe.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Matrix Transform { get; set; }

Property Value

Position of keyframe.

Expand image See Also

Reference

AnimationKeyframe Class
AnimationKeyframe Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent Class

BasicMaterialContent Class
See Also Members
CollapseAll image

Provides properties for modifying a traditional fixed-function–style material, as supported by most 3D modeling packages.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class BasicMaterialContent : MaterialContent

Expand image See Also

Reference

BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent Members

BasicMaterialContent Members
See Also Constructors Fields Properties
CollapseAll image

The following tables list the members exposed by the BasicMaterialContent type.

Expand image Public Constructors

 | Name | Description
Public Method | BasicMaterialContent | Initializes a new instance of BasicMaterialContent.

Expand image Public Fields

 | Name | Description
Public Field | AlphaKey | Specifies the key of the key/data pair for the alpha property.
Public Field | DiffuseColorKey | Specifies the key of the key/data pair for the diffuse color.
Public Field | EmissiveColorKey | Specifies the key of the key/data pair for the emissive color.
Public Field | SpecularColorKey | Specifies the key of the key/data pair for the specular color.
Public Field | SpecularPowerKey | Specifies the key of the key/data pair for the specular power.
Public Field | TextureKey | Specifies the key of the key/data pair for the diffuse texture.
Public Field | VertexColorEnabledKey | Specifies the key of the key/data pair for the vertex color property.

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the alpha property.
Public Property | DiffuseColor | Gets or sets the diffuse color property.
Public Property | EmissiveColor | Gets or sets the emissive color property.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | SpecularColor | Gets or sets the specular color property.
Public Property | SpecularPower | Gets or sets the specular power property.
Public Property | Texture | Gets or sets the diffuse texture property.
Public Property | Textures | (Inherited from MaterialContent.)
Public Property | VertexColorEnabled | Gets or sets the vertex color property.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

BasicMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BasicMaterialContent Fields

BasicMaterialContent Fields

Expand image Public Fields

 | Name | Description
Public Field | AlphaKey | Specifies the key of the key/data pair for the alpha property.
Public Field | DiffuseColorKey | Specifies the key of the key/data pair for the diffuse color.
Public Field | EmissiveColorKey | Specifies the key of the key/data pair for the emissive color.
Public Field | SpecularColorKey | Specifies the key of the key/data pair for the specular color.
Public Field | SpecularPowerKey | Specifies the key of the key/data pair for the specular power.
Public Field | TextureKey | Specifies the key of the key/data pair for the diffuse texture.
Public Field | VertexColorEnabledKey | Specifies the key of the key/data pair for the vertex color property.

Expand image See Also

Reference

BasicMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BasicMaterialContent.AlphaKey Field

BasicMaterialContent.AlphaKey Field

Specifies the key of the key/data pair for the alpha property.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string AlphaKey

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.DiffuseColorKey Field

BasicMaterialContent.DiffuseColorKey Field

Specifies the key of the key/data pair for the diffuse color.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string DiffuseColorKey

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.EmissiveColorKey Field

BasicMaterialContent.EmissiveColorKey Field

Specifies the key of the key/data pair for the emissive color.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string EmissiveColorKey

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.SpecularColorKey Field

BasicMaterialContent.SpecularColorKey Field

Specifies the key of the key/data pair for the specular color.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string SpecularColorKey

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.SpecularPowerKey Field

BasicMaterialContent.SpecularPowerKey Field

Specifies the key of the key/data pair for the specular power.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string SpecularPowerKey

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.TextureKey Field

BasicMaterialContent.TextureKey Field

Specifies the key of the key/data pair for the diffuse texture.

This key/data pair is stored in the Textures property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string TextureKey

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.VertexColorEnabledKey Field

BasicMaterialContent.VertexColorEnabledKey Field

Specifies the key of the key/data pair for the vertex color property.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string VertexColorEnabledKey

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent Constructor

BasicMaterialContent Constructor

Initializes a new instance of BasicMaterialContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public BasicMaterialContent ()

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent Methods

BasicMaterialContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

BasicMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BasicMaterialContent Properties

BasicMaterialContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the alpha property.
Public Property | DiffuseColor | Gets or sets the diffuse color property.
Public Property | EmissiveColor | Gets or sets the emissive color property.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | SpecularColor | Gets or sets the specular color property.
Public Property | SpecularPower | Gets or sets the specular power property.
Public Property | Texture | Gets or sets the diffuse texture property.
Public Property | Textures | (Inherited from MaterialContent.)
Public Property | VertexColorEnabled | Gets or sets the vertex color property.

Expand image See Also

Reference

BasicMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BasicMaterialContent.Alpha Property

BasicMaterialContent.Alpha Property

Gets or sets the alpha property.

This is a shortcut for accessing Textures[AlphaKey].

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<float> Alpha { get; set; }

Property Value

Current alpha value or the value to be set.

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.DiffuseColor Property

BasicMaterialContent.DiffuseColor Property

Gets or sets the diffuse color property.

This is a shortcut for accessing OpaqueData[DiffuseColorKey].

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> DiffuseColor { get; set; }

Property Value

Current diffuse color value or the value to be set.

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.EmissiveColor Property

BasicMaterialContent.EmissiveColor Property

Gets or sets the emissive color property.

This is a shortcut for accessing OpaqueData[EmissiveColorKey].

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> EmissiveColor { get; set; }

Property Value

Current diffuse color value or the value to be set.

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.SpecularColor Property

BasicMaterialContent.SpecularColor Property

Gets or sets the specular color property.

This is a shortcut for accessing OpaqueData[SpecularColorKey].

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> SpecularColor { get; set; }

Property Value

Current specular color value or the value to be set.

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.SpecularPower Property

BasicMaterialContent.SpecularPower Property

Gets or sets the specular power property.

This is a shortcut for accessing OpaqueData[SpecularPowerKey].

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<float> SpecularPower { get; set; }

Property Value

Current specular power value or the value to be set.

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.Texture Property

BasicMaterialContent.Texture Property

Gets or sets the diffuse texture property.

This is a shortcut for accessing Textures[DiffuseTextureKey].

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference<TextureContent> Texture { get; set; }

Property Value

Current diffuse texture value or the value to be set.

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BasicMaterialContent.VertexColorEnabled Property

BasicMaterialContent.VertexColorEnabled Property

Gets or sets the vertex color property.

This is a shortcut for accessing Textures[VertexColorEnabledKey].

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<bool> VertexColorEnabled { get; set; }

Property Value

Current vertex color or the value to be set.

Expand image See Also

Reference

BasicMaterialContent Class
BasicMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent Class

BitmapContent Class
See Also Members
CollapseAll image

Provides properties and methods for creating and maintaining a bitmap resource.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class BitmapContent : ContentItem

Expand image Remarks

The BitmapContent class represents a single two-dimensional image with a fixed size and fixed format. Various pixel encodings are supported by subclasses of the bitmap type. Higher level constructs such as textures that may contain multiple mipmap images or cube map faces are stored as collections of multiple bitmaps.

Expand image See Also

Reference

BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent Members

BitmapContent Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the BitmapContent type.

Expand image Public Constructors

 | Name | Description
Public Method | BitmapContent | Overloaded. Initializes a new instance of BitmapContent.

Expand image Public Properties

 | Name | Description
Public Property | Height | Gets or sets the height of the bitmap, in pixels.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | Gets or sets the width of the bitmap, in pixels.

Expand image Public Methods

 | Name | Description
 | Copy | Overloaded. Copies one bitmap to another.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixelData | Reads encoded bitmap content.
Public Method | GetType | (Inherited from Object.)
Public Method | SetPixelData | Writes encoded bitmap content.
Public Method | ToString | Returns a string description of the bitmap resource.
Public Method | TryGetFormat | Gets the corresponding GPU texture format for the specified bitmap type.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | Attempts to copy a region from a specified bitmap.
Protected Method | TryCopyTo | Attempts to copy a region of the specified bitmap onto another.
 | ValidateCopyArguments | Validates the arguments to the Copy function.

Expand image See Also

Reference

BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BitmapContent Constructor

BitmapContent Constructor

Initializes a new instance of BitmapContent.

Expand image Overload List

Name | Description
BitmapContent () | Initializes a new instance of BitmapContent.
BitmapContent (Int32, Int32) | Initializes a new instance of BitmapContent with the specified width or height.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BitmapContent Constructor ()

BitmapContent Constructor ()
See Also
CollapseAll image

Initializes a new instance of BitmapContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected BitmapContent ()

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent Constructor (Int32, Int32)

BitmapContent Constructor (Int32, Int32)
See Also
CollapseAll image

Initializes a new instance of BitmapContent with the specified width or height.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected BitmapContent (
         int width,
         int height
)

Parameters

width
Width, in pixels, of the bitmap resource.
height
Height, in pixels, of the bitmap resource.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent Methods

BitmapContent Methods

Expand image Public Methods

 | Name | Description
 | Copy | Overloaded. Copies one bitmap to another.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixelData | Reads encoded bitmap content.
Public Method | GetType | (Inherited from Object.)
Public Method | SetPixelData | Writes encoded bitmap content.
Public Method | ToString | Returns a string description of the bitmap resource.
Public Method | TryGetFormat | Gets the corresponding GPU texture format for the specified bitmap type.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | Attempts to copy a region from a specified bitmap.
Protected Method | TryCopyTo | Attempts to copy a region of the specified bitmap onto another.
 | ValidateCopyArguments | Validates the arguments to the Copy function.

Expand image See Also

Reference

BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BitmapContent.Copy Method

BitmapContent.Copy Method

Copies one bitmap to another.

The destination bitmap can be in any format and size. If the destination is larger or smaller, the source bitmap is scaled accordingly.

Expand image Overload List

Name | Description
BitmapContent.Copy (BitmapContent, BitmapContent) | Copies one bitmap into another.
BitmapContent.Copy (BitmapContent, Rectangle, BitmapContent, Rectangle) | Copies one bitmap into another.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BitmapContent.Copy Method (BitmapContent, BitmapContent)

BitmapContent.Copy Method (BitmapContent, BitmapContent)
See Also
CollapseAll image

Copies one bitmap into another.

The destination bitmap can be in any format and size. If the destination is larger or smaller, the source bitmap is scaled accordingly.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void Copy (
         BitmapContent sourceBitmap,
         BitmapContent destinationBitmap
)

Parameters

sourceBitmap
BitmapContent being copied.
destinationBitmap
BitmapContent being overwritten.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent.Copy Method (BitmapContent, Rectangle, BitmapContent, Rectangle)

BitmapContent.Copy Method (BitmapContent, Rectangle, BitmapContent, Rectangle)
See Also
CollapseAll image

Copies one bitmap into another.

The destination bitmap can be in any format and size. If the destination is larger or smaller, the source bitmap is scaled accordingly.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void Copy (
         BitmapContent sourceBitmap,
         Rectangle sourceRegion,
         BitmapContent destinationBitmap,
         Rectangle destinationRegion
)

Parameters

sourceBitmap
BitmapContent being copied.
sourceRegion
Region of sourceBitmap.
destinationBitmap
BitmapContent being overwritten.
destinationRegion
Region of bitmap to be overwritten.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent.GetPixelData Method

BitmapContent.GetPixelData Method

Reads encoded bitmap content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract byte[] GetPixelData ()

Return Value

Array containing encoded bitmap data.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent.SetPixelData Method

BitmapContent.SetPixelData Method

Writes encoded bitmap content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract void SetPixelData (
         byte[] sourceData
)

Parameters

sourceData
Array containing encoded bitmap data to be set.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent.ToString Method

BitmapContent.ToString Method

Returns a string description of the bitmap resource.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

Description of the bitmap.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent.TryCopyFrom Method

BitmapContent.TryCopyFrom Method

Attempts to copy a region from a specified bitmap.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected abstract bool TryCopyFrom (
         BitmapContent sourceBitmap,
         Rectangle sourceRegion,
         Rectangle destinationRegion
)

Parameters

sourceBitmap
BitmapContent being copied.
sourceRegion
Location of sourceBitmap.
destinationRegion
Region of destination bitmap to be overwritten.

Return Value

true if region copy is supported; false otherwise.

Expand image Remarks

This operation succeeds if the source is a PixelBitmapContent object and the copy region covers all of both bitmaps. Some bitmap subclasses may support subregion copies and/or a wider range of formats than just Vector4, but this is not required. Copy functionality is accessible using the Copy methods.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent.TryCopyTo Method

BitmapContent.TryCopyTo Method

Attempts to copy a region of the specified bitmap onto another.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected abstract bool TryCopyTo (
         BitmapContent destinationBitmap,
         Rectangle sourceRegion,
         Rectangle destinationRegion
)

Parameters

destinationBitmap
BitmapContent being overwritten.
sourceRegion
Location of the source bitmap.
destinationRegion
Region of destination bitmap to be overwritten.

Return Value

true if region copy is supported; false otherwise.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent.TryGetFormat Method

BitmapContent.TryGetFormat Method

Gets the corresponding GPU texture format for the specified bitmap type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract bool TryGetFormat (
         out SurfaceFormat format
)

Parameters

format
[OutAttribute] Format being compared.

Return Value

true if the bitmap matches format; false otherwise.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent.ValidateCopyArguments Method

BitmapContent.ValidateCopyArguments Method

Validates the arguments to the Copy function.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected static void ValidateCopyArguments (
         BitmapContent sourceBitmap,
         Rectangle sourceRegion,
         BitmapContent destinationBitmap,
         Rectangle destinationRegion
)

Parameters

sourceBitmap
BitmapContent being copied.
sourceRegion
Location of sourceBitmap.
destinationBitmap
BitmapContent being overwritten.
destinationRegion
Region of bitmap to be overwritten.

Expand image Remarks

Override this method to verify arguments from custom implementations of TryCopyFrom and TryCopyTo for your derived type.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent Properties

BitmapContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Height | Gets or sets the height of the bitmap, in pixels.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | Gets or sets the width of the bitmap, in pixels.

Expand image See Also

Reference

BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BitmapContent.Height Property

BitmapContent.Height Property

Gets or sets the height of the bitmap, in pixels.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Height { get; set; }

Property Value

Height of the bitmap.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BitmapContent.Width Property

BitmapContent.Width Property

Gets or sets the width of the bitmap, in pixels.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Width { get; set; }

Property Value

Width of the bitmap.

Expand image See Also

Reference

BitmapContent Class
BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneContent Class

BoneContent Class
See Also Members
CollapseAll image

Represents an animation skeleton.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class BoneContent : NodeContent

Expand image Remarks

Animation skeletons are represented as a tree of BoneContent objects with the bind pose stored in their Transform properties. Animation data for the entire skeleton is stored in the Animations property of the root bone (represented by a BoneContent object); typically a sibling of the mesh being skinned.

Expand image See Also

Reference

BoneContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneContent Members

BoneContent Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the BoneContent type.

Expand image Public Constructors

 | Name | Description
Public Method | BoneContent | Initializes a new instance of BoneContent.

Expand image Public Properties

 | Name | Description
Public Property | AbsoluteTransform | (Inherited from NodeContent.)
Public Property | Animations | (Inherited from NodeContent.)
Public Property | Children | (Inherited from NodeContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Parent | (Inherited from NodeContent.)
Public Property | Transform | (Inherited from NodeContent.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BoneContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BoneContent Constructor

BoneContent Constructor

Initializes a new instance of BoneContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public BoneContent ()

Expand image See Also

Reference

BoneContent Class
BoneContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneContent Methods

BoneContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BoneContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BoneContent Properties

BoneContent Properties

Expand image Public Properties

 | Name | Description
Public Property | AbsoluteTransform | (Inherited from NodeContent.)
Public Property | Animations | (Inherited from NodeContent.)
Public Property | Children | (Inherited from NodeContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Parent | (Inherited from NodeContent.)
Public Property | Transform | (Inherited from NodeContent.)

Expand image See Also

Reference

BoneContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BoneWeight Structure

BoneWeight Structure

Provides properties for managing a bone weight.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public struct BoneWeight

Expand image Remarks

A bone weight describes the influence of a single bone on the position of a vertex. These are grouped into BoneWeightCollection objects, which are stored in a vertex data channel.

Expand image See Also

Reference

BoneWeight Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneWeight Members

BoneWeight Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the BoneWeight type.

Expand image Public Constructors

 | Name | Description
Public Method | BoneWeight | Initializes a new instance of BoneWeight with the specified name and weight.

Expand image Public Properties

 | Name | Description
Public Property | BoneName | Gets the name of the bone.
Public Property | Weight | Gets the amount of bone influence, ranging from zero to one.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BoneWeight Structure
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BoneWeight Constructor

BoneWeight Constructor

Initializes a new instance of BoneWeight with the specified name and weight.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public BoneWeight (
         string boneName,
         float weight
)

Parameters

boneName
Name of the bone.
weight
Amount of influence, ranging from zero to one.

Expand image See Also

Reference

BoneWeight Structure
BoneWeight Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneWeight Methods

BoneWeight Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from ValueType.)
Public Method | GetHashCode | (Inherited from ValueType.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from ValueType.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BoneWeight Structure
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BoneWeight Properties

BoneWeight Properties

Expand image Public Properties

 | Name | Description
Public Property | BoneName | Gets the name of the bone.
Public Property | Weight | Gets the amount of bone influence, ranging from zero to one.

Expand image See Also

Reference

BoneWeight Structure
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BoneWeight.BoneName Property

BoneWeight.BoneName Property

Gets the name of the bone.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string BoneName { get; }

Property Value

Name of the bone.

Expand image Remarks

The bone can be located by searching for a BoneContent object with a matching Name property.

Expand image See Also

Reference

BoneWeight Structure
BoneWeight Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneWeight.Weight Property

BoneWeight.Weight Property

Gets the amount of bone influence, ranging from zero to one. The complete set of weights in a BoneWeightCollection should sum to one.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public float Weight { get; }

Property Value

Influence of the bone.

Expand image See Also

Reference

BoneWeight Structure
BoneWeight Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneWeightCollection Class

BoneWeightCollection Class
See Also Members
CollapseAll image

Collection of bone weights of a vertex.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class BoneWeightCollection : Collection<BoneWeight>

Expand image Remarks

These objects are stored in the Weights property of a vertex data channel object. The complete set of weights should sum to one.

Expand image See Also

Reference

BoneWeightCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneWeightCollection Members

BoneWeightCollection Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the BoneWeightCollection type.

Expand image Public Constructors

 | Name | Description
Public Method | BoneWeightCollection | Initializes a new instance of BoneWeightCollection.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | NormalizeWeights | Overloaded. Normalizes the contents of the bone weights list.
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

BoneWeightCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BoneWeightCollection Constructor

BoneWeightCollection Constructor

Initializes a new instance of BoneWeightCollection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public BoneWeightCollection ()

Expand image See Also

Reference

BoneWeightCollection Class
BoneWeightCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneWeightCollection Methods

BoneWeightCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | NormalizeWeights | Overloaded. Normalizes the contents of the bone weights list.
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

BoneWeightCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BoneWeightCollection.NormalizeWeights Method

BoneWeightCollection.NormalizeWeights Method

Normalizes the contents of the bone weights list.

Expand image Overload List

Name | Description
BoneWeightCollection.NormalizeWeights () | Normalizes the contents of the weights list.
BoneWeightCollection.NormalizeWeights (Int32) | Normalizes the contents of the bone weights list.

Expand image See Also

Reference

BoneWeightCollection Class
BoneWeightCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


BoneWeightCollection.NormalizeWeights Method ()

BoneWeightCollection.NormalizeWeights Method ()
See Also
CollapseAll image

Normalizes the contents of the weights list.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void NormalizeWeights ()

Expand image Remarks

Normalization does the following:

  • Sorts weights such that the most significant weight is first.
  • Removes zero-value entries.
  • Adjusts values so the sum equals one.

Throws InvalidContentException if all weights are zero.

Expand image See Also

Reference

BoneWeightCollection Class
BoneWeightCollection Members
NormalizeWeights
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneWeightCollection.NormalizeWeights Method (Int32)

BoneWeightCollection.NormalizeWeights Method (Int32)
See Also
CollapseAll image

Normalizes the contents of the bone weights list.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void NormalizeWeights (
         int maxWeights
)

Parameters

maxWeights
Maximum number of weights allowed.

Expand image Remarks

Normalization does the following:

  • Sorts weights such that the most significant weight is first.
  • Removes zero-value entries.
  • Discards weights with the smallest value until there are maxWeights or less in the list.
  • Adjusts values so the sum equals one.

Throws InvalidContentException if all weights are zero.

Expand image See Also

Reference

BoneWeightCollection Class
BoneWeightCollection Members
NormalizeWeights
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BoneWeightCollection Properties

BoneWeightCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image See Also

Reference

BoneWeightCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


DualTextureMaterialContent Class

DualTextureMaterialContent Class
See Also Members
CollapseAll image

Provides properties for modifying an effect that supports two-layer multitexturing.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class DualTextureMaterialContent : MaterialContent

Expand image See Also

Reference

DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent Members

DualTextureMaterialContent Members
See Also Constructors Fields Properties
CollapseAll image

The following tables list the members exposed by the DualTextureMaterialContent type.

Expand image Public Constructors

 | Name | Description
Public Method | DualTextureMaterialContent | Creates an instance of this object.

Expand image Public Fields

 | Name | Description
Public Field | AlphaKey | Specifies the key of the key/data pair for the alpha property.
Public Field | DiffuseColorKey | Specifies the key of the key/data pair for the material diffuse color.
Public Field | Texture2Key | Specifies the key of the key/data pair for the current overlay texture.
Public Field | TextureKey | Specifies the key of the key/data pair for the current texture.
Public Field | VertexColorEnabledKey | Specifies the key of the key/data pair for the vertex color enabled setting.

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha.
Public Property | DiffuseColor | Gets or sets the material diffuse color, which ranges from 0 to 1.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Texture | Gets or sets the current texture.
Public Property | Texture2 | Gets or sets the current overlay texture.
Public Property | Textures | (Inherited from MaterialContent.)
Public Property | VertexColorEnabled | Gets or sets whether vertex color is enabled.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

DualTextureMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


DualTextureMaterialContent Fields

DualTextureMaterialContent Fields

Expand image Public Fields

 | Name | Description
Public Field | AlphaKey | Specifies the key of the key/data pair for the alpha property.
Public Field | DiffuseColorKey | Specifies the key of the key/data pair for the material diffuse color.
Public Field | Texture2Key | Specifies the key of the key/data pair for the current overlay texture.
Public Field | TextureKey | Specifies the key of the key/data pair for the current texture.
Public Field | VertexColorEnabledKey | Specifies the key of the key/data pair for the vertex color enabled setting.

Expand image See Also

Reference

DualTextureMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


DualTextureMaterialContent.AlphaKey Field

DualTextureMaterialContent.AlphaKey Field

Specifies the key of the key/data pair for the alpha property.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string AlphaKey

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent.DiffuseColorKey Field

DualTextureMaterialContent.DiffuseColorKey Field

Specifies the key of the key/data pair for the material diffuse color.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string DiffuseColorKey

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent.Texture2Key Field

DualTextureMaterialContent.Texture2Key Field

Specifies the key of the key/data pair for the current overlay texture.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string Texture2Key

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent.TextureKey Field

DualTextureMaterialContent.TextureKey Field

Specifies the key of the key/data pair for the current texture.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string TextureKey

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent.VertexColorEnabledKey Field

DualTextureMaterialContent.VertexColorEnabledKey Field

Specifies the key of the key/data pair for the vertex color enabled setting.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string VertexColorEnabledKey

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent Constructor

DualTextureMaterialContent Constructor

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public DualTextureMaterialContent ()

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent Methods

DualTextureMaterialContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

DualTextureMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


DualTextureMaterialContent Properties

DualTextureMaterialContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha.
Public Property | DiffuseColor | Gets or sets the material diffuse color, which ranges from 0 to 1.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Texture | Gets or sets the current texture.
Public Property | Texture2 | Gets or sets the current overlay texture.
Public Property | Textures | (Inherited from MaterialContent.)
Public Property | VertexColorEnabled | Gets or sets whether vertex color is enabled.

Expand image See Also

Reference

DualTextureMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


DualTextureMaterialContent.Alpha Property

DualTextureMaterialContent.Alpha Property

Gets or sets the material alpha.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<float> Alpha { get; set; }

Property Value

The material's alpha value.

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent.DiffuseColor Property

DualTextureMaterialContent.DiffuseColor Property

Gets or sets the material diffuse color, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> DiffuseColor { get; set; }

Property Value

The material's diffuse color.

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent.Texture Property

DualTextureMaterialContent.Texture Property

Gets or sets the current texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference<TextureContent> Texture { get; set; }

Property Value

The current texture.

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent.Texture2 Property

DualTextureMaterialContent.Texture2 Property

Gets or sets the current overlay texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference<TextureContent> Texture2 { get; set; }

Property Value

The overlay texture.

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DualTextureMaterialContent.VertexColorEnabled Property

DualTextureMaterialContent.VertexColorEnabled Property

Gets or sets whether vertex color is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<bool> VertexColorEnabled { get; set; }

Property Value

True to enable per-vertex color; false otherwise.

Expand image See Also

Reference

DualTextureMaterialContent Class
DualTextureMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Dxt1BitmapContent Class

Dxt1BitmapContent Class
See Also Members
CollapseAll image

Provides methods and properties for managing compressed textures (DXT1).

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class Dxt1BitmapContent : DxtBitmapContent

Expand image See Also

Reference

Dxt1BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Dxt1BitmapContent Members

Dxt1BitmapContent Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the Dxt1BitmapContent type.

Expand image Public Constructors

 | Name | Description
Public Method | Dxt1BitmapContent | Initializes a new instance of Dxt1BitmapContent with the specified width and height.

Expand image Public Properties

 | Name | Description
Public Property | Height | (Inherited from BitmapContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | (Inherited from BitmapContent.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixelData | (Inherited from DxtBitmapContent.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetPixelData | (Inherited from DxtBitmapContent.)
Public Method | ToString | (Inherited from BitmapContent.)
Public Method | TryGetFormat | Attempts to get the GPU texture format of this bitmap type.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | (Inherited from DxtBitmapContent.)
Protected Method | TryCopyTo | (Inherited from DxtBitmapContent.)

Expand image See Also

Reference

Dxt1BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Dxt1BitmapContent Constructor

Dxt1BitmapContent Constructor

Initializes a new instance of Dxt1BitmapContent with the specified width and height.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Dxt1BitmapContent (
         int width,
         int height
)

Parameters

width
Width of the bitmap, in pixels.
height
Height of the bitmap, in pixels.

Expand image See Also

Reference

Dxt1BitmapContent Class
Dxt1BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Dxt1BitmapContent Methods

Dxt1BitmapContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixelData | (Inherited from DxtBitmapContent.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetPixelData | (Inherited from DxtBitmapContent.)
Public Method | ToString | (Inherited from BitmapContent.)
Public Method | TryGetFormat | Attempts to get the GPU texture format of this bitmap type.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | (Inherited from DxtBitmapContent.)
Protected Method | TryCopyTo | (Inherited from DxtBitmapContent.)

Expand image See Also

Reference

Dxt1BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Dxt1BitmapContent.TryGetFormat Method

Dxt1BitmapContent.TryGetFormat Method

Attempts to get the GPU texture format of this bitmap type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool TryGetFormat (
         out SurfaceFormat format
)

Parameters

format
[OutAttribute] Matching GPU format.

Return Value

true if the bitmap matches a GPU format; false otherwise.

Expand image See Also

Reference

Dxt1BitmapContent Class
Dxt1BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Dxt1BitmapContent Properties

Dxt1BitmapContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Height | (Inherited from BitmapContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | (Inherited from BitmapContent.)

Expand image See Also

Reference

Dxt1BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Dxt3BitmapContent Class

Dxt3BitmapContent Class
See Also Members
CollapseAll image

Provides methods and properties for managing compressed textures (DXT3).

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class Dxt3BitmapContent : DxtBitmapContent

Expand image See Also

Reference

Dxt3BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Dxt3BitmapContent Members

Dxt3BitmapContent Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the Dxt3BitmapContent type.

Expand image Public Constructors

 | Name | Description
Public Method | Dxt3BitmapContent | Initializes a new instance of Dxt3BitmapContent with the specified width and height.

Expand image Public Properties

 | Name | Description
Public Property | Height | (Inherited from BitmapContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | (Inherited from BitmapContent.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixelData | (Inherited from DxtBitmapContent.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetPixelData | (Inherited from DxtBitmapContent.)
Public Method | ToString | (Inherited from BitmapContent.)
Public Method | TryGetFormat | Attempts to get the GPU texture format of this bitmap type.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | (Inherited from DxtBitmapContent.)
Protected Method | TryCopyTo | (Inherited from DxtBitmapContent.)

Expand image See Also

Reference

Dxt3BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Dxt3BitmapContent Constructor

Dxt3BitmapContent Constructor

Initializes a new instance of Dxt3BitmapContent with the specified width and height.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Dxt3BitmapContent (
         int width,
         int height
)

Parameters

width
Width of the bitmap, in pixels.
height
Height of the bitmap, in pixels.

Expand image See Also

Reference

Dxt3BitmapContent Class
Dxt3BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Dxt3BitmapContent Methods

Dxt3BitmapContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixelData | (Inherited from DxtBitmapContent.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetPixelData | (Inherited from DxtBitmapContent.)
Public Method | ToString | (Inherited from BitmapContent.)
Public Method | TryGetFormat | Attempts to get the GPU texture format of this bitmap type.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | (Inherited from DxtBitmapContent.)
Protected Method | TryCopyTo | (Inherited from DxtBitmapContent.)

Expand image See Also

Reference

Dxt3BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Dxt3BitmapContent.TryGetFormat Method

Dxt3BitmapContent.TryGetFormat Method

Attempts to get the GPU texture format of this bitmap type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool TryGetFormat (
         out SurfaceFormat format
)

Parameters

format
[OutAttribute] Matching GPU format.

Return Value

true if the bitmap matches a GPU format; false otherwise.

Expand image See Also

Reference

Dxt3BitmapContent Class
Dxt3BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Dxt3BitmapContent Properties

Dxt3BitmapContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Height | (Inherited from BitmapContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | (Inherited from BitmapContent.)

Expand image See Also

Reference

Dxt3BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Dxt5BitmapContent Class

Dxt5BitmapContent Class
See Also Members
CollapseAll image

Provides methods and properties for managing compressed textures (DXT5).

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class Dxt5BitmapContent : DxtBitmapContent

Expand image See Also

Reference

Dxt5BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Dxt5BitmapContent Members

Dxt5BitmapContent Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the Dxt5BitmapContent type.

Expand image Public Constructors

 | Name | Description
Public Method | Dxt5BitmapContent | Initializes a new instance of Dxt5BitmapContent with the specified width and height.

Expand image Public Properties

 | Name | Description
Public Property | Height | (Inherited from BitmapContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | (Inherited from BitmapContent.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixelData | (Inherited from DxtBitmapContent.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetPixelData | (Inherited from DxtBitmapContent.)
Public Method | ToString | (Inherited from BitmapContent.)
Public Method | TryGetFormat | Attempts to get the GPU texture format of this bitmap type.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | (Inherited from DxtBitmapContent.)
Protected Method | TryCopyTo | (Inherited from DxtBitmapContent.)

Expand image See Also

Reference

Dxt5BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Dxt5BitmapContent Constructor

Dxt5BitmapContent Constructor

Initializes a new instance of Dxt5BitmapContent with the specified width and height.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Dxt5BitmapContent (
         int width,
         int height
)

Parameters

width
Width of the bitmap, in pixels.
height
Height of the bitmap, in pixels.

Expand image See Also

Reference

Dxt5BitmapContent Class
Dxt5BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Dxt5BitmapContent Methods

Dxt5BitmapContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixelData | (Inherited from DxtBitmapContent.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetPixelData | (Inherited from DxtBitmapContent.)
Public Method | ToString | (Inherited from BitmapContent.)
Public Method | TryGetFormat | Attempts to get the GPU texture format of this bitmap type.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | (Inherited from DxtBitmapContent.)
Protected Method | TryCopyTo | (Inherited from DxtBitmapContent.)

Expand image See Also

Reference

Dxt5BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Dxt5BitmapContent.TryGetFormat Method

Dxt5BitmapContent.TryGetFormat Method

Attempts to get the GPU texture format of this bitmap type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool TryGetFormat (
         out SurfaceFormat format
)

Parameters

format
[OutAttribute] Matching GPU format.

Return Value

true if the bitmap matches a GPU format; false otherwise.

Expand image See Also

Reference

Dxt5BitmapContent Class
Dxt5BitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Dxt5BitmapContent Properties

Dxt5BitmapContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Height | (Inherited from BitmapContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | (Inherited from BitmapContent.)

Expand image See Also

Reference

Dxt5BitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


DxtBitmapContent Class

DxtBitmapContent Class
See Also Members
CollapseAll image

Provides methods and properties for managing compressed textures (DXT1, DXT3, DXT5). This is the base class for all compressed textures.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class DxtBitmapContent : BitmapContent

Expand image See Also

Reference

DxtBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DxtBitmapContent Members

DxtBitmapContent Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the DxtBitmapContent type.

Expand image Public Constructors

 | Name | Description
Public Method | DxtBitmapContent | Overloaded. Initializes a new instance of DxtBitmapContent.

Expand image Public Properties

 | Name | Description
Public Property | Height | (Inherited from BitmapContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | (Inherited from BitmapContent.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixelData | Gets the bitmap content as an array of encoded bytes.
Public Method | GetType | (Inherited from Object.)
Public Method | SetPixelData | Sets the contents of the bitmap using an encoded byte array.
Public Method | ToString | (Inherited from BitmapContent.)
Public Method | TryGetFormat | (Inherited from BitmapContent.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | Attempts to copy from a specified region to another.
Protected Method | TryCopyTo | Attempts to copy the specified region to another.

Expand image See Also

Reference

DxtBitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


DxtBitmapContent Constructor

DxtBitmapContent Constructor

Initializes a new instance of DxtBitmapContent.

Expand image Overload List

Name | Description
DxtBitmapContent (Int32) | Initializes a new instance of DxtBitmapContent with the specified compression.
DxtBitmapContent (Int32, Int32, Int32) | Initializes a new instance of DxtBitmapContent with the specified size.

Expand image See Also

Reference

DxtBitmapContent Class
DxtBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


DxtBitmapContent Constructor (Int32)

DxtBitmapContent Constructor (Int32)
See Also
CollapseAll image

Initializes a new instance of DxtBitmapContent with the specified compression.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected DxtBitmapContent (
         int blockSize
)

Parameters

blockSize
Size of the block, in bytes.

Expand image See Also

Reference

DxtBitmapContent Class
DxtBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DxtBitmapContent Constructor (Int32, Int32, Int32)

DxtBitmapContent Constructor (Int32, Int32, Int32)
See Also
CollapseAll image

Initializes a new instance of DxtBitmapContent with the specified size.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected DxtBitmapContent (
         int blockSize,
         int width,
         int height
)

Parameters

blockSize
Size of the block, in bytes.
width
Width of the bitmap, in pixels.
height
Height of the bitmap, in pixels.

Expand image See Also

Reference

DxtBitmapContent Class
DxtBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DxtBitmapContent Methods

DxtBitmapContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixelData | Gets the bitmap content as an array of encoded bytes.
Public Method | GetType | (Inherited from Object.)
Public Method | SetPixelData | Sets the contents of the bitmap using an encoded byte array.
Public Method | ToString | (Inherited from BitmapContent.)
Public Method | TryGetFormat | (Inherited from BitmapContent.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | Attempts to copy from a specified region to another.
Protected Method | TryCopyTo | Attempts to copy the specified region to another.

Expand image See Also

Reference

DxtBitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


DxtBitmapContent.GetPixelData Method

DxtBitmapContent.GetPixelData Method

Gets the bitmap content as an array of encoded bytes.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override byte[] GetPixelData ()

Return Value

Contents of the bitmap.

Expand image See Also

Reference

DxtBitmapContent Class
DxtBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DxtBitmapContent.SetPixelData Method

DxtBitmapContent.SetPixelData Method

Sets the contents of the bitmap using an encoded byte array.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override void SetPixelData (
         byte[] sourceData
)

Parameters

sourceData
Contents to be copied to destination bitmap.

Expand image See Also

Reference

DxtBitmapContent Class
DxtBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DxtBitmapContent.TryCopyFrom Method

DxtBitmapContent.TryCopyFrom Method

Attempts to copy from a specified region to another.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override bool TryCopyFrom (
         BitmapContent sourceBitmap,
         Rectangle sourceRegion,
         Rectangle destinationRegion
)

Parameters

sourceBitmap
Bitmap being copied from.
sourceRegion
Region of bitmap being copied.
destinationRegion
Region being copied to.

Return Value

trueif successful; false otherwise.

Expand image See Also

Reference

DxtBitmapContent Class
DxtBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DxtBitmapContent.TryCopyTo Method

DxtBitmapContent.TryCopyTo Method

Attempts to copy the specified region to another.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override bool TryCopyTo (
         BitmapContent destinationBitmap,
         Rectangle sourceRegion,
         Rectangle destinationRegion
)

Parameters

destinationBitmap
Bitmap being copied to.
sourceRegion
Region of source bitmap being copied from.
destinationRegion
Region of destination bitmap.

Return Value

trueif successful; false otherwise.

Expand image See Also

Reference

DxtBitmapContent Class
DxtBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


DxtBitmapContent Properties

DxtBitmapContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Height | (Inherited from BitmapContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | (Inherited from BitmapContent.)

Expand image See Also

Reference

DxtBitmapContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EffectContent Class

EffectContent Class
See Also Members
CollapseAll image

Contains the source code for a DirectX Effect, loaded from a .fx file.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class EffectContent : ContentItem

Expand image See Also

Reference

EffectContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectContent Members

EffectContent Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the EffectContent type.

Expand image Public Constructors

 | Name | Description
Public Method | EffectContent | Initializes a new instance of EffectContent.

Expand image Public Properties

 | Name | Description
Public Property | EffectCode | Gets or sets the effect program source code.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EffectContent Constructor

EffectContent Constructor

Initializes a new instance of EffectContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public EffectContent ()

Expand image See Also

Reference

EffectContent Class
EffectContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectContent Methods

EffectContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EffectContent Properties

EffectContent Properties

Expand image Public Properties

 | Name | Description
Public Property | EffectCode | Gets or sets the effect program source code.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image See Also

Reference

EffectContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EffectContent.EffectCode Property

EffectContent.EffectCode Property

Gets or sets the effect program source code.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string EffectCode { get; set; }

Property Value

Current value of the Effect program source code or the value to be set.

Expand image See Also

Reference

EffectContent Class
EffectContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectMaterialContent Class

EffectMaterialContent Class
See Also Members
CollapseAll image

Provides support for representing DirectX Effect materials.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class EffectMaterialContent : MaterialContent

Expand image See Also

Reference

EffectMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectMaterialContent Members

EffectMaterialContent Members
See Also Constructors Fields Properties
CollapseAll image

The following tables list the members exposed by the EffectMaterialContent type.

Expand image Public Constructors

 | Name | Description
Public Method | EffectMaterialContent | Initializes a new instance of EffectMaterialContent.

Expand image Public Fields

 | Name | Description
Public Field | CompiledEffectKey | Specifies the key of the key/data pair for the compiled effect property.
Public Field | EffectKey | Use this key search for the related effect property in the OpaqueDataDictionary object.

Expand image Public Properties

 | Name | Description
Public Property | CompiledEffect | Gets or sets the compiled Effect.
Public Property | Effect | Gets or sets the effect property.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Textures | (Inherited from MaterialContent.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

EffectMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EffectMaterialContent Fields

EffectMaterialContent Fields

Expand image Public Fields

 | Name | Description
Public Field | CompiledEffectKey | Specifies the key of the key/data pair for the compiled effect property.
Public Field | EffectKey | Use this key search for the related effect property in the OpaqueDataDictionary object.

Expand image See Also

Reference

EffectMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EffectMaterialContent.CompiledEffectKey Field

EffectMaterialContent.CompiledEffectKey Field

Specifies the key of the key/data pair for the compiled effect property.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string CompiledEffectKey

Expand image See Also

Reference

EffectMaterialContent Class
EffectMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectMaterialContent.EffectKey Field

EffectMaterialContent.EffectKey Field

Use this key search for the related effect property in the OpaqueDataDictionary object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string EffectKey

Expand image See Also

Reference

EffectMaterialContent Class
EffectMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectMaterialContent Constructor

EffectMaterialContent Constructor

Initializes a new instance of EffectMaterialContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public EffectMaterialContent ()

Expand image See Also

Reference

EffectMaterialContent Class
EffectMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectMaterialContent Methods

EffectMaterialContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

EffectMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EffectMaterialContent Properties

EffectMaterialContent Properties

Expand image Public Properties

 | Name | Description
Public Property | CompiledEffect | Gets or sets the compiled Effect.
Public Property | Effect | Gets or sets the effect property.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Textures | (Inherited from MaterialContent.)

Expand image See Also

Reference

EffectMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EffectMaterialContent.CompiledEffect Property

EffectMaterialContent.CompiledEffect Property

Gets or sets the compiled Effect.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentSerializerIgnoreAttribute]
public ExternalReference<CompiledEffectContent> CompiledEffect { get; set; }

Property Value

The class instance that represents the compiled effect.

Expand image See Also

Reference

EffectMaterialContent Class
EffectMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectMaterialContent.Effect Property

EffectMaterialContent.Effect Property

Gets or sets the effect property.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference<EffectContent> Effect { get; set; }

Property Value

Reference to an external DirectX Effect file.

Expand image Remarks

Use this value as a shortcut for accessing the EffectKey element.

Expand image See Also

Reference

EffectMaterialContent Class
EffectMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent Class

EnvironmentMapMaterialContent Class
See Also Members
CollapseAll image

Provides properties for modifying an effect that supports environment mapping.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class EnvironmentMapMaterialContent : MaterialContent

Expand image See Also

Reference

EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent Members

EnvironmentMapMaterialContent Members
See Also Constructors Fields Properties
CollapseAll image

The following tables list the members exposed by the EnvironmentMapMaterialContent type.

Expand image Public Constructors

 | Name | Description
Public Method | EnvironmentMapMaterialContent | Creates an instance of this object.

Expand image Public Fields

 | Name | Description
Public Field | AlphaKey | Specifies the key of the key/data pair for the alpha property.
Public Field | DiffuseColorKey | Specifies the key of the key/data pair for the material diffuse color.
Public Field | EmissiveColorKey | Specifies the key of the key/data pair for the material emissive color.
Public Field | EnvironmentMapAmountKey | Specifies the key of the key/data pair for the amount of the environment map color to blend.
Public Field | EnvironmentMapKey | Specifies the key of the key/data pair for the current environment map texture.
Public Field | EnvironmentMapSpecularKey | Specifies the key of the key/data pair for the amount of the environment map alpha value to add.
Public Field | FresnelFactorKey | Specifies the key of the key/data pair for the fresnel factor.
Public Field | TextureKey | Specifies the key of the key/data pair for the current texture.

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha.
Public Property | DiffuseColor | Gets or sets the material diffuse color, which ranges from 0 to 1.
Public Property | EmissiveColor | Gets or sets the emissive color of the effect material.
Public Property | EnvironmentMap | Gets or sets the current environment map texture.
Public Property | EnvironmentMapAmount | Gets or sets the amount of the environment map color (RGB) that will be blended over the base texture. The value ranges from 0 to 1; the default value is 1.
Public Property | EnvironmentMapSpecular | Gets or sets the amount of the environment map alpha value that will be added to the base texture. The value ranges from 0 to 1; the default value is 0.
Public Property | FresnelFactor | Gets or sets the Fresnel factor used for the environment map blending.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Texture | Gets or sets the current texture.
Public Property | Textures | (Inherited from MaterialContent.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EnvironmentMapMaterialContent Fields

EnvironmentMapMaterialContent Fields

Expand image Public Fields

 | Name | Description
Public Field | AlphaKey | Specifies the key of the key/data pair for the alpha property.
Public Field | DiffuseColorKey | Specifies the key of the key/data pair for the material diffuse color.
Public Field | EmissiveColorKey | Specifies the key of the key/data pair for the material emissive color.
Public Field | EnvironmentMapAmountKey | Specifies the key of the key/data pair for the amount of the environment map color to blend.
Public Field | EnvironmentMapKey | Specifies the key of the key/data pair for the current environment map texture.
Public Field | EnvironmentMapSpecularKey | Specifies the key of the key/data pair for the amount of the environment map alpha value to add.
Public Field | FresnelFactorKey | Specifies the key of the key/data pair for the fresnel factor.
Public Field | TextureKey | Specifies the key of the key/data pair for the current texture.

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EnvironmentMapMaterialContent.AlphaKey Field

EnvironmentMapMaterialContent.AlphaKey Field

Specifies the key of the key/data pair for the alpha property.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string AlphaKey

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.DiffuseColorKey Field

EnvironmentMapMaterialContent.DiffuseColorKey Field

Specifies the key of the key/data pair for the material diffuse color.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string DiffuseColorKey

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.EmissiveColorKey Field

EnvironmentMapMaterialContent.EmissiveColorKey Field

Specifies the key of the key/data pair for the material emissive color.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string EmissiveColorKey

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.EnvironmentMapAmountKey Field

EnvironmentMapMaterialContent.EnvironmentMapAmountKey Field

Specifies the key of the key/data pair for the amount of the environment map color to blend.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string EnvironmentMapAmountKey

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.EnvironmentMapKey Field

EnvironmentMapMaterialContent.EnvironmentMapKey Field

Specifies the key of the key/data pair for the current environment map texture.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string EnvironmentMapKey

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.EnvironmentMapSpecularKey Field

EnvironmentMapMaterialContent.EnvironmentMapSpecularKey Field
See Also
CollapseAll image

Specifies the key of the key/data pair for the amount of the environment map alpha value to add.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string EnvironmentMapSpecularKey

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.FresnelFactorKey Field

EnvironmentMapMaterialContent.FresnelFactorKey Field

Specifies the key of the key/data pair for the fresnel factor.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string FresnelFactorKey

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.TextureKey Field

EnvironmentMapMaterialContent.TextureKey Field

Specifies the key of the key/data pair for the current texture.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string TextureKey

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent Constructor

EnvironmentMapMaterialContent Constructor

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public EnvironmentMapMaterialContent ()

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent Methods

EnvironmentMapMaterialContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EnvironmentMapMaterialContent Properties

EnvironmentMapMaterialContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha.
Public Property | DiffuseColor | Gets or sets the material diffuse color, which ranges from 0 to 1.
Public Property | EmissiveColor | Gets or sets the emissive color of the effect material.
Public Property | EnvironmentMap | Gets or sets the current environment map texture.
Public Property | EnvironmentMapAmount | Gets or sets the amount of the environment map color (RGB) that will be blended over the base texture. The value ranges from 0 to 1; the default value is 1.
Public Property | EnvironmentMapSpecular | Gets or sets the amount of the environment map alpha value that will be added to the base texture. The value ranges from 0 to 1; the default value is 0.
Public Property | FresnelFactor | Gets or sets the Fresnel factor used for the environment map blending.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Texture | Gets or sets the current texture.
Public Property | Textures | (Inherited from MaterialContent.)

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


EnvironmentMapMaterialContent.Alpha Property

EnvironmentMapMaterialContent.Alpha Property

Gets or sets the material alpha.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<float> Alpha { get; set; }

Property Value

The material's alpha value.

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.DiffuseColor Property

EnvironmentMapMaterialContent.DiffuseColor Property

Gets or sets the material diffuse color, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> DiffuseColor { get; set; }

Property Value

The material's diffuse color.

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.EmissiveColor Property

EnvironmentMapMaterialContent.EmissiveColor Property

Gets or sets the emissive color of the effect material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> EmissiveColor { get; set; }

Property Value

The emissive color of the effect material. Valid values are between 0 and 1.

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.EnvironmentMap Property

EnvironmentMapMaterialContent.EnvironmentMap Property

Gets or sets the current environment map texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference<TextureContent> EnvironmentMap { get; set; }

Property Value

The environment map texture.

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.EnvironmentMapAmount Property

EnvironmentMapMaterialContent.EnvironmentMapAmount Property

Gets or sets the amount of the environment map color (RGB) that will be blended over the base texture. The value ranges from 0 to 1; the default value is 1.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<float> EnvironmentMapAmount { get; set; }

Property Value

The RGB blend factor.

Expand image Remarks

If set to zero, the RGB channels of the environment map will be completely ignored (the environment map alpha may still be visible if EnvironmentMapSpecular is greater than zero).

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.EnvironmentMapSpecular Property

EnvironmentMapMaterialContent.EnvironmentMapSpecular Property
See Also
CollapseAll image

Gets or sets the amount of the environment map alpha value that will be added to the base texture. The value ranges from 0 to 1; the default value is 0.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> EnvironmentMapSpecular { get; set; }

Property Value

The environment map alpha value.

Expand image Remarks

Use this value to implement cheap specular lighting, by encoding one or more specular highlight patterns into the environment map alpha channel, then setting the EnvironmentMapSpecular to the desired specular light color.

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.FresnelFactor Property

EnvironmentMapMaterialContent.FresnelFactor Property

Gets or sets the Fresnel factor used for the environment map blending.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<float> FresnelFactor { get; set; }

Property Value

The Fresnel factor.

Expand image Remarks

The default value is 1. Use 0 to disable Fresnel lighting; this makes the environment map visible independent of the viewing angle. Use a higher value to make the environment map visible around silhouette edges; use a lower value to make the environment map visible everywhere. Fresnel lighting only affects the environment map color (RGB values), alpha is not affected. Control the intensity of the color values using EnvironmentMapAmount; control the intensity of the alpha value with EnvironmentMapSpecular.

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EnvironmentMapMaterialContent.Texture Property

EnvironmentMapMaterialContent.Texture Property

Gets or sets the current texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference<TextureContent> Texture { get; set; }

Property Value

The current texture.

Expand image See Also

Reference

EnvironmentMapMaterialContent Class
EnvironmentMapMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription Class

FontDescription Class
See Also Members
CollapseAll image

Provides information to the FontDescriptionProcessor describing which font to rasterize, which font size to utilize, and which Unicode characters to include in the processor output.
Note
As with most types of software, font files are licensed rather than sold. Font licenses vary from vendor to vendor, but most don't allow redistribution of the fonts, and that includes redistribution of reproductions such as bitmaps containing the rasterized character set. This is even true of many of the licenses covering fonts that Microsoft supplies with applications and Windows. Be careful, therefore, to ensure that you have the required license rights to redistribute any font you include as a bitmap containing the rasterized character set in your game!

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class FontDescription : ContentItem

Expand image See Also

Reference

FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription Members

FontDescription Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the FontDescription type.

Expand image Public Constructors

 | Name | Description
Public Method | FontDescription | Overloaded. Initializes a new instance of FontDescription.

Expand image Public Properties

 | Name | Description
Public Property | Characters | Gets the collection of characters provided by this FontDescription.
Public Property | DefaultCharacter | Gets or sets the default character for the font.
Public Property | FontName | Gets or sets the name of the font, such as "Times New Roman" or "Arial". This value cannot be null or empty.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Size | Gets or sets the size, in points, of the font.
Public Property | Spacing | Gets or sets the amount of space, in pixels, to insert between letters in a string.
Public Property | Style | Gets or sets the style of the font, expressed as a combination of one or more FontDescriptionStyle flags.
Public Property | UseKerning | Indicates if kerning information is used when drawing characters.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FontDescription Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


FontDescription Constructor

FontDescription Constructor

Initializes a new instance of FontDescription.

Expand image Overload List

Name | Description
FontDescription (String, Single, Single) | Initializes a new instance of FontDescription and initializes its members to the specified font, size, and spacing, using FontDescriptionStyle.Regular as the default value for Style.
FontDescription (String, Single, Single, FontDescriptionStyle) | Initializes a new instance of FontDescription and initializes its members to the specified font, size, spacing, and style.
FontDescription (String, Single, Single, FontDescriptionStyle, Boolean) | Initializes a new instance of FontDescription using the specified values.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


FontDescription Constructor (String, Single, Single)

FontDescription Constructor (String, Single, Single)
See Also
CollapseAll image

Initializes a new instance of FontDescription and initializes its members to the specified font, size, and spacing, using FontDescriptionStyle.Regular as the default value for Style.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public FontDescription (
         string fontName,
         float size,
         float spacing
)

Parameters

fontName
The name of the font, such as Times New Roman.
size
The size, in points, of the font.
spacing
The amount of space, in pixels, to insert between letters in a string.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | fontName is null or an empty string.
ArgumentOutOfRangeException | size is less than or equal to zero. Specify a value for this parameter that is greater than zero.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription Constructor (String, Single, Single, FontDescriptionStyle)

FontDescription Constructor (String, Single, Single, FontDescriptionStyle)
See Also
CollapseAll image

Initializes a new instance of FontDescription and initializes its members to the specified font, size, spacing, and style.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public FontDescription (
         string fontName,
         float size,
         float spacing,
         FontDescriptionStyle fontStyle
)

Parameters

fontName
The name of the font, such as Times New Roman.
size
The size, in points, of the font.
spacing
The amount of space, in pixels, to insert between letters in a string.
fontStyle
The font style for the font.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | fontName is null or an empty string.
ArgumentOutOfRangeException | size is less than or equal to zero. Specify a value for this parameter that is greater than zero.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription Constructor (String, Single, Single, FontDescriptionStyle, Boolean)

FontDescription Constructor (String, Single, Single, FontDescriptionStyle, Boolean)
See Also
CollapseAll image

Initializes a new instance of FontDescription using the specified values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public FontDescription (
         string fontName,
         float size,
         float spacing,
         FontDescriptionStyle fontStyle,
         bool useKerning
)

Parameters

fontName
The name of the font, such as Times New Roman.
size
The size, in points, of the font.
spacing
The amount of space, in pixels, to insert between letters in a string.
fontStyle
The font style for the font.
useKerning
true if kerning information is used when drawing characters; false otherwise.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription Methods

FontDescription Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FontDescription Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


FontDescription Properties

FontDescription Properties

Expand image Public Properties

 | Name | Description
Public Property | Characters | Gets the collection of characters provided by this FontDescription.
Public Property | DefaultCharacter | Gets or sets the default character for the font.
Public Property | FontName | Gets or sets the name of the font, such as "Times New Roman" or "Arial". This value cannot be null or empty.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Size | Gets or sets the size, in points, of the font.
Public Property | Spacing | Gets or sets the amount of space, in pixels, to insert between letters in a string.
Public Property | Style | Gets or sets the style of the font, expressed as a combination of one or more FontDescriptionStyle flags.
Public Property | UseKerning | Indicates if kerning information is used when drawing characters.

Expand image See Also

Reference

FontDescription Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


FontDescription.Characters Property

FontDescription.Characters Property

Gets the collection of characters provided by this FontDescription.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentSerializerIgnoreAttribute]
public ICollection<char> Characters { get; }

Property Value

The collection of characters.

Expand image Remarks

Characters can be used to change the characters provided by this FontDescription.

The Characters collection keeps track of duplicates automatically. It is not necessary for the user to make sure that each letter is added only once. The Characters collection will contain only one instance of each character, no matter how many times you call Add.

This collection of characters can be used to implement processing for a message file. A custom processor could read the message file, which would contain all of the text that the game will need to print, and add each character it finds to Characters.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Concepts

How to: Extend the Font Description Processor to Support Additional Characters

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription.DefaultCharacter Property

FontDescription.DefaultCharacter Property

Gets or sets the default character for the font.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentSerializerAttribute]
public Nullable<char> DefaultCharacter { get; set; }

Property Value

The default character for this font.

Expand image Remarks

If set to anything other than null, this character will be automatically substituted any time an attempt is made to draw or measure characters that are not in the font.

If set to null, missing characters will produce an exception.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription.FontName Property

FontDescription.FontName Property

Gets or sets the name of the font, such as "Times New Roman" or "Arial". This value cannot be null or empty.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string FontName { get; set; }

Property Value

The name of the font.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | FontName is null or an empty string.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription.Size Property

FontDescription.Size Property

Gets or sets the size, in points, of the font.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public float Size { get; set; }

Property Value

The size, in points, of the font.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | Size is less than or equal to zero. Specify a value for this property that is greater than zero.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription.Spacing Property

FontDescription.Spacing Property

Gets or sets the amount of space, in pixels, to insert between letters in a string.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public float Spacing { get; set; }

Property Value

The amount of space, in pixels, to insert between letters in a string.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | Spacing is less than or equal to zero. Specify a value for this property that is greater than zero.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription.Style Property

FontDescription.Style Property

Gets or sets the style of the font, expressed as a combination of one or more FontDescriptionStyle flags.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public FontDescriptionStyle Style { get; set; }

Property Value

The style of the font, expressed as a combination of one or more FontDescriptionStyle flags.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescription.UseKerning Property

FontDescription.UseKerning Property

Indicates if kerning information is used when drawing characters.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentSerializerAttribute]
public bool UseKerning { get; set; }

Property Value

true if kerning information should be used when drawing characters; false otherwise.

Expand image See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescriptionStyle Enumeration

FontDescriptionStyle Enumeration

Flags that describe style information to be applied to text.

You can combine these flags by using a bitwise OR operator (|).

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public enum FontDescriptionStyle

Expand image Members

Member name | Description
Bold | Bold text.
Italic | Italic text.
Regular | Normal text.

Expand image See Also

Reference

Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GeometryContent Class

GeometryContent Class
See Also Members
CollapseAll image

Provides properties that define various aspects of a geometry batch.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class GeometryContent : ContentItem

Expand image Remarks

A geometry batch is a subcomponent of a mesh, representing a single piece of homogeneous geometry that can be submitted to the GPU in a single draw call. It contains an indexed triangle list (using a single material) where all vertices share the same set of data channels. Vertices are made unique if there are differences in any of their data channels. Coordinates that require unique vertices on either side of a join create unique vertices.

Expand image See Also

Reference

GeometryContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GeometryContent Members

GeometryContent Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the GeometryContent type.

Expand image Public Constructors

 | Name | Description
Public Method | GeometryContent | Creates an instance of GeometryContent.

Expand image Public Properties

 | Name | Description
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Indices | Gets the list of triangle indices for this geometry batch.
Public Property | Material | Gets or sets the material of the parent mesh.
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Parent | Gets or sets the parent MeshContent for this object.
Public Property | Vertices | Gets the set of vertex batches for the geometry batch.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GeometryContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


GeometryContent Constructor

GeometryContent Constructor

Creates an instance of GeometryContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public GeometryContent ()

Expand image See Also

Reference

GeometryContent Class
GeometryContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GeometryContent Methods

GeometryContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GeometryContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


GeometryContent Properties

GeometryContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Indices | Gets the list of triangle indices for this geometry batch.
Public Property | Material | Gets or sets the material of the parent mesh.
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Parent | Gets or sets the parent MeshContent for this object.
Public Property | Vertices | Gets the set of vertex batches for the geometry batch.

Expand image See Also

Reference

GeometryContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


GeometryContent.Indices Property

GeometryContent.Indices Property

Gets the list of triangle indices for this geometry batch. Geometry is stored as an indexed triangle list, where each group of three indices defines a single triangle.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IndexCollection Indices { get; }

Property Value

Collection of associated indices.

Expand image Remarks

Use these indices to reference into the collection of position indices and vertex channels of the geometry batch.

Expand image See Also

Reference

GeometryContent Class
GeometryContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GeometryContent.Material Property

GeometryContent.Material Property

Gets or sets the material of the parent mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MaterialContent Material { get; set; }

Property Value

Parent mesh of the geometry batch.

Expand image See Also

Reference

GeometryContent Class
GeometryContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GeometryContent.Parent Property

GeometryContent.Parent Property

Gets or sets the parent MeshContent for this object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MeshContent Parent { get; set; }

Property Value

Mesh content of the geometry batch.

Expand image See Also

Reference

GeometryContent Class
GeometryContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GeometryContent.Vertices Property

GeometryContent.Vertices Property

Gets the set of vertex batches for the geometry batch.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexContent Vertices { get; }

Property Value

List of associated vertex contents.

Expand image See Also

Reference

GeometryContent Class
GeometryContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GeometryContentCollection Class

GeometryContentCollection Class
See Also Members
CollapseAll image

Provides methods for maintaining a collection of geometry batches that make up a mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class GeometryContentCollection : ChildCollection<MeshContent, GeometryContent>

Expand image See Also

Reference

GeometryContentCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GeometryContentCollection Members

GeometryContentCollection Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the GeometryContentCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from ChildCollection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetParent | Gets the parent of a child object.
Protected Method | GetParent | (Inherited from ChildCollection.)
Protected Method | InsertItem | (Inherited from ChildCollection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from ChildCollection.)
Protected Method | SetItem | (Inherited from ChildCollection.)
Protected Method | SetParent | Sets the parent of the specified child object.
Protected Method | SetParent | (Inherited from ChildCollection.)

Expand image See Also

Reference

GeometryContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


GeometryContentCollection Methods

GeometryContentCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from ChildCollection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetParent | Gets the parent of a child object.
Protected Method | GetParent | (Inherited from ChildCollection.)
Protected Method | InsertItem | (Inherited from ChildCollection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from ChildCollection.)
Protected Method | SetItem | (Inherited from ChildCollection.)
Protected Method | SetParent | Sets the parent of the specified child object.
Protected Method | SetParent | (Inherited from ChildCollection.)

Expand image See Also

Reference

GeometryContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


GeometryContentCollection.GetParent Method

GeometryContentCollection.GetParent Method

Gets the parent of a child object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override MeshContent GetParent (
         GeometryContent child
)

Parameters

child
The child of the parent being retrieved.

Return Value

The parent of the child object.

Expand image See Also

Reference

GeometryContentCollection Class
GeometryContentCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GeometryContentCollection.SetParent Method

GeometryContentCollection.SetParent Method

Sets the parent of the specified child object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void SetParent (
         GeometryContent child,
         MeshContent parent
)

Parameters

child
The child of the parent being retrieved.
parent
The parent of the child object.

Expand image See Also

Reference

GeometryContentCollection Class
GeometryContentCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GeometryContentCollection Properties

GeometryContentCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image See Also

Reference

GeometryContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


IndexCollection Class

IndexCollection Class
See Also Members
CollapseAll image

Provides methods for maintaining a list of index values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class IndexCollection : Collection<int>

Expand image See Also

Reference

IndexCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IndexCollection Members

IndexCollection Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the IndexCollection type.

Expand image Public Constructors

 | Name | Description
Public Method | IndexCollection | Initializes a new instance of IndexCollection.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | AddRange | Appends the specified indices into the collection.
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

IndexCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


IndexCollection Constructor

IndexCollection Constructor

Initializes a new instance of IndexCollection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IndexCollection ()

Expand image See Also

Reference

IndexCollection Class
IndexCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IndexCollection Methods

IndexCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | AddRange | Appends the specified indices into the collection.
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

IndexCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


IndexCollection.AddRange Method

IndexCollection.AddRange Method

Appends the specified indices into the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void AddRange (
         IEnumerable<int> indices
)

Parameters

indices
Index into the Positions member of the parent.

Expand image See Also

Reference

IndexCollection Class
IndexCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IndexCollection Properties

IndexCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image See Also

Reference

IndexCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


IndirectPositionCollection Class

IndirectPositionCollection Class
See Also Members
CollapseAll image

Provides methods for maintaining a list of vertex positions.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class IndirectPositionCollection : IList<Vector3>, ICollection<Vector3>, IEnumerable<Vector3>, IEnumerable

Expand image Remarks

This class is designed to collect the vertex positions for a VertexContent object. Use the contents of the PositionIndices property (of the contained VertexContent object) to index into the Positions property of the parent mesh.

Expand image See Also

Reference

IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IndirectPositionCollection Members

IndirectPositionCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the IndirectPositionCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Number of positions in the collection.
Public Property | Item | Gets or sets the position at the specified index.

Expand image Public Methods

 | Name | Description
Public Method | Contains | Determines whether the specified position is in the collection.
Public Method | CopyTo | Copies the specified positions to an array, starting at the specified index.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator interface for reading the position values.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Gets the index of the specified position in a collection.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.IsReadOnly | Gets a value indicating whether this object is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Add | Adds a new element to the end of the collection.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Clear | Removes all elements from the collection.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that can iterate through the collection.
Explicit Interface Implementation | System.Collections.Generic.IList<Microsoft.Xna.Framework.Vector3>.Insert | Inserts a new element into the collection.
Explicit Interface Implementation | System.Collections.Generic.IList<Microsoft.Xna.Framework.Vector3>.RemoveAt | Removes the element at the specified index position.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Remove | Removes the specified element from the collection.

Expand image See Also

Reference

IndirectPositionCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


IndirectPositionCollection Methods

IndirectPositionCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | Determines whether the specified position is in the collection.
Public Method | CopyTo | Copies the specified positions to an array, starting at the specified index.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator interface for reading the position values.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Gets the index of the specified position in a collection.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.IsReadOnly | Gets a value indicating whether this object is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Add | Adds a new element to the end of the collection.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Clear | Removes all elements from the collection.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that can iterate through the collection.
Explicit Interface Implementation | System.Collections.Generic.IList<Microsoft.Xna.Framework.Vector3>.Insert | Inserts a new element into the collection.
Explicit Interface Implementation | System.Collections.Generic.IList<Microsoft.Xna.Framework.Vector3>.RemoveAt | Removes the element at the specified index position.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Remove | Removes the specified element from the collection.

Expand image See Also

Reference

IndirectPositionCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


IndirectPositionCollection.Contains Method

IndirectPositionCollection.Contains Method

Determines whether the specified position is in the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Contains (
         Vector3 item
)

Parameters

item
Position being searched for in the collection.

Return Value

true if the position was found; false otherwise.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IndirectPositionCollection.CopyTo Method

IndirectPositionCollection.CopyTo Method

Copies the specified positions to an array, starting at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void CopyTo (
         Vector3[] array,
         int arrayIndex
)

Parameters

array
Array of positions to be copied.
arrayIndex
Index of the first copied position.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IndirectPositionCollection.GetEnumerator Method

IndirectPositionCollection.GetEnumerator Method

Gets an enumerator interface for reading the position values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IEnumerator<Vector3> GetEnumerator ()

Return Value

Interface for enumerating the collection of position values.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IndirectPositionCollection.IndexOf Method

IndirectPositionCollection.IndexOf Method

Gets the index of the specified position in a collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int IndexOf (
         Vector3 item
)

Parameters

item
Position being searched for.

Return Value

Index of the specified position.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Add Method

System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Add Method
See Also
CollapseAll image

Adds a new element to the end of the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Add (
         Vector3 item
)

Parameters

item
The item to add.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Clear Method

System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Clear Method
See Also
CollapseAll image

Removes all elements from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Clear ()

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Remove Method

System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Remove Method
See Also
CollapseAll image

Removes the specified element from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.Remove (
         Vector3 item
)

Parameters

item
The item to be removed.

Return Value

true if the element was removed; false otherwise.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.IList<Microsoft.Xna.Framework.Vector3>.Insert Method

System.Collections.Generic.IList<Microsoft.Xna.Framework.Vector3>.Insert Method
See Also
CollapseAll image

Inserts a new element into the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.IList<Microsoft.Xna.Framework.Vector3>.Insert (
         int index,
         Vector3 item
)

Parameters

index
Index for element insertion.
item
Element to insert.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.IList<Microsoft.Xna.Framework.Vector3>.RemoveAt Method

System.Collections.Generic.IList<Microsoft.Xna.Framework.Vector3>.RemoveAt Method
See Also
CollapseAll image

Removes the element at the specified index position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.IList<Microsoft.Xna.Framework.Vector3>.RemoveAt (
         int index
)

Parameters

index
Index of the element to be removed.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that can iterate through the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

Enumerator that can iterate through the collection.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IndirectPositionCollection Properties

IndirectPositionCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Number of positions in the collection.
Public Property | Item | Gets or sets the position at the specified index.

Expand image See Also

Reference

IndirectPositionCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


IndirectPositionCollection.Count Property

IndirectPositionCollection.Count Property

Number of positions in the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of positions.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IndirectPositionCollection.Item Property

IndirectPositionCollection.Item Property

Gets or sets the position at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Vector3 this [
         int index
] { get; set; }

Property Value

Position located at index.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IndirectPositionCollection.System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.IsReadOnly Property

IndirectPositionCollection.System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.IsReadOnly Property
See Also
CollapseAll image

Gets a value indicating whether this object is read-only.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Vector3>.IsReadOnly { get; }

Property Value

true if this object is read-only; false otherwise.

Expand image See Also

Reference

IndirectPositionCollection Class
IndirectPositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialContent Class

MaterialContent Class
See Also Members
CollapseAll image

Provides methods and properties for maintaining a collection of named texture references.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class MaterialContent : ContentItem

Expand image Remarks

In addition to texture references, opaque data values are stored in the OpaqueData property of the base class.

Expand image See Also

Reference

MaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialContent Members

MaterialContent Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the MaterialContent type.

Expand image Public Constructors

 | Name | Description
Public Method | MaterialContent | Initializes a new instance of MaterialContent.

Expand image Public Properties

 | Name | Description
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Textures | Gets the texture collection of the material.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | Gets a reference type from the OpaqueDataDictionary collection.
Protected Method | GetTexture | Gets a value from the Textures collection.
Protected Method | GetValueTypeProperty | Gets a value type from the OpaqueDataDictionary collection.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | Sets a value in the contained OpaqueDataDictionary object.
Protected Method | SetTexture | Sets a value in the contained TextureReferenceDictionary object.

Expand image See Also

Reference

MaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MaterialContent Constructor

MaterialContent Constructor

Initializes a new instance of MaterialContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MaterialContent ()

Expand image See Also

Reference

MaterialContent Class
MaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialContent Methods

MaterialContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | Gets a reference type from the OpaqueDataDictionary collection.
Protected Method | GetTexture | Gets a value from the Textures collection.
Protected Method | GetValueTypeProperty | Gets a value type from the OpaqueDataDictionary collection.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | Sets a value in the contained OpaqueDataDictionary object.
Protected Method | SetTexture | Sets a value in the contained TextureReferenceDictionary object.

Expand image See Also

Reference

MaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MaterialContent.GetReferenceTypeProperty Generic Method

MaterialContent.GetReferenceTypeProperty Generic Method

Gets a reference type from the OpaqueDataDictionary collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected T GetReferenceTypeProperty<T> (
         string key
) where T : class

Type Parameters

T
Type of the related opaque data.

Parameters

key
Key of the property being retrieved.

Return Value

The related opaque data.

Expand image See Also

Reference

MaterialContent Class
MaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialContent.GetTexture Method

MaterialContent.GetTexture Method

Gets a value from the Textures collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ExternalReference<TextureContent> GetTexture (
         string key
)

Parameters

key
Key of the texture being retrieved.

Return Value

Reference to a texture from the collection.

Expand image See Also

Reference

MaterialContent Class
MaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialContent.GetValueTypeProperty Generic Method

MaterialContent.GetValueTypeProperty Generic Method

Gets a value type from the OpaqueDataDictionary collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected Nullable<T> GetValueTypeProperty<T> (
         string key
) where T : ValueType

Type Parameters

T
Type of the value being retrieved.

Parameters

key
Key of the value type being retrieved.

Return Value

Index of the value type beng retrieved.

Expand image See Also

Reference

MaterialContent Class
MaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialContent.SetProperty Generic Method

MaterialContent.SetProperty Generic Method

Sets a value in the contained OpaqueDataDictionary object.

If null is passed, the value is removed.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected void SetProperty<T> (
         string key,
         T value
)

Type Parameters

T
Type of the element being set.

Parameters

key
Name of the key being modified.
value
Value being set.

Expand image See Also

Reference

MaterialContent Class
MaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialContent.SetTexture Method

MaterialContent.SetTexture Method

Sets a value in the contained TextureReferenceDictionary object.

If null is passed, the value is removed.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected void SetTexture (
         string key,
         ExternalReference<TextureContent> value
)

Parameters

key
Name of the key being modified.
value
Value being set.

Expand image Remarks

The key value differs depending on the type of attached dictionary.

If attached to a BasicMaterialContent dictionary (which becomes a BasicEffect object at run time), the value for the Texture key is used as the texture for the BasicEffect runtime object. Other keys are ignored.

If attached to a EffectMaterialContent dictionary, key names are the texture names used by the effect. These names are dependent upon the author of the effect object.

Expand image See Also

Reference

MaterialContent Class
MaterialContent Members
Texture
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialContent Properties

MaterialContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Textures | Gets the texture collection of the material.

Expand image See Also

Reference

MaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MaterialContent.Textures Property

MaterialContent.Textures Property

Gets the texture collection of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TextureReferenceDictionary Textures { get; }

Property Value

Collection of textures used by the material.

Expand image See Also

Reference

MaterialContent Class
MaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder Class

MeshBuilder Class
See Also Members
CollapseAll image

Provides support for writing a custom importer for mesh objects.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class MeshBuilder

Expand image Remarks

MeshBuilder is designed to make it easier to write importers. It creates an abstraction of the internal workings of the MeshContent, and GeometryContent classes and provides a simple way to create a mesh object.

There are three steps to creating a mesh.

  1. Call StartMesh to get a MeshBuilder object. To initialize this object, fill the positions buffer with data by using the CreatePosition function. After retrieving the positions data, call the CreateVertexChannel generic function to specify the types of vertex channels needed—for example, normals, UVs, and color channels.

    Note
    The PositionCollection property of a MeshContent object is created automatically. There is no need to explicitly declare a VertexChannel object for positions.

  2. After setting up the position and vertex data channel buffers, begin creating triangles. Use SetMaterial and SetOpaqueData to set the data of each triangle, and use SetVertexChannelData to set the individual vertex data of each triangle. After setting this data, call AddTriangleVertex for each vertex of each triangle.

    Note
    If you call CreatePosition or CreateVertexChannel after calling AddTriangleVertex, an InvalidOperationException exception is thrown.
  3. In the final step, call FinishMesh. After this call, the mesh is optimized automatically with calls to MergeDuplicateVertices and CalculateNormals.

For a complete example of this procedure, download the Generated Geometry Sample from the Creators Club Online website and load the solution. Open the TerrainProcessor.cs file and examine the Process method. This method implements the steps listed above.

Expand image See Also

Conceptual

Reference

MeshBuilder Members
GeometryContent
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder Members

MeshBuilder Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the MeshBuilder type.

Expand image Public Properties

 | Name | Description
Public Property | MergeDuplicatePositions | Gets or sets the current value for position merging of the mesh.
Public Property | MergePositionTolerance | Gets or sets the tolerance for MergeDuplicatePositions.
Public Property | Name | Gets or sets the name of the current MeshContent object being processed.
Public Property | SwapWindingOrder | Reverses the triangle winding order of the specified mesh.

Expand image Public Methods

 | Name | Description
Public Method | AddTriangleVertex | Adds a vertex into the index collection.
Public Method | CreatePosition | Overloaded. Inserts the specified vertex position into the vertex channel.
Public Method | CreateVertexChannel | Creates a vertex data channel for use by the mesh.
Public Method | Equals | (Inherited from Object.)
Public Method | FinishMesh | Ends the creation of a mesh.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetMaterial | Specifies the material used by the current mesh.
Public Method | SetOpaqueData | Initializes the opaque data for a specific mesh object.
Public Method | SetVertexChannelData | Sets the specified vertex data with new data.
 | StartMesh | Initializes the creation of a mesh.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MeshBuilder Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MeshBuilder Methods

MeshBuilder Methods

Expand image Public Methods

 | Name | Description
Public Method | AddTriangleVertex | Adds a vertex into the index collection.
Public Method | CreatePosition | Overloaded. Inserts the specified vertex position into the vertex channel.
Public Method | CreateVertexChannel | Creates a vertex data channel for use by the mesh.
Public Method | Equals | (Inherited from Object.)
Public Method | FinishMesh | Ends the creation of a mesh.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | SetMaterial | Specifies the material used by the current mesh.
Public Method | SetOpaqueData | Initializes the opaque data for a specific mesh object.
Public Method | SetVertexChannelData | Sets the specified vertex data with new data.
 | StartMesh | Initializes the creation of a mesh.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MeshBuilder Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MeshBuilder.AddTriangleVertex Method

MeshBuilder.AddTriangleVertex Method

Adds a vertex into the index collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void AddTriangleVertex (
         int indexIntoVertexCollection
)

Parameters

indexIntoVertexCollection
Index of the inserted vertex, in the collection. This corresponds to the value returned by CreatePosition.

Expand image Remarks

MeshBuilder supports triangle lists only. Therefore, calls to AddTriangleVertex must occur in groups of three. In addition, MeshBuilder automatically determines which GeometryContent object receives the current triangle based on the state data. This data is set by the last calls to SetMaterial and SetOpaqueData.

This means that per-vertex material and opaque data are not supported. Therefore, do not call SetMaterial or SetOpaqueData when defining a triangle. For an example of the proper method, see the MeshBuilder class overview.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.CreatePosition Method

MeshBuilder.CreatePosition Method

Inserts the specified vertex position into the vertex channel.

Expand image Overload List

Name | Description
MeshBuilder.CreatePosition (Single, Single, Single) | Inserts the specified vertex position into the vertex channel.
MeshBuilder.CreatePosition (Vector3) | Inserts the specified vertex position into the vertex channel at the specified index.

Expand image Remarks

These vertices are shared between the mesh's geometry objects, preserving the topology information. For example, two different geometries could reference the same position, but have a different material, texture coordinates, and normals.

In most cases, the index returned by CreatePosition is based on the number of times this function has been called. For example, CreatePosition returns 0 on the first call, 1 on the second call, and so forth. Therefore, if you call CreatePosition for each vertex in your vertex collection, your vertex collection and the Positions collection of the finished MeshContent object are parallel, assuming MergeDuplicatePositions doesn't find anything to merge.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MeshBuilder.CreatePosition Method (Single, Single, Single)

MeshBuilder.CreatePosition Method (Single, Single, Single)
See Also
CollapseAll image

Inserts the specified vertex position into the vertex channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int CreatePosition (
         float x,
         float y,
         float z
)

Parameters

x
Value of the x component of the vector.
y
Value of the y component of the vector.
z
Value of the z component of the vector.

Return Value

Index of the inserted vertex.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.CreatePosition Method (Vector3)

MeshBuilder.CreatePosition Method (Vector3)
See Also
CollapseAll image

Inserts the specified vertex position into the vertex channel at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int CreatePosition (
         Vector3 pos
)

Parameters

pos
Value of the vertex being inserted.

Return Value

Index of the vertex being inserted.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.CreateVertexChannel Generic Method

MeshBuilder.CreateVertexChannel Generic Method

Creates a vertex data channel for use by the mesh. Typically, the data channel holds texture coordinates, normals, and other per-vertex data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int CreateVertexChannel<T> (
         string usage
)

Type Parameters

T
Type of the data channel.

Parameters

usage

Describes how the channel is used. Use this parameter as a look-up into a VertexChannelCollection. It is strongly recommended that you choose a usage from the following list.

  • Binormal
  • Color
  • Normal
  • Tangent
  • TextureCoordinate
  • Weights

For more information, see VertexChannelNames.

Return Value

Index identifying the new data channel. Use this as a parameter when calling SetVertexChannelData.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.FinishMesh Method

MeshBuilder.FinishMesh Method

Ends the creation of a mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MeshContent FinishMesh ()

Return Value

Resultant mesh.

Expand image Remarks

Once called, FinishMesh optimizes the related mesh by calling MergeDuplicateVertices. In addition, mesh normals are generated (by calling CalculateNormals) if none currently exist.

Note
The related MeshBuilder object can no longer be used after this function is called.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
StartMesh
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.SetMaterial Method

MeshBuilder.SetMaterial Method

Specifies the material used by the current mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void SetMaterial (
         MaterialContent material
)

Parameters

material
The material to be used by the mesh.

Expand image Remarks

Sets the material used by the triangle being defined next. This material, in conjunction with SetOpaqueData, determines the GeometryContent object containing the next triangle. MeshBuilder maintains the material value for all future triangles. Therefore, if multiple triangles share the same material, you need only one call to SetMaterial.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.SetOpaqueData Method

MeshBuilder.SetOpaqueData Method

Initializes the opaque data for a specific mesh object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void SetOpaqueData (
         OpaqueDataDictionary opaqueData
)

Parameters

opaqueData
Opaque data to be applied to the GeometryContent object of the next triangle.

Expand image Remarks

The opaque data is used in conjunction with the current material (set with a call to SetMaterial) to determine the GeometryContent object that will contain the next triangle. MeshBuilder maintains the material value for all future triangles. Therefore, if multiple triangles share the same material, you need only one call to SetMaterial.

SetOpaqueData can be called only on GeometryContent and MeshContent objects.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.SetVertexChannelData Method

MeshBuilder.SetVertexChannelData Method

Sets the specified vertex data with new data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void SetVertexChannelData (
         int vertexDataIndex,
         Object channelData
)

Parameters

vertexDataIndex
Index of the vertex data channel being set. This should match the index returned by CreateVertexChannel.
channelData
New data values for the vertex data. The data type being set must match the data type for the vertex channel specified by vertexDataIndex.

Expand image Remarks

The following table lists the exceptions that can be thrown by this method:

Exception | Cause
KeyNotFoundException | If vertexDataIndex does not correspond to an actual vertex data channel created using CreateVertexChannel.
InvalidOperationException | If the type of channelData does not match the data type for the vertex channel specified by vertexDataIndex.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.StartMesh Method

MeshBuilder.StartMesh Method

Initializes the creation of a mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static MeshBuilder StartMesh (
         string name
)

Parameters

name
Name of the mesh.

Return Value

Object used when building the mesh.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
FinishMesh
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder Properties

MeshBuilder Properties

Expand image Public Properties

 | Name | Description
Public Property | MergeDuplicatePositions | Gets or sets the current value for position merging of the mesh.
Public Property | MergePositionTolerance | Gets or sets the tolerance for MergeDuplicatePositions.
Public Property | Name | Gets or sets the name of the current MeshContent object being processed.
Public Property | SwapWindingOrder | Reverses the triangle winding order of the specified mesh.

Expand image See Also

Reference

MeshBuilder Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MeshBuilder.MergeDuplicatePositions Property

MeshBuilder.MergeDuplicatePositions Property

Gets or sets the current value for position merging of the mesh.

This can be used to preserve topology of unique vertices.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool MergeDuplicatePositions { get; set; }

Property Value

Current value of the property.

Expand image Remarks

If this property is enabled, every call to MeshBuilder.CreatePosition (Vector3) will check to see whether a position exists for which each component of that position varies no more than the current value of MergePositionTolerance from the new position. If one is found, the original position is used.

This property should be used in conjunction with MergePositionTolerance. The following code demonstrates this:

C#
      MeshBuilder b = MeshBuilder.StartMesh( "bill" );
      b.MergeDuplicatePositions = true;
      b.MergePositionTolerance = 1.0f;

      // Additional mesh building code here.

      MeshContent mesh = b.FinishMesh();

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.MergePositionTolerance Property

MeshBuilder.MergePositionTolerance Property

Gets or sets the tolerance for MergeDuplicatePositions. The default value is 0.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public float MergePositionTolerance { get; set; }

Property Value

Tolerance value used by the mesh.

Expand image Remarks

When MergeDuplicatePositions is enabled, each call to MeshBuilder.CreatePosition (Vector3) checks to see whether a position exists for which each component of that position varies no more than the current value of MergePositionTolerance from the new position. If one is found, the original position will be reused.

Note
Setting MergePositionTolerance does not also enable position merging. This must be enabled explicitly by calling MergeDuplicatePositions.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.Name Property

MeshBuilder.Name Property

Gets or sets the name of the current MeshContent object being processed. This is the same name as was passed in to StartMesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string Name { get; set; }

Property Value

Name of the MeshContent object.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshBuilder.SwapWindingOrder Property

MeshBuilder.SwapWindingOrder Property

Reverses the triangle winding order of the specified mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool SwapWindingOrder { get; set; }

Property Value

Current value of the winding order.

Expand image Remarks

If enabled, the triangles of the finished mesh are in the opposite order that they were given to the mesh builder. For example, if the vertices of two triangles were given as 123 456, they would be changed to 321 654. This can be useful if the source data was constructed with back-face culling set to something other than what the destination game engine expects.

The winding order is swapped when FinishMesh is called. Therefore, it is not necessary to modify the indices returned by CreatePosition.

Expand image See Also

Reference

MeshBuilder Class
MeshBuilder Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshContent Class

MeshContent Class
See Also Members
CollapseAll image

Provides properties and methods that define various aspects of a mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class MeshContent : NodeContent

Expand image Remarks

A mesh has the following characteristics:

  • It is not jointed. For example, the wheels of a car are separate meshes from the body mesh of the same car.
  • It may contain multiple materials. For example, the car body can be a single mesh even if the windshield component uses a different texture and shader as compared to the leather seat component of the car body.
  • Vertices containing different channels may be mixed in a single mesh. For example, the seat geometry includes tangent vectors but the windshield does not. However, using a single mesh preserves topological continuity (shared vertex identities) across material and vertex format boundaries.

Expand image See Also

Reference

MeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshContent Members

MeshContent Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the MeshContent type.

Expand image Public Constructors

 | Name | Description
Public Method | MeshContent | Initializes a new instance of MeshContent.

Expand image Public Properties

 | Name | Description
Public Property | AbsoluteTransform | (Inherited from NodeContent.)
Public Property | Animations | (Inherited from NodeContent.)
Public Property | Children | (Inherited from NodeContent.)
Public Property | Geometry | Gets the list of geometry batches for the mesh.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Parent | (Inherited from NodeContent.)
Public Property | Positions | Gets the list of vertex position values.
Public Property | Transform | (Inherited from NodeContent.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MeshContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MeshContent Constructor

MeshContent Constructor

Initializes a new instance of MeshContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MeshContent ()

Expand image See Also

Reference

MeshContent Class
MeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshContent Methods

MeshContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MeshContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MeshContent Properties

MeshContent Properties

Expand image Public Properties

 | Name | Description
Public Property | AbsoluteTransform | (Inherited from NodeContent.)
Public Property | Animations | (Inherited from NodeContent.)
Public Property | Children | (Inherited from NodeContent.)
Public Property | Geometry | Gets the list of geometry batches for the mesh.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Parent | (Inherited from NodeContent.)
Public Property | Positions | Gets the list of vertex position values.
Public Property | Transform | (Inherited from NodeContent.)

Expand image See Also

Reference

MeshContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MeshContent.Geometry Property

MeshContent.Geometry Property

Gets the list of geometry batches for the mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public GeometryContentCollection Geometry { get; }

Property Value

Collection of geometry batches.

Expand image See Also

Reference

MeshContent Class
MeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshContent.Positions Property

MeshContent.Positions Property

Gets the list of vertex position values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public PositionCollection Positions { get; }

Property Value

Collection of vertex positions.

Expand image See Also

Reference

MeshContent Class
MeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper Class

MeshHelper Class
See Also Members
CollapseAll image

Provides methods for manipulating mesh data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static class MeshHelper

Expand image See Also

Reference

MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper Members

MeshHelper Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the MeshHelper type.

Expand image Public Methods

Name | Description
CalculateNormals | Computes new normals for the specified mesh.
CalculateTangentFrames | Compute tangent frames for the given mesh.
FindSkeleton | Searches for the root bone of the contained skeleton.
FlattenSkeleton | Gets a flattened list of all bones contained by the specified skeleton.
MergeDuplicatePositions | Processes the PositionCollection collection of the specified mesh, merging any values that are closer together than the specified tolerance threshold.
MergeDuplicateVertices | Overloaded. Processes the Indices and VertexChannel data of the specified mesh or geometry batch, merging any duplicate vertices.
OptimizeForCache | Reorders the indices and vertices of the mesh for optimal GPU cache performance.
SwapWindingOrder | Reverses the triangle winding order of the specified mesh.
TransformScene | Applies a transformation to the contents of a scene hierarchy.

Expand image See Also

Reference

MeshHelper Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MeshHelper Methods

MeshHelper Methods

Expand image Public Methods

Name | Description
CalculateNormals | Computes new normals for the specified mesh.
CalculateTangentFrames | Compute tangent frames for the given mesh.
FindSkeleton | Searches for the root bone of the contained skeleton.
FlattenSkeleton | Gets a flattened list of all bones contained by the specified skeleton.
MergeDuplicatePositions | Processes the PositionCollection collection of the specified mesh, merging any values that are closer together than the specified tolerance threshold.
MergeDuplicateVertices | Overloaded. Processes the Indices and VertexChannel data of the specified mesh or geometry batch, merging any duplicate vertices.
OptimizeForCache | Reorders the indices and vertices of the mesh for optimal GPU cache performance.
SwapWindingOrder | Reverses the triangle winding order of the specified mesh.
TransformScene | Applies a transformation to the contents of a scene hierarchy.

Expand image See Also

Reference

MeshHelper Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MeshHelper.CalculateNormals Method

MeshHelper.CalculateNormals Method

Computes new normals for the specified mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void CalculateNormals (
         MeshContent mesh,
         bool overwriteExistingNormals
)

Parameters

mesh
Mesh containing the normals being computed.
overwriteExistingNormals
true if existing normals are to be discarded; false otherwise. Existing normals are searched for as if they are a vertex data channel (of type Vector3 Structure) with the name VertexChannelNames.Normal.

Expand image Remarks

The new normals are stored in vertex data channels (of type Vector3 Structure) with the name VertexChannelNames.Normal.

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper.CalculateTangentFrames Method

MeshHelper.CalculateTangentFrames Method

Compute tangent frames for the given mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void CalculateTangentFrames (
         MeshContent mesh,
         string textureCoordinateChannelName,
         string tangentChannelName,
         string binormalChannelName
)

Parameters

mesh
The target mesh used to create the tangent frame. All geometries in this mesh must have normal vertex channels stored in Normal, and must contain Vector3 data.
textureCoordinateChannelName
The texture coordinate channel used for computing the tangent frame. This channel most contain Vector2 data.
tangentChannelName
Target channel name used to store calculated tangents. A tangent channel is not generated if null or an empty string is specified.
binormalChannelName
Target channel name used to store calculated binormals. A tangent channel is not generated if null or an empty string is specified.

Expand image Remarks

This method computes and adds tangent and binormal vertex channels to the given mesh.

An InvalidContentException is thrown if:

  • The mesh does not contain a normal channel (stored in Normal).
  • The data specified in the normal channel is not a Vector3 type.
  • The vertex channel of the mesh does not have the name specified by textureCoordinateChannelName.
  • The data specified in the texture coordinate channel is not a Vector2 type.
  • The channel specified by tangentChannelName already exists.
  • The channel specified by binormalChannelName already exists.

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper.FindSkeleton Method

MeshHelper.FindSkeleton Method

Searches for the root bone of the contained skeleton. This node is used to animate the skeleton.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static BoneContent FindSkeleton (
         NodeContent node
)

Parameters

node
Mesh that possibly contains the skeleton.

Return Value

Root of the contained skeleton; otherwise null if no skeleton is found.

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper.FlattenSkeleton Method

MeshHelper.FlattenSkeleton Method

Gets a flattened list of all bones contained by the specified skeleton.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static IList<BoneContent> FlattenSkeleton (
         BoneContent skeleton
)

Parameters

skeleton
Skeleton to be traversed.

Return Value

List of bones for the animation skeleton.

Expand image Remarks

The tree is calculated using a depth–first traversal. The bones are returned in the same order used by ModelProcessor to convert BoneWeight vertex channels into the BlendIndices format.

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper.MergeDuplicatePositions Method

MeshHelper.MergeDuplicatePositions Method

Processes the PositionCollection collection of the specified mesh, merging any values that are closer together than the specified tolerance threshold.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void MergeDuplicatePositions (
         MeshContent mesh,
         float tolerance
)

Parameters

mesh
Mesh to be processed.
tolerance
Tolerance to be used when determining duplicate positions. Pass a value of 0 to merge only those values that are exactly identical.

Expand image Remarks

This method also updates the PositionIndices data to match the modified position table. This should generally be followed by a call to MergeDuplicateVertices.

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper.MergeDuplicateVertices Method

MeshHelper.MergeDuplicateVertices Method

Processes the Indices and VertexChannel data of the specified mesh or geometry batch, merging any duplicate vertices.

Expand image Overload List

Name | Description
MeshHelper.MergeDuplicateVertices (GeometryContent) | Processes the PositionIndices and VertexChannel data of the specified geometry batch, merging any duplicate vertices.
MeshHelper.MergeDuplicateVertices (MeshContent) | Processes the PositionIndices and VertexChannel data of the specified mesh, merging any duplicate vertices.

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MeshHelper.MergeDuplicateVertices Method (GeometryContent)

MeshHelper.MergeDuplicateVertices Method (GeometryContent)
See Also
CollapseAll image

Processes the PositionIndices and VertexChannel data of the specified geometry batch, merging any duplicate vertices.

This should generally be followed by a call to MergeDuplicatePositions.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void MergeDuplicateVertices (
         GeometryContent geometry
)

Parameters

geometry
Geometry batch to be processed.

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper.MergeDuplicateVertices Method (MeshContent)

MeshHelper.MergeDuplicateVertices Method (MeshContent)
See Also
CollapseAll image

Processes the PositionIndices and VertexChannel data of the specified mesh, merging any duplicate vertices.

This should generally be followed by a call to MergeDuplicatePositions.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void MergeDuplicateVertices (
         MeshContent mesh
)

Parameters

mesh
Mesh to be processed.

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper.OptimizeForCache Method

MeshHelper.OptimizeForCache Method

Reorders the indices and vertices of the mesh for optimal GPU cache performance.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void OptimizeForCache (
         MeshContent mesh
)

Parameters

mesh
Mesh to be optimized.

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper.SwapWindingOrder Method

MeshHelper.SwapWindingOrder Method

Reverses the triangle winding order of the specified mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void SwapWindingOrder (
         MeshContent mesh
)

Parameters

mesh
The mesh to be modified.

Expand image Remarks

Call this method when moving data between right-handed and left-handed coordinate systems, or when changing the direction of the back-face culling.

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MeshHelper.TransformScene Method

MeshHelper.TransformScene Method

Applies a transformation to the contents of a scene hierarchy.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void TransformScene (
         NodeContent scene,
         Matrix transform
)

Parameters

scene
Scene hierarchy being transformed.
transform
Matrix used in the transformation

Expand image Remarks

The resulting world space positions are similar to the results obtained from applying the specified transform to the Transform property of the scene object. However, this method performs the transformation by cascading down through the scene hierarchy and modifying the actual underlying vertex positions. This does not introduce unwanted artifacts into the node transforms. For instance, this method can be used to mirror a scene without leaving mirroring in the transform matrices.

Typically, you would convert a scene from a left-handed to a right-handed coordinate system and then transform it with the following matrix ((1, 0, 0), (0, 1, 0), (0, 0, −1)).

Expand image See Also

Reference

MeshHelper Class
MeshHelper Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChain Class

MipmapChain Class
See Also Members
CollapseAll image

Provides methods for accessing a mipmap chain.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class MipmapChain : Collection<BitmapContent>

Expand image Remarks

A mipmap chain consists of one or more individual 2D bitmaps, holding scaled versions of the same underlying image. For example, if the first entry was sized 256×128, the second would be 128×64, and the third 64×32.

Expand image See Also

Reference

MipmapChain Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChain Members

MipmapChain Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the MipmapChain type.

Expand image Public Constructors

 | Name | Description
Public Method | MipmapChain | Overloaded. Initializes a new instance of MipmapChain.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | InsertItem | Overloaded. Inserts a child object into the collection at the specified location.
 | op_Implicit | Constructs a new mipmap chain containing the specified bitmap.
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | SetItem | Overloaded. Modifies the specified child object in the collection.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

MipmapChain Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MipmapChain Constructor

MipmapChain Constructor

Initializes a new instance of MipmapChain.

Expand image Overload List

Name | Description
MipmapChain () | Initializes a new instance of MipmapChain.
MipmapChain (BitmapContent) | Initializes a new instance of MipmapChain with the specified mipmap.

Expand image See Also

Reference

MipmapChain Class
MipmapChain Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MipmapChain Constructor ()

MipmapChain Constructor ()
See Also
CollapseAll image

Initializes a new instance of MipmapChain.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MipmapChain ()

Expand image See Also

Reference

MipmapChain Class
MipmapChain Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChain Constructor (BitmapContent)

MipmapChain Constructor (BitmapContent)
See Also
CollapseAll image

Initializes a new instance of MipmapChain with the specified mipmap.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MipmapChain (
         BitmapContent bitmap
)

Parameters

bitmap
Image containing a mipmap.

Expand image See Also

Reference

MipmapChain Class
MipmapChain Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChain Methods

MipmapChain Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | InsertItem | Overloaded. Inserts a child object into the collection at the specified location.
 | op_Implicit | Constructs a new mipmap chain containing the specified bitmap.
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | SetItem | Overloaded. Modifies the specified child object in the collection.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

MipmapChain Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MipmapChain.InsertItem Method

MipmapChain.InsertItem Method

Inserts a child object into the collection at the specified location.

Expand image Overload List

Name | Description
MipmapChain.InsertItem (Int32, BitmapContent) | Inserts a child object into the collection at the specified location.

Expand image See Also

Reference

MipmapChain Class
MipmapChain Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MipmapChain.InsertItem Method (Int32, BitmapContent)

MipmapChain.InsertItem Method (Int32, BitmapContent)
See Also
CollapseAll image

Inserts a child object into the collection at the specified location.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void InsertItem (
         int index,
         BitmapContent item
)

Parameters

index
The position in the collection.
item
The child object being inserted.

Expand image See Also

Reference

MipmapChain Class
MipmapChain Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChain.op_Implicit Method

MipmapChain.op_Implicit Method

Constructs a new mipmap chain containing the specified bitmap.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static MipmapChain op_Implicit (
         BitmapContent bitmap
)

Parameters

bitmap
Bitmap used for the mipmap chain.

Return Value

Resultant mipmap chain.

Expand image See Also

Reference

MipmapChain Class
MipmapChain Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChain.SetItem Method

MipmapChain.SetItem Method

Modifies the specified child object in the collection.

Expand image Overload List

Name | Description
MipmapChain.SetItem (Int32, BitmapContent) | Modifies the specified child object in the collection.

Expand image See Also

Reference

MipmapChain Class
MipmapChain Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MipmapChain.SetItem Method (Int32, BitmapContent)

MipmapChain.SetItem Method (Int32, BitmapContent)
See Also
CollapseAll image

Modifies the specified child object in the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void SetItem (
         int index,
         BitmapContent item
)

Parameters

index
The position in the collection.
item
The child object being modified.

Expand image See Also

Reference

MipmapChain Class
MipmapChain Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChain Properties

MipmapChain Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image See Also

Reference

MipmapChain Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MipmapChainCollection Class

MipmapChainCollection Class
See Also Members
CollapseAll image

Provides methods for maintaining a mipmap chain.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class MipmapChainCollection : Collection<MipmapChain>

Expand image Remarks

The collection holds a single mipmap chain for a regular 2D texture, six for a cube map, or an arbitrary number for volume and array textures.

Expand image See Also

Reference

MipmapChainCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChainCollection Members

MipmapChainCollection Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the MipmapChainCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | InsertItem | Overloaded. Inserts a child object into the collection at the specified location.
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | SetItem | Overloaded. Modifies the specified child object in the collection.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | Removes all children from the collection.
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | Removes a child object in the collection.
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

MipmapChainCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MipmapChainCollection Methods

MipmapChainCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | InsertItem | Overloaded. Inserts a child object into the collection at the specified location.
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | SetItem | Overloaded. Modifies the specified child object in the collection.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | Removes all children from the collection.
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | Removes a child object in the collection.
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

MipmapChainCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MipmapChainCollection.ClearItems Method

MipmapChainCollection.ClearItems Method

Removes all children from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void ClearItems ()

Expand image See Also

Reference

MipmapChainCollection Class
MipmapChainCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChainCollection.InsertItem Method

MipmapChainCollection.InsertItem Method

Inserts a child object into the collection at the specified location.

Expand image Overload List

Name | Description
MipmapChainCollection.InsertItem (Int32, MipmapChain) | Inserts a child object into the collection at the specified location.

Expand image See Also

Reference

MipmapChainCollection Class
MipmapChainCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MipmapChainCollection.InsertItem Method (Int32, MipmapChain)

MipmapChainCollection.InsertItem Method (Int32, MipmapChain)
See Also
CollapseAll image

Inserts a child object into the collection at the specified location.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void InsertItem (
         int index,
         MipmapChain item
)

Parameters

index
The position in the collection.
item
The child object being inserted.

Expand image See Also

Reference

MipmapChainCollection Class
MipmapChainCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChainCollection.RemoveItem Method

MipmapChainCollection.RemoveItem Method

Removes a child object in the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void RemoveItem (
         int index
)

Parameters

index
The index of the item being removed.

Expand image See Also

Reference

MipmapChainCollection Class
MipmapChainCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChainCollection.SetItem Method

MipmapChainCollection.SetItem Method

Modifies the specified child object in the collection.

Expand image Overload List

Name | Description
MipmapChainCollection.SetItem (Int32, MipmapChain) | Modifies the specified child object in the collection.

Expand image See Also

Reference

MipmapChainCollection Class
MipmapChainCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


MipmapChainCollection.SetItem Method (Int32, MipmapChain)

MipmapChainCollection.SetItem Method (Int32, MipmapChain)
See Also
CollapseAll image

Modifies the specified child object in the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void SetItem (
         int index,
         MipmapChain item
)

Parameters

index
The position in the collection.
item
The child object being modified.

Expand image See Also

Reference

MipmapChainCollection Class
MipmapChainCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MipmapChainCollection Properties

MipmapChainCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image See Also

Reference

MipmapChainCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


NodeContent Class

NodeContent Class
See Also Members
CollapseAll image

Provides a base class for graphics types that define local coordinate systems.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class NodeContent : ContentItem

Expand image Remarks

These objects can be arranged in a tree structure. This enables the root transform to be automatically inherited from the parent object.

Expand image See Also

Reference

NodeContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NodeContent Members

NodeContent Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the NodeContent type.

Expand image Public Constructors

 | Name | Description
Public Method | NodeContent | Creates an instance of NodeContent.

Expand image Public Properties

 | Name | Description
Public Property | AbsoluteTransform | Gets the value of the local Transform property, multiplied by the AbsoluteTransform of the parent.
Public Property | Animations | Gets the set of animations belonging to this node.
Public Property | Children | Gets the children of the NodeContent object.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Parent | Gets the parent of this NodeContent object.
Public Property | Transform | Gets the transform matrix of the scene.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NodeContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


NodeContent Constructor

NodeContent Constructor

Creates an instance of NodeContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public NodeContent ()

Expand image See Also

Reference

NodeContent Class
NodeContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NodeContent Methods

NodeContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

NodeContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


NodeContent Properties

NodeContent Properties

Expand image Public Properties

 | Name | Description
Public Property | AbsoluteTransform | Gets the value of the local Transform property, multiplied by the AbsoluteTransform of the parent.
Public Property | Animations | Gets the set of animations belonging to this node.
Public Property | Children | Gets the children of the NodeContent object.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Parent | Gets the parent of this NodeContent object.
Public Property | Transform | Gets the transform matrix of the scene.

Expand image See Also

Reference

NodeContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


NodeContent.AbsoluteTransform Property

NodeContent.AbsoluteTransform Property

Gets the value of the local Transform property, multiplied by the AbsoluteTransform of the parent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Matrix AbsoluteTransform { get; }

Property Value

Matrix of the NodeContent object.

Expand image See Also

Reference

NodeContent Class
NodeContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NodeContent.Animations Property

NodeContent.Animations Property

Gets the set of animations belonging to this node.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public AnimationContentDictionary Animations { get; }

Property Value

Collection of animations for this content item.

Expand image Remarks

Note

The XNA Framework provides only partial support for animation. In the NodeContent class an intermediate object model for storing animation data inside the Content Pipeline is defined, which exposes data into that has been extracted from Autodesk FBX (.fbx) and DirectX X file (.x) formats. The built-in ModelProcessor also converts vertex channels of BoneWeightCollection data into sets of VertexElementUsage.BlendIndices and VertexElementUsage.BlendWeight channels suitable for skinned rendering on the GPU. However, the framework does not include any runtime animation classes at this time.

There can be any number of animations, which are looked up by name. For character skinning, the animation data is usually attached to the root of a bone hierarchy. However, it can potentially belong to any node. For example, when used for rigid body animation.

Expand image See Also

Reference

NodeContent Class
NodeContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NodeContent.Children Property

NodeContent.Children Property

Gets the children of the NodeContent object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public NodeContentCollection Children { get; }

Property Value

Collection of children.

Expand image See Also

Reference

NodeContent Class
NodeContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NodeContent.Parent Property

NodeContent.Parent Property

Gets the parent of this NodeContent object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public NodeContent Parent { get; set; }

Property Value

Parent of the NodeContent object, or null if this object is the root of the scene.

Expand image See Also

Reference

NodeContent Class
NodeContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NodeContent.Transform Property

NodeContent.Transform Property

Gets the transform matrix of the scene.

The transform matrix defines a local coordinate system for the content in addition to any children of this object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Matrix Transform { get; set; }

Property Value

Transform matrix used by the scene.

Expand image See Also

Reference

NodeContent Class
NodeContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NodeContentCollection Class

NodeContentCollection Class
See Also Members
CollapseAll image

Provides a collection of all NodeContent objects in a spatial hierarchy.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class NodeContentCollection : ChildCollection<NodeContent, NodeContent>

Expand image See Also

Reference

NodeContentCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NodeContentCollection Members

NodeContentCollection Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the NodeContentCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from ChildCollection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetParent | Gets the parent of a child object.
Protected Method | GetParent | (Inherited from ChildCollection.)
Protected Method | InsertItem | (Inherited from ChildCollection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from ChildCollection.)
Protected Method | SetItem | (Inherited from ChildCollection.)
Protected Method | SetParent | Gets the parent of a child object.
Protected Method | SetParent | (Inherited from ChildCollection.)

Expand image See Also

Reference

NodeContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


NodeContentCollection Methods

NodeContentCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from ChildCollection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetParent | Gets the parent of a child object.
Protected Method | GetParent | (Inherited from ChildCollection.)
Protected Method | InsertItem | (Inherited from ChildCollection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from ChildCollection.)
Protected Method | SetItem | (Inherited from ChildCollection.)
Protected Method | SetParent | Gets the parent of a child object.
Protected Method | SetParent | (Inherited from ChildCollection.)

Expand image See Also

Reference

NodeContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


NodeContentCollection.GetParent Method

NodeContentCollection.GetParent Method

Gets the parent of a child object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override NodeContent GetParent (
         NodeContent child
)

Parameters

child
The child of the parent being retrieved.

Return Value

The parent of the child object.

Expand image See Also

Reference

NodeContentCollection Class
NodeContentCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NodeContentCollection.SetParent Method

NodeContentCollection.SetParent Method

Gets the parent of a child object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void SetParent (
         NodeContent child,
         NodeContent parent
)

Parameters

child
The child of the parent being retrieved.
parent
The parent of the child object.

Expand image See Also

Reference

NodeContentCollection Class
NodeContentCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


NodeContentCollection Properties

NodeContentCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image See Also

Reference

NodeContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


PixelBitmapContent Generic Class

PixelBitmapContent Generic Class
See Also Members
CollapseAll image

Provides methods for maintaining a 2D array of pixel values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class PixelBitmapContent<T> : BitmapContent where T :

Expand image Remarks

Pixel bitmaps are represented as a 2D array of independent pixel values. The pixel type will often be from the Graphics.PackedVector namespace, but can also be System.Single, Vector2, Vector3, or Vector4. A pixel bitmap of Vector4 values is commonly used as an intermediate format for image manipulation operations.

Expand image See Also

Reference

PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent Members

PixelBitmapContent Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the PixelBitmapContent type.

Expand image Public Constructors

 | Name | Description
Public Method | PixelBitmapContent | Overloaded. Initializes a new instance of PixelBitmapContent.

Expand image Public Properties

 | Name | Description
Public Property | Height | (Inherited from BitmapContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | (Inherited from BitmapContent.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixel | Gets the pixel value at the specified location in the bitmap.
Public Method | GetPixelData | Gets the bitmap content as an array of encoded bytes.
Public Method | GetRow | Gets an array containing a single row of bitmap data.
Public Method | GetType | (Inherited from Object.)
Public Method | ReplaceColor | Searches for all pixels matching the specified color and replaces them with a new value.
Public Method | SetPixel | Sets the pixel value at the specified location in the bitmap.
Public Method | SetPixelData | Sets the bitmap content using the specified encoded byte array.
Public Method | ToString | Gets a string description of the bitmap.
Public Method | TryGetFormat | Gets the GPU texture format that corresponds to the specified bitmap type.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | Attempts to copy a region from the specified bitmap.
Protected Method | TryCopyTo | Attempts to copy a region to the specified bitmap.

Expand image See Also

Reference

PixelBitmapContent Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


PixelBitmapContent Constructor

PixelBitmapContent Constructor

Initializes a new instance of PixelBitmapContent.

Expand image Overload List

Name | Description
PixelBitmapContent () | Initializes a new instance of PixelBitmapContent.
PixelBitmapContent (Int32, Int32) | Initializes a new instance of PixelBitmapContent with the specified width and height.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


PixelBitmapContent Constructor ()

PixelBitmapContent Constructor ()
See Also
CollapseAll image

Initializes a new instance of PixelBitmapContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected PixelBitmapContent ()

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent Constructor (Int32, Int32)

PixelBitmapContent Constructor (Int32, Int32)
See Also
CollapseAll image

Initializes a new instance of PixelBitmapContent with the specified width and height.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public PixelBitmapContent (
         int width,
         int height
)

Parameters

width
Width, in pixels, of the blank pixel bitmap.
height
Height, in pixels, of the blank pixel bitmap.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent Methods

PixelBitmapContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetPixel | Gets the pixel value at the specified location in the bitmap.
Public Method | GetPixelData | Gets the bitmap content as an array of encoded bytes.
Public Method | GetRow | Gets an array containing a single row of bitmap data.
Public Method | GetType | (Inherited from Object.)
Public Method | ReplaceColor | Searches for all pixels matching the specified color and replaces them with a new value.
Public Method | SetPixel | Sets the pixel value at the specified location in the bitmap.
Public Method | SetPixelData | Sets the bitmap content using the specified encoded byte array.
Public Method | ToString | Gets a string description of the bitmap.
Public Method | TryGetFormat | Gets the GPU texture format that corresponds to the specified bitmap type.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | TryCopyFrom | Attempts to copy a region from the specified bitmap.
Protected Method | TryCopyTo | Attempts to copy a region to the specified bitmap.

Expand image See Also

Reference

PixelBitmapContent Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


PixelBitmapContent.GetPixel Method

PixelBitmapContent.GetPixel Method

Gets the pixel value at the specified location in the bitmap.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T GetPixel (
         int x,
         int y
)

Parameters

x
The x component of a bitmap pixel.
y
The y component of a bitmap pixel.

Return Value

Value of the pixel.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent.GetPixelData Method

PixelBitmapContent.GetPixelData Method

Gets the bitmap content as an array of encoded bytes.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override byte[] GetPixelData ()

Return Value

Contents of the bitmap.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent.GetRow Method

PixelBitmapContent.GetRow Method

Gets an array containing a single row of bitmap data.

This method can be used both to read and modify the bitmap contents.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T[] GetRow (
         int y
)

Parameters

y
The y component of the bitmap row.

Return Value

Array containing the bitmap row data.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent.ReplaceColor Method

PixelBitmapContent.ReplaceColor Method

Searches for all pixels matching the specified color and replaces them with a new value.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void ReplaceColor (
         T originalColor,
         T newColor
)

Parameters

originalColor
Color being searched for.
newColor
Color used to replace originalColor.

Expand image Remarks

Use this method to implement color keying. For instance, to replace Color.Magenta with Color.Transparent.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent.SetPixel Method

PixelBitmapContent.SetPixel Method

Sets the pixel value at the specified location in the bitmap.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void SetPixel (
         int x,
         int y,
         T value
)

Parameters

x
The x component of a bitmap pixel.
y
The y component of a bitmap pixel.
value
New pixel value.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent.SetPixelData Method

PixelBitmapContent.SetPixelData Method

Sets the bitmap content using the specified encoded byte array.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override void SetPixelData (
         byte[] sourceData
)

Parameters

sourceData
New bitmap content.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent.ToString Method

PixelBitmapContent.ToString Method

Gets a string description of the bitmap.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override string ToString ()

Return Value

Description of the bitmap.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent.TryCopyFrom Method

PixelBitmapContent.TryCopyFrom Method

Attempts to copy a region from the specified bitmap.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override bool TryCopyFrom (
         BitmapContent sourceBitmap,
         Rectangle sourceRegion,
         Rectangle destinationRegion
)

Parameters

sourceBitmap
Bitmap content being copied.
sourceRegion
Location of the upper-left region of sourceBitmap being copied from.
destinationRegion
Region of destination bitmap to be overwritten.

Return Value

true if region copy is supported; false otherwise.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent.TryCopyTo Method

PixelBitmapContent.TryCopyTo Method

Attempts to copy a region to the specified bitmap.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override bool TryCopyTo (
         BitmapContent destinationBitmap,
         Rectangle sourceRegion,
         Rectangle destinationRegion
)

Parameters

destinationBitmap
Bitmap to be copied to.
sourceRegion
Location of upper-left region to be copied.
destinationRegion
Target region for the copied content.

Return Value

true if region copy is supported; false otherwise.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent.TryGetFormat Method

PixelBitmapContent.TryGetFormat Method

Gets the GPU texture format that corresponds to the specified bitmap type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool TryGetFormat (
         out SurfaceFormat format
)

Parameters

format
[OutAttribute] Format being compared.

Return Value

true if the bitmap matches format; false otherwise.

Expand image See Also

Reference

PixelBitmapContent Generic Class
PixelBitmapContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PixelBitmapContent Properties

PixelBitmapContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Height | (Inherited from BitmapContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | Width | (Inherited from BitmapContent.)

Expand image See Also

Reference

PixelBitmapContent Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


PositionCollection Class

PositionCollection Class
See Also Members
CollapseAll image

Provides a collection of vertex position values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class PositionCollection : Collection<Vector3>

Expand image See Also

Reference

PositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PositionCollection Members

PositionCollection Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the PositionCollection type.

Expand image Public Constructors

 | Name | Description
Public Method | PositionCollection | Initializes a new instance of PositionCollection.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

PositionCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


PositionCollection Constructor

PositionCollection Constructor

Initializes a new instance of PositionCollection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public PositionCollection ()

Expand image See Also

Reference

PositionCollection Class
PositionCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PositionCollection Methods

PositionCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from Collection.)
Public Method | Clear | (Inherited from Collection.)
Public Method | Contains | (Inherited from Collection.)
Public Method | CopyTo | (Inherited from Collection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from Collection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from Collection.)
Public Method | Insert | (Inherited from Collection.)
Public Method | Remove | (Inherited from Collection.)
Public Method | RemoveAt | (Inherited from Collection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ClearItems | (Inherited from Collection.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | InsertItem | (Inherited from Collection.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from Collection.)
Protected Method | SetItem | (Inherited from Collection.)

Expand image See Also

Reference

PositionCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


PositionCollection Properties

PositionCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from Collection.)
Public Property | Item | (Inherited from Collection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from Collection.)

Expand image See Also

Reference

PositionCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


SkinnedMaterialContent Class

SkinnedMaterialContent Class
See Also Members
CollapseAll image

Provides properties for modifying an effect for rendering skinned character models.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class SkinnedMaterialContent : MaterialContent

Expand image See Also

Reference

SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent Members

SkinnedMaterialContent Members
See Also Constructors Fields Properties
CollapseAll image

The following tables list the members exposed by the SkinnedMaterialContent type.

Expand image Public Constructors

 | Name | Description
Public Method | SkinnedMaterialContent | Creates an instance of this object.

Expand image Public Fields

 | Name | Description
Public Field | AlphaKey | Specifies the key of the key/data pair for the alpha property.
Public Field | DiffuseColorKey | Specifies the key of the key/data pair for the material diffuse color.
Public Field | EmissiveColorKey | Specifies the key of the key/data pair for the material emissive color.
Public Field | SpecularColorKey | Specifies the key of the key/data pair for the specular color.
Public Field | SpecularPowerKey | Specifies the key of the key/data pair for the specular power.
Public Field | TextureKey | Specifies the key of the key/data pair for the current texture.
Public Field | WeightsPerVertexKey | Specifies the key of the key/data pair for the per-vertex skinning weights.

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha.
Public Property | DiffuseColor | Gets or sets the material diffuse color, which ranges from 0 to 1.
Public Property | EmissiveColor | Gets or sets the emissive color of the effect material.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | SpecularColor | Gets or sets the specular color of this effect material.
Public Property | SpecularPower | Gets or sets the specular power of this effect material.
Public Property | Texture | Gets or sets the current texture.
Public Property | Textures | (Inherited from MaterialContent.)
Public Property | WeightsPerVertex | Gets or sets the number of per-vertex skinning weights to evaluate, which is either 1, 2, or 4.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

SkinnedMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


SkinnedMaterialContent Fields

SkinnedMaterialContent Fields

Expand image Public Fields

 | Name | Description
Public Field | AlphaKey | Specifies the key of the key/data pair for the alpha property.
Public Field | DiffuseColorKey | Specifies the key of the key/data pair for the material diffuse color.
Public Field | EmissiveColorKey | Specifies the key of the key/data pair for the material emissive color.
Public Field | SpecularColorKey | Specifies the key of the key/data pair for the specular color.
Public Field | SpecularPowerKey | Specifies the key of the key/data pair for the specular power.
Public Field | TextureKey | Specifies the key of the key/data pair for the current texture.
Public Field | WeightsPerVertexKey | Specifies the key of the key/data pair for the per-vertex skinning weights.

Expand image See Also

Reference

SkinnedMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


SkinnedMaterialContent.AlphaKey Field

SkinnedMaterialContent.AlphaKey Field

Specifies the key of the key/data pair for the alpha property.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string AlphaKey

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.DiffuseColorKey Field

SkinnedMaterialContent.DiffuseColorKey Field

Specifies the key of the key/data pair for the material diffuse color.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string DiffuseColorKey

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.EmissiveColorKey Field

SkinnedMaterialContent.EmissiveColorKey Field

Specifies the key of the key/data pair for the material emissive color.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string EmissiveColorKey

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.SpecularColorKey Field

SkinnedMaterialContent.SpecularColorKey Field

Specifies the key of the key/data pair for the specular color.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string SpecularColorKey

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.SpecularPowerKey Field

SkinnedMaterialContent.SpecularPowerKey Field

Specifies the key of the key/data pair for the specular power.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string SpecularPowerKey

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.TextureKey Field

SkinnedMaterialContent.TextureKey Field

Specifies the key of the key/data pair for the current texture.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string TextureKey

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.WeightsPerVertexKey Field

SkinnedMaterialContent.WeightsPerVertexKey Field

Specifies the key of the key/data pair for the per-vertex skinning weights.

This key/data pair is stored in the OpaqueData property of the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string WeightsPerVertexKey

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent Constructor

SkinnedMaterialContent Constructor

Creates an instance of this object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public SkinnedMaterialContent ()

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent Methods

SkinnedMaterialContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetReferenceTypeProperty | (Inherited from MaterialContent.)
Protected Method | GetTexture | (Inherited from MaterialContent.)
Protected Method | GetValueTypeProperty | (Inherited from MaterialContent.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | SetProperty | (Inherited from MaterialContent.)
Protected Method | SetTexture | (Inherited from MaterialContent.)

Expand image See Also

Reference

SkinnedMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


SkinnedMaterialContent Properties

SkinnedMaterialContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Alpha | Gets or sets the material alpha.
Public Property | DiffuseColor | Gets or sets the material diffuse color, which ranges from 0 to 1.
Public Property | EmissiveColor | Gets or sets the emissive color of the effect material.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | SpecularColor | Gets or sets the specular color of this effect material.
Public Property | SpecularPower | Gets or sets the specular power of this effect material.
Public Property | Texture | Gets or sets the current texture.
Public Property | Textures | (Inherited from MaterialContent.)
Public Property | WeightsPerVertex | Gets or sets the number of per-vertex skinning weights to evaluate, which is either 1, 2, or 4.

Expand image See Also

Reference

SkinnedMaterialContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


SkinnedMaterialContent.Alpha Property

SkinnedMaterialContent.Alpha Property

Gets or sets the material alpha.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<float> Alpha { get; set; }

Property Value

The material's alpha value.

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.DiffuseColor Property

SkinnedMaterialContent.DiffuseColor Property

Gets or sets the material diffuse color, which ranges from 0 to 1.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> DiffuseColor { get; set; }

Property Value

The material's diffuse color.

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.EmissiveColor Property

SkinnedMaterialContent.EmissiveColor Property

Gets or sets the emissive color of the effect material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> EmissiveColor { get; set; }

Property Value

The emissive color of the effect material. Valid values are between 0 and 1.

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.SpecularColor Property

SkinnedMaterialContent.SpecularColor Property

Gets or sets the specular color of this effect material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<Vector3> SpecularColor { get; set; }

Property Value

The specular color of this effect material. Valid values are between 0 and 1.

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.SpecularPower Property

SkinnedMaterialContent.SpecularPower Property

Gets or sets the specular power of this effect material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<float> SpecularPower { get; set; }

Property Value

The specular power of this effect material.

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.Texture Property

SkinnedMaterialContent.Texture Property

Gets or sets the current texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ExternalReference<TextureContent> Texture { get; set; }

Property Value

The current texture.

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SkinnedMaterialContent.WeightsPerVertex Property

SkinnedMaterialContent.WeightsPerVertex Property

Gets or sets the number of per-vertex skinning weights to evaluate, which is either 1, 2, or 4.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<int> WeightsPerVertex { get; set; }

Property Value

The number of per-vertex skinning weights.

Expand image See Also

Reference

SkinnedMaterialContent Class
SkinnedMaterialContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Texture2DContent Class

Texture2DContent Class
See Also Members
CollapseAll image

Represents a regular two-dimensional texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class Texture2DContent : TextureContent

Expand image See Also

Reference

Texture2DContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Texture2DContent Members

Texture2DContent Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the Texture2DContent type.

Expand image Public Constructors

 | Name | Description
Public Method | Texture2DContent | Initializes a new instance of Texture2DContent.

Expand image Public Properties

 | Name | Description
Public Property | Faces | (Inherited from TextureContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Mipmaps | Gets or sets the collection of mipmaps containing the texture image data.
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image Public Methods

 | Name | Description
Public Method | ConvertBitmapType | (Inherited from TextureContent.)
Public Method | Equals | (Inherited from Object.)
Public Method | GenerateMipmaps | (Inherited from TextureContent.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Validate | Validates that the required contents of this texture are present, valid and match the capabilities of the device.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Texture2DContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Texture2DContent Constructor

Texture2DContent Constructor

Initializes a new instance of Texture2DContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Texture2DContent ()

Expand image See Also

Reference

Texture2DContent Class
Texture2DContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Texture2DContent Methods

Texture2DContent Methods

Expand image Public Methods

 | Name | Description
Public Method | ConvertBitmapType | (Inherited from TextureContent.)
Public Method | Equals | (Inherited from Object.)
Public Method | GenerateMipmaps | (Inherited from TextureContent.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Validate | Validates that the required contents of this texture are present, valid and match the capabilities of the device.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Texture2DContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Texture2DContent.Validate Method

Texture2DContent.Validate Method

Validates that the required contents of this texture are present, valid and match the capabilities of the device.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override void Validate (
         Nullable<GraphicsProfile> targetProfile
)

Parameters

targetProfile
The profile identifier that defines the capabilities of the device.

Expand image Exceptions

Exception type | Condition
InvalidContentException | The texture is not a valid one.

Expand image See Also

Reference

Texture2DContent Class
Texture2DContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Texture2DContent Properties

Texture2DContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Faces | (Inherited from TextureContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Mipmaps | Gets or sets the collection of mipmaps containing the texture image data.
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image See Also

Reference

Texture2DContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Texture2DContent.Mipmaps Property

Texture2DContent.Mipmaps Property

Gets or sets the collection of mipmaps containing the texture image data.

This is a shortcut for accessing base.Faces[0].

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MipmapChain Mipmaps { get; set; }

Property Value

Mipmap chain containing the texture images of an object.

Expand image See Also

Reference

Texture2DContent Class
Texture2DContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Texture3DContent Class

Texture3DContent Class
See Also Members
CollapseAll image

Represents a three-dimensional volume texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class Texture3DContent : TextureContent

Expand image See Also

Reference

Texture3DContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Texture3DContent Members

Texture3DContent Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the Texture3DContent type.

Expand image Public Constructors

 | Name | Description
Public Method | Texture3DContent | Initializes a new instance of Texture3DContent.

Expand image Public Properties

 | Name | Description
Public Property | Faces | (Inherited from TextureContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image Public Methods

 | Name | Description
Public Method | ConvertBitmapType | (Inherited from TextureContent.)
Public Method | Equals | (Inherited from Object.)
Public Method | GenerateMipmaps | Generates mipmaps for a volume texture.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Validate | Validates that the required contents of this volume texture are present, valid and match the capabilities of the device.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Texture3DContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Texture3DContent Constructor

Texture3DContent Constructor

Initializes a new instance of Texture3DContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Texture3DContent ()

Expand image See Also

Reference

Texture3DContent Class
Texture3DContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Texture3DContent Methods

Texture3DContent Methods

Expand image Public Methods

 | Name | Description
Public Method | ConvertBitmapType | (Inherited from TextureContent.)
Public Method | Equals | (Inherited from Object.)
Public Method | GenerateMipmaps | Generates mipmaps for a volume texture.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Validate | Validates that the required contents of this volume texture are present, valid and match the capabilities of the device.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

Texture3DContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


Texture3DContent.GenerateMipmaps Method

Texture3DContent.GenerateMipmaps Method

Generates mipmaps for a volume texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override void GenerateMipmaps (
         bool overwriteExistingMipmaps
)

Parameters

overwriteExistingMipmaps
true to overwrite existing mipmaps for the volume texture; false otherwise.

Expand image See Also

Reference

Texture3DContent Class
Texture3DContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Texture3DContent.Validate Method

Texture3DContent.Validate Method

Validates that the required contents of this volume texture are present, valid and match the capabilities of the device.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override void Validate (
         Nullable<GraphicsProfile> targetProfile
)

Parameters

targetProfile
The profile identifier that defines the capabilities of the device.

Expand image Exceptions

Exception type | Condition
InvalidContentException | The texture is not a valid one.

Expand image Remarks

This method verifies that mip counts are correct down each individual 2D face, and that width and height are shrinking appropriately.

Expand image See Also

Reference

Texture3DContent Class
Texture3DContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Texture3DContent Properties

Texture3DContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Faces | (Inherited from TextureContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image See Also

Reference

Texture3DContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


TextureContent Class

TextureContent Class
See Also Members
CollapseAll image

Provides a base class for all texture objects.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class TextureContent : ContentItem

Expand image See Also

Reference

TextureContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureContent Members

TextureContent Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the TextureContent type.

Expand image Protected Constructors

 | Name | Description
Protected Method | TextureContent | Initializes a new instance of TextureContent with the specified face collection.

Expand image Public Properties

 | Name | Description
Public Property | Faces | Collection of image faces that hold a single mipmap chain for a regular 2D texture, six chains for a cube map, or an arbitrary number for volume and array textures.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image Public Methods

 | Name | Description
Public Method | ConvertBitmapType | Converts all bitmaps for this texture to a different format.
Public Method | Equals | (Inherited from Object.)
Public Method | GenerateMipmaps | Generates a full set of mipmaps for the texture.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Validate | Verifies that all contents of this texture are present, correct and match the capabilities of the device.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


TextureContent Constructor

TextureContent Constructor

Initializes a new instance of TextureContent with the specified face collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected TextureContent (
         MipmapChainCollection faces
)

Parameters

faces
Mipmap chain containing the face collection.

Expand image Remarks

Override this constructor to provide support for specialized face collections. For example, the cube map class provides a fixed-size collection of six faces, while the Texture2DContent class provides a variable-size collection.

Expand image See Also

Reference

TextureContent Class
TextureContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureContent Methods

TextureContent Methods

Expand image Public Methods

 | Name | Description
Public Method | ConvertBitmapType | Converts all bitmaps for this texture to a different format.
Public Method | Equals | (Inherited from Object.)
Public Method | GenerateMipmaps | Generates a full set of mipmaps for the texture.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Validate | Verifies that all contents of this texture are present, correct and match the capabilities of the device.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


TextureContent.ConvertBitmapType Method

TextureContent.ConvertBitmapType Method

Converts all bitmaps for this texture to a different format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void ConvertBitmapType (
         Type newBitmapType
)

Parameters

newBitmapType
Type being converted to. The new type must be a subclass of BitmapContent, such as PixelBitmapContent or DxtBitmapContent.

Expand image Exceptions

Exception type | Condition
ArgumentException
  • ConvertBitmapType cannot convert to newBitmapType. The target type must be derived from BitmapContent.
  • ConvertBitmapType cannot convert to newBitmapType. The target must be a concrete type with a public constructor taking integer width and height parameters.
ArgumentNullException | newBitmapType is null.

Expand image See Also

Reference

TextureContent Class
TextureContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureContent.GenerateMipmaps Method

TextureContent.GenerateMipmaps Method

Generates a full set of mipmaps for the texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual void GenerateMipmaps (
         bool overwriteExistingMipmaps
)

Parameters

overwriteExistingMipmaps
true if the existing mipmap set is replaced with the new set; false otherwise.

Expand image See Also

Reference

TextureContent Class
TextureContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureContent.Validate Method

TextureContent.Validate Method

Verifies that all contents of this texture are present, correct and match the capabilities of the device.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract void Validate (
         Nullable<GraphicsProfile> targetProfile
)

Parameters

targetProfile
The profile identifier that defines the capabilities of the device.

Expand image Remarks

If texture verification fails, InvalidContentException is thrown.

Expand image See Also

Reference

TextureContent Class
TextureContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureContent Properties

TextureContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Faces | Collection of image faces that hold a single mipmap chain for a regular 2D texture, six chains for a cube map, or an arbitrary number for volume and array textures.
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image See Also

Reference

TextureContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


TextureContent.Faces Property

TextureContent.Faces Property

Collection of image faces that hold a single mipmap chain for a regular 2D texture, six chains for a cube map, or an arbitrary number for volume and array textures.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MipmapChainCollection Faces { get; }

Property Value

Collection of object faces.

Expand image See Also

Reference

TextureContent Class
TextureContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureCubeContent Class

TextureCubeContent Class
See Also Members
CollapseAll image

Provides validation for a cube map texture, which contains an array of six image faces.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class TextureCubeContent : TextureContent

Expand image See Also

Reference

TextureCubeContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureCubeContent Members

TextureCubeContent Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the TextureCubeContent type.

Expand image Public Constructors

 | Name | Description
Public Method | TextureCubeContent | Initializes a new instance of TextureCubeContent.

Expand image Public Properties

 | Name | Description
Public Property | Faces | (Inherited from TextureContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image Public Methods

 | Name | Description
Public Method | ConvertBitmapType | (Inherited from TextureContent.)
Public Method | Equals | (Inherited from Object.)
Public Method | GenerateMipmaps | (Inherited from TextureContent.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Validate | Verifies that all contents of the cube map are present, correct and match the capabilities of the device.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureCubeContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


TextureCubeContent Constructor

TextureCubeContent Constructor

Initializes a new instance of TextureCubeContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TextureCubeContent ()

Expand image See Also

Reference

TextureCubeContent Class
TextureCubeContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureCubeContent Methods

TextureCubeContent Methods

Expand image Public Methods

 | Name | Description
Public Method | ConvertBitmapType | (Inherited from TextureContent.)
Public Method | Equals | (Inherited from Object.)
Public Method | GenerateMipmaps | (Inherited from TextureContent.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Validate | Verifies that all contents of the cube map are present, correct and match the capabilities of the device.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureCubeContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


TextureCubeContent.Validate Method

TextureCubeContent.Validate Method

Verifies that all contents of the cube map are present, correct and match the capabilities of the device.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override void Validate (
         Nullable<GraphicsProfile> targetProfile
)

Parameters

targetProfile

Expand image Exceptions

Exception type | Condition
InvalidContentException | The cube map texture is not a valid one.

Expand image See Also

Reference

TextureCubeContent Class
TextureCubeContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureCubeContent Properties

TextureCubeContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Faces | (Inherited from TextureContent.)
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image See Also

Reference

TextureCubeContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


TextureReferenceDictionary Class

TextureReferenceDictionary Class
See Also Members
CollapseAll image

Provides a collection of named references to texture files.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class TextureReferenceDictionary : NamedValueDictionary<ExternalReference<TextureContent>>

Expand image See Also

Reference

TextureReferenceDictionary Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureReferenceDictionary Members

TextureReferenceDictionary Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the TextureReferenceDictionary type.

Expand image Public Constructors

 | Name | Description
Public Method | TextureReferenceDictionary | Initializes a new instance of TextureReferenceDictionary.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from NamedValueDictionary.)
Public Property | Item | (Inherited from NamedValueDictionary.)
Public Property | Keys | (Inherited from NamedValueDictionary.)
Public Property | Values | (Inherited from NamedValueDictionary.)

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from NamedValueDictionary.)
Public Method | Clear | (Inherited from NamedValueDictionary.)
Public Method | ContainsKey | (Inherited from NamedValueDictionary.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from NamedValueDictionary.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Remove | (Inherited from NamedValueDictionary.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | (Inherited from NamedValueDictionary.)

Expand image Protected Methods

 | Name | Description
Protected Method | AddItem | (Inherited from NamedValueDictionary.)
Protected Method | ClearItems | (Inherited from NamedValueDictionary.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from NamedValueDictionary.)
Protected Method | SetItem | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

TextureReferenceDictionary Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


TextureReferenceDictionary Constructor

TextureReferenceDictionary Constructor

Initializes a new instance of TextureReferenceDictionary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TextureReferenceDictionary ()

Expand image See Also

Reference

TextureReferenceDictionary Class
TextureReferenceDictionary Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureReferenceDictionary Methods

TextureReferenceDictionary Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | (Inherited from NamedValueDictionary.)
Public Method | Clear | (Inherited from NamedValueDictionary.)
Public Method | ContainsKey | (Inherited from NamedValueDictionary.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from NamedValueDictionary.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Remove | (Inherited from NamedValueDictionary.)
Public Method | ToString | (Inherited from Object.)
Public Method | TryGetValue | (Inherited from NamedValueDictionary.)

Expand image Protected Methods

 | Name | Description
Protected Method | AddItem | (Inherited from NamedValueDictionary.)
Protected Method | ClearItems | (Inherited from NamedValueDictionary.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | RemoveItem | (Inherited from NamedValueDictionary.)
Protected Method | SetItem | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

TextureReferenceDictionary Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


TextureReferenceDictionary Properties

TextureReferenceDictionary Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from NamedValueDictionary.)
Public Property | Item | (Inherited from NamedValueDictionary.)
Public Property | Keys | (Inherited from NamedValueDictionary.)
Public Property | Values | (Inherited from NamedValueDictionary.)

Expand image See Also

Reference

TextureReferenceDictionary Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VectorConverter Class

VectorConverter Class
See Also Members
CollapseAll image

Provides methods for converting data between different packed vector representations.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static class VectorConverter

Expand image See Also

Reference

VectorConverter Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VectorConverter Members

VectorConverter Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the VectorConverter type.

Expand image Public Methods

Name | Description
GetConverter | Gets a Converter delegate that can convert one packed vector representation to another.
TryGetSurfaceFormat | Gets the GPU texture format that corresponds to a managed vector type.
TryGetVectorType | Overloaded. Searches for a managed vector type that corresponds to the specified format type.
TryGetVertexElementFormat | Gets the GPU vertex format that corresponds to a managed vector type.

Expand image See Also

Reference

VectorConverter Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VectorConverter Methods

VectorConverter Methods

Expand image Public Methods

Name | Description
GetConverter | Gets a Converter delegate that can convert one packed vector representation to another.
TryGetSurfaceFormat | Gets the GPU texture format that corresponds to a managed vector type.
TryGetVectorType | Overloaded. Searches for a managed vector type that corresponds to the specified format type.
TryGetVertexElementFormat | Gets the GPU vertex format that corresponds to a managed vector type.

Expand image See Also

Reference

VectorConverter Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VectorConverter.GetConverter Generic Method

VectorConverter.GetConverter Generic Method

Gets a Converter delegate that can convert one packed vector representation to another.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static Converter<TInput, TOutput> GetConverter<TInput,TOutput> ()

Type Parameters

TInput
Source type for the conversion.
TOutput
Output type for the conversion.

Return Value

A Converter delegate that encodes or decodes TInput to TOutput.

Expand image Remarks

The input and output types must be either a value type that implements IPackedVector or one of Single, Vector2, Vector3, or Vector4.

Expand image See Also

Reference

VectorConverter Class
VectorConverter Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VectorConverter.TryGetSurfaceFormat Method

VectorConverter.TryGetSurfaceFormat Method

Gets the GPU texture format that corresponds to a managed vector type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static bool TryGetSurfaceFormat (
         Type vectorType,
         out SurfaceFormat surfaceFormat
)

Parameters

vectorType

Can be one of the following:

  • IPackedVector
  • Single
  • Vector2
  • Vector3
  • Vector4
surfaceFormat
[OutAttribute] Surface format being compared.

Return Value

true if a match is found; false otherwise.

Expand image See Also

Reference

VectorConverter Class
VectorConverter Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VectorConverter.TryGetVectorType Method

VectorConverter.TryGetVectorType Method

Searches for a managed vector type that corresponds to the specified format type.

Expand image Overload List

Name | Description
VectorConverter.TryGetVectorType (SurfaceFormat, Type) | Searches for a managed vector type that corresponds to a GPU texture format.
VectorConverter.TryGetVectorType (VertexElementFormat, Type) | Searches for a managed vector type that corresponds to a GPU vertex format.

Expand image See Also

Reference

VectorConverter Class
VectorConverter Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VectorConverter.TryGetVectorType Method (SurfaceFormat, Type)

VectorConverter.TryGetVectorType Method (SurfaceFormat, Type)
See Also
CollapseAll image

Searches for a managed vector type that corresponds to a GPU texture format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static bool TryGetVectorType (
         SurfaceFormat surfaceFormat,
         out Type vectorType
)

Parameters

surfaceFormat
Surface format being compared.
vectorType
[OutAttribute] Corresponding managed vector type.

Return Value

true if a match is found; false otherwise.

Expand image See Also

Reference

VectorConverter Class
VectorConverter Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VectorConverter.TryGetVectorType Method (VertexElementFormat, Type)

VectorConverter.TryGetVectorType Method (VertexElementFormat, Type)
See Also
CollapseAll image

Searches for a managed vector type that corresponds to a GPU vertex format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static bool TryGetVectorType (
         VertexElementFormat vertexElementFormat,
         out Type vectorType
)

Parameters

vertexElementFormat
Texture format being matched.
vectorType
[OutAttribute] Corresponding managed vector type.

Return Value

true if a match is found; false otherwise.

Expand image See Also

Reference

VectorConverter Class
VectorConverter Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VectorConverter.TryGetVertexElementFormat Method

VectorConverter.TryGetVertexElementFormat Method

Gets the GPU vertex format that corresponds to a managed vector type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static bool TryGetVertexElementFormat (
         Type vectorType,
         out VertexElementFormat vertexElementFormat
)

Parameters

vectorType

Can be one of the following:

  • IPackedVector
  • Single
  • Vector2
  • Vector3
  • Vector4
vertexElementFormat
[OutAttribute] Corresponding vertex element type.

Return Value

true if a match is found; false otherwise.

Expand image See Also

Reference

VectorConverter Class
VectorConverter Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel Class

VertexChannel Class
See Also Members
CollapseAll image

Provides methods and properties for maintaining a vertex channel.

A vertex channel is a list of arbitrary data with one value for each vertex. Channels are stored inside a GeometryContent and identified by name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class VertexChannel : IList, ICollection, IEnumerable

Expand image See Also

Reference

VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace
VertexChannelNames

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel Members

VertexChannel Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the VertexChannel type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of elements in the vertex channel
Public Property | ElementType | Gets the type of data contained in this channel.
Public Property | Item | Gets or sets the element at the specified index.
Public Property | Name | Gets the name of the vertex channel.

Expand image Public Methods

 | Name | Description
Public Method | Contains | Determines whether the specified element is in the channel.
Public Method | CopyTo | Copies the elements of the channel to an array, starting at the specified index.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator interface for reading channel content.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Gets the index of the specified item.
Public Method | ReadConvertedContent | Reads channel content and automatically converts it to the specified vector format.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IList.IsFixedSize | Gets a value indicating whether this list has a fixed size.
Explicit Interface Implementation | System.Collections.IList.IsReadOnly | Gets a value indicating whether this object is read-only.
Explicit Interface Implementation | System.Collections.ICollection.IsSynchronized | Gets a value indicating whether access to the collection is synchronized (thread safe).
Explicit Interface Implementation | System.Collections.ICollection.SyncRoot | Gets an object that can be used to synchronize access to the collection.
Explicit Interface Implementation | System.Collections.IList.Add | Adds a new element to the end of the collection.
Explicit Interface Implementation | System.Collections.IList.Clear | Removes all elements from the collection.
Explicit Interface Implementation | System.Collections.IList.Insert | Inserts an element into the collection at the specified position.
Explicit Interface Implementation | System.Collections.IList.RemoveAt | Removes the element at the specified index position.
Explicit Interface Implementation | System.Collections.IList.Remove | Removes a specified element from the collection.

Expand image See Also

Reference

VertexChannel Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannel Methods

VertexChannel Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | Determines whether the specified element is in the channel.
Public Method | CopyTo | Copies the elements of the channel to an array, starting at the specified index.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator interface for reading channel content.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Gets the index of the specified item.
Public Method | ReadConvertedContent | Reads channel content and automatically converts it to the specified vector format.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.IList.IsFixedSize | Gets a value indicating whether this list has a fixed size.
Explicit Interface Implementation | System.Collections.IList.IsReadOnly | Gets a value indicating whether this object is read-only.
Explicit Interface Implementation | System.Collections.ICollection.IsSynchronized | Gets a value indicating whether access to the collection is synchronized (thread safe).
Explicit Interface Implementation | System.Collections.ICollection.SyncRoot | Gets an object that can be used to synchronize access to the collection.
Explicit Interface Implementation | System.Collections.IList.Add | Adds a new element to the end of the collection.
Explicit Interface Implementation | System.Collections.IList.Clear | Removes all elements from the collection.
Explicit Interface Implementation | System.Collections.IList.Insert | Inserts an element into the collection at the specified position.
Explicit Interface Implementation | System.Collections.IList.RemoveAt | Removes the element at the specified index position.
Explicit Interface Implementation | System.Collections.IList.Remove | Removes a specified element from the collection.

Expand image See Also

Reference

VertexChannel Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannel.Contains Method

VertexChannel.Contains Method

Determines whether the specified element is in the channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Contains (
         Object value
)

Parameters

value
Element being searched for.

Return Value

true if the element is present; false otherwise.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.CopyTo Method

VertexChannel.CopyTo Method

Copies the elements of the channel to an array, starting at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void CopyTo (
         Array array,
         int index
)

Parameters

array
Array that will receive the copied channel elements.
index
Starting index for copy operation.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.GetEnumerator Method

VertexChannel.GetEnumerator Method

Gets an enumerator interface for reading channel content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IEnumerator GetEnumerator ()

Return Value

Enumeration of the channel content.

Expand image Remarks

To access strongly typed content data, cast the VertexChannel object to a VertexChannel<T> before calling GetEnumerator. This causes a generic enumerator interface to be returned.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.IndexOf Method

VertexChannel.IndexOf Method

Gets the index of the specified item.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int IndexOf (
         Object value
)

Parameters

value
Item whose index is to be retrieved.

Return Value

Index of specified item.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.ReadConvertedContent Generic Method

VertexChannel.ReadConvertedContent Generic Method

Reads channel content and automatically converts it to the specified vector format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract IEnumerable<TargetType> ReadConvertedContent<TargetType> ()

Type Parameters

TargetType
Target vector format of the converted data.

Return Value

The converted data.

Expand image Remarks

The following formats are supported:

  • Single
  • Vector2 Structure
  • Vector3 Structure
  • Vector4 Structure
  • Any implementation of IPackedVector Interface.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.IList.Add Method

System.Collections.IList.Add Method

Adds a new element to the end of the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private int System.Collections.IList.Add (
         Object value
)

Parameters

value
The element to add.

Return Value

Index of the element.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.IList.Clear Method

System.Collections.IList.Clear Method

Removes all elements from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.IList.Clear ()

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.IList.Insert Method

System.Collections.IList.Insert Method

Inserts an element into the collection at the specified position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.IList.Insert (
         int index,
         Object value
)

Parameters

index
Index at which to insert the element.
value
The element to insert.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.IList.Remove Method

System.Collections.IList.Remove Method

Removes a specified element from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.IList.Remove (
         Object value
)

Parameters

value
The element to remove.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.IList.RemoveAt Method

System.Collections.IList.RemoveAt Method

Removes the element at the specified index position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.IList.RemoveAt (
         int index
)

Parameters

index
Index of the element to remove.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel Properties

VertexChannel Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of elements in the vertex channel
Public Property | ElementType | Gets the type of data contained in this channel.
Public Property | Item | Gets or sets the element at the specified index.
Public Property | Name | Gets the name of the vertex channel.

Expand image See Also

Reference

VertexChannel Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannel.Count Property

VertexChannel.Count Property

Gets the number of elements in the vertex channel

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of elements.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.ElementType Property

VertexChannel.ElementType Property

Gets the type of data contained in this channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract Type ElementType { get; }

Property Value

Type of data stored in the vertex channel.

Expand image Remarks

To access strongly typed content data, cast the VertexChannel object to a VertexChannel<T> before calling ElementType. This causes a generic enumerator interface to be returned.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.Item Property

VertexChannel.Item Property

Gets or sets the element at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Object this [
         int index
] { get; set; }

Property Value

Element at the specified index.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.Name Property

VertexChannel.Name Property

Gets the name of the vertex channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

Name of the channel.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.System.Collections.ICollection.IsSynchronized Property

VertexChannel.System.Collections.ICollection.IsSynchronized Property
See Also
CollapseAll image

Gets a value indicating whether access to the collection is synchronized (thread safe).

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.ICollection.IsSynchronized { get; }

Property Value

true if access to the collection is synchronized (thread safe); falseotherwise.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.System.Collections.ICollection.SyncRoot Property

VertexChannel.System.Collections.ICollection.SyncRoot Property
See Also
CollapseAll image

Gets an object that can be used to synchronize access to the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private Object System.Collections.ICollection.SyncRoot { get; }

Property Value

An object that can be used to synchronize access to the collection.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.System.Collections.IList.IsFixedSize Property

VertexChannel.System.Collections.IList.IsFixedSize Property

Gets a value indicating whether this list has a fixed size.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.IList.IsFixedSize { get; }

Property Value

true if the list has a fixed size; false otherwise.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.System.Collections.IList.IsReadOnly Property

VertexChannel.System.Collections.IList.IsReadOnly Property

Gets a value indicating whether this object is read-only.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.IList.IsReadOnly { get; }

Property Value

true if this object is read-only; false otherwise.

Expand image See Also

Reference

VertexChannel Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel Generic Class

VertexChannel Generic Class
See Also Members
CollapseAll image

Provides methods and properties for maintaining a vertex channel.

This is a generic implementation of VertexChannel and, therefore, can handle strongly typed content data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class VertexChannel<T> : VertexChannel, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable

Expand image See Also

Reference

VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace
VertexChannelNames

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel Members

VertexChannel Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the VertexChannel type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from VertexChannel.)
Public Property | ElementType | Gets the type of data contained in this channel.
Public Property | Item | Gets or sets the element at the specified index.
Public Property | Name | (Inherited from VertexChannel.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | Overloaded. Determines whether the specified element is in the channel.
Public Method | CopyTo | Overloaded. Copies the elements of the channel to an array.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator interface for reading channel content.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Overloaded. Gets the index of the specified item.
Public Method | ReadConvertedContent | Reads channel content and automatically converts it to the specified vector format.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection<T>.IsReadOnly | Gets a value indicating whether this object is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection<T>.Add | Adds a new element to the end of the collection.
Explicit Interface Implementation | System.Collections.Generic.ICollection<T>.Clear | Removes all elements from the collection.
Explicit Interface Implementation | System.Collections.Generic.IList<T>.Insert | Inserts an element into the collection at the specified position.
Explicit Interface Implementation | System.Collections.Generic.IList<T>.RemoveAt | Removes the element at the specified index position.
Explicit Interface Implementation | System.Collections.Generic.ICollection<T>.Remove | Removes a specified element from the collection.

Expand image See Also

Reference

VertexChannel Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannel Methods

VertexChannel Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | Overloaded. Determines whether the specified element is in the channel.
Public Method | CopyTo | Overloaded. Copies the elements of the channel to an array.
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | Gets an enumerator interface for reading channel content.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Overloaded. Gets the index of the specified item.
Public Method | ReadConvertedContent | Reads channel content and automatically converts it to the specified vector format.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection<T>.IsReadOnly | Gets a value indicating whether this object is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection<T>.Add | Adds a new element to the end of the collection.
Explicit Interface Implementation | System.Collections.Generic.ICollection<T>.Clear | Removes all elements from the collection.
Explicit Interface Implementation | System.Collections.Generic.IList<T>.Insert | Inserts an element into the collection at the specified position.
Explicit Interface Implementation | System.Collections.Generic.IList<T>.RemoveAt | Removes the element at the specified index position.
Explicit Interface Implementation | System.Collections.Generic.ICollection<T>.Remove | Removes a specified element from the collection.

Expand image See Also

Reference

VertexChannel Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannel.Contains Method

VertexChannel.Contains Method

Determines whether the specified element is in the channel.

Expand image Overload List

Name | Description
VertexChannel.Contains (T) | Determines whether the specified element is in the channel.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannel.Contains Method (T)

VertexChannel.Contains Method (T)
See Also
CollapseAll image

Determines whether the specified element is in the channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Contains (
         T item
)

Parameters

item
Element being searched for.

Return Value

true if the element is present; false otherwise.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.CopyTo Method

VertexChannel.CopyTo Method

Copies the elements of the channel to an array.

Expand image Overload List

Name | Description
VertexChannel.CopyTo (T[], Int32) | Copies the elements of the channel to an array, starting at the specified index.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannel.CopyTo Method (T[], Int32)

VertexChannel.CopyTo Method (T[], Int32)
See Also
CollapseAll image

Copies the elements of the channel to an array, starting at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void CopyTo (
         T[] array,
         int arrayIndex
)

Parameters

array
Array that will receive the copied channel elements.
arrayIndex
Starting index for copy operation.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.GetEnumerator Method

VertexChannel.GetEnumerator Method

Gets an enumerator interface for reading channel content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IEnumerator<T> GetEnumerator ()

Return Value

Enumeration of the channel content.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.IndexOf Method

VertexChannel.IndexOf Method

Gets the index of the specified item.

Expand image Overload List

Name | Description
VertexChannel.IndexOf (T) | Gets the index of the specified item.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannel.IndexOf Method (T)

VertexChannel.IndexOf Method (T)
See Also
CollapseAll image

Gets the index of the specified item.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int IndexOf (
         T item
)

Parameters

item
Item whose index is to be retrieved.

Return Value

Index of specified item.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.ReadConvertedContent Generic Method

VertexChannel.ReadConvertedContent Generic Method

Reads channel content and automatically converts it to the specified vector format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override IEnumerable<TargetType> ReadConvertedContent<TargetType> ()

Type Parameters

TargetType
Target vector format for the converted channel data.

Return Value

The converted channel data.

Expand image Remarks

The following formats are supported:

  • Single
  • Vector2 Structure
  • Vector3 Structure
  • Vector4 Structure
  • Any implementation of IPackedVector Interface.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection<T>.Add Method

System.Collections.Generic.ICollection<T>.Add Method

Adds a new element to the end of the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection<T>.Add (
         T item
)

Parameters

item
The element to add.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection<T>.Clear Method

System.Collections.Generic.ICollection<T>.Clear Method

Removes all elements from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection<T>.Clear ()

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection<T>.Remove Method

System.Collections.Generic.ICollection<T>.Remove Method

Removes a specified element from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection<T>.Remove (
         T item
)

Parameters

item
The element to remove.

Return Value

true if the channel was removed; false otherwise.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.IList<T>.Insert Method

System.Collections.Generic.IList<T>.Insert Method

Inserts an element into the collection at the specified position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.IList<T>.Insert (
         int index,
         T item
)

Parameters

index
Index at which to insert the element.
item
The element to insert.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.IList<T>.RemoveAt Method

System.Collections.Generic.IList<T>.RemoveAt Method

Removes the element at the specified index position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.IList<T>.RemoveAt (
         int index
)

Parameters

index
Index of the element to remove.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel Properties

VertexChannel Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from VertexChannel.)
Public Property | ElementType | Gets the type of data contained in this channel.
Public Property | Item | Gets or sets the element at the specified index.
Public Property | Name | (Inherited from VertexChannel.)

Expand image See Also

Reference

VertexChannel Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannel.ElementType Property

VertexChannel.ElementType Property

Gets the type of data contained in this channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override Type ElementType { get; }

Property Value

Type of data stored in the vertex channel.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.Item Property

VertexChannel.Item Property

Gets or sets the element at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T this [
         int index
] { get; set; }

Property Value

Element at the specified index.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannel.System.Collections.Generic.ICollection<T>.IsReadOnly Property

VertexChannel.System.Collections.Generic.ICollection<T>.IsReadOnly Property
See Also
CollapseAll image

Gets a value indicating whether this object is read-only.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection<T>.IsReadOnly { get; }

Property Value

true if this object is read-only; false otherwise.

Expand image See Also

Reference

VertexChannel Generic Class
VertexChannel Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection Class

VertexChannelCollection Class
See Also Members
CollapseAll image

Provides methods and properties for managing a list of vertex data channels.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class VertexChannelCollection : IList<VertexChannel>, ICollection<VertexChannel>, IEnumerable<VertexChannel>, IEnumerable

Expand image See Also

Reference

VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace
VertexChannelNames

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection Members

VertexChannelCollection Members
See Also Methods Properties Explicit Interface Implementations
CollapseAll image

The following tables list the members exposed by the VertexChannelCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of vertex channels in the collection.
Public Property | Item | Overloaded. Gets or sets a vertex channel from the collection.

Expand image Public Methods

 | Name | Description
Public Method | Add | Overloaded. Adds a new vertex channel to the collection.
Public Method | Clear | Removes all vertex channels from the collection.
Public Method | Contains | Overloaded. Determines whether the collection contains the specified vertex channel.
Public Method | ConvertChannelContent | Overloaded. Converts a channel to another vector format.
Public Method | Equals | (Inherited from Object.)
Public Method | Get | Overloaded. Gets the vertex channel that matches the specified traits.
Public Method | GetEnumerator | Gets an enumerator that iterates through the vertex channels of a collection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Overloaded. Determines the index of a vertex channel.
Public Method | Insert | Overloaded. Inserts a new vertex channel into the collection.
Public Method | Remove | Overloaded. Removes a specified vertex channel from the collection.
Public Method | RemoveAt | Removes the vertex channel at the specified index position.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.IsReadOnly | Determines whether the collection is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.Add | Adds a new vertex channel to the collection.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.CopyTo | Copies the elements of the collection to an array, starting at the specified index.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through a collection.
Explicit Interface Implementation | System.Collections.Generic.IList<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.Insert | Inserts an item at the specified index.

Expand image See Also

Reference

VertexChannelCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection Methods

VertexChannelCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | Overloaded. Adds a new vertex channel to the collection.
Public Method | Clear | Removes all vertex channels from the collection.
Public Method | Contains | Overloaded. Determines whether the collection contains the specified vertex channel.
Public Method | ConvertChannelContent | Overloaded. Converts a channel to another vector format.
Public Method | Equals | (Inherited from Object.)
Public Method | Get | Overloaded. Gets the vertex channel that matches the specified traits.
Public Method | GetEnumerator | Gets an enumerator that iterates through the vertex channels of a collection.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | Overloaded. Determines the index of a vertex channel.
Public Method | Insert | Overloaded. Inserts a new vertex channel into the collection.
Public Method | Remove | Overloaded. Removes a specified vertex channel from the collection.
Public Method | RemoveAt | Removes the vertex channel at the specified index position.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image Explicit Interface Implementations

 | Name | Description
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.IsReadOnly | Determines whether the collection is read-only.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.Add | Adds a new vertex channel to the collection.
Explicit Interface Implementation | System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.CopyTo | Copies the elements of the collection to an array, starting at the specified index.
Explicit Interface Implementation | System.Collections.IEnumerable.GetEnumerator | Returns an enumerator that iterates through a collection.
Explicit Interface Implementation | System.Collections.Generic.IList<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.Insert | Inserts an item at the specified index.

Expand image See Also

Reference

VertexChannelCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection.Add Method

VertexChannelCollection.Add Method

Adds a new vertex channel to the collection.

Expand image Overload List

Name | Description
VertexChannelCollection.Add (String, Generic IEnumerable) | Adds a new vertex channel to the end of the collection.
VertexChannelCollection.Add (String, Type, IEnumerable) | Adds a new vertex channel to the end of the collection.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection.Add Generic Method (String, Generic IEnumerable)

VertexChannelCollection.Add Generic Method (String, Generic IEnumerable)
See Also
CollapseAll image

Adds a new vertex channel to the end of the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel<ElementType> Add<ElementType> (
         string name,
         IEnumerable<ElementType> channelData
)

Type Parameters

ElementType
Type of the channel.

Parameters

name
Name of the new channel.
channelData
Initial data for the new channel. If null, the channel is filled with the default value for that type.

Return Value

The newly added vertex channel.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Add Method (String, Type, IEnumerable)

VertexChannelCollection.Add Method (String, Type, IEnumerable)
See Also
CollapseAll image

Adds a new vertex channel to the end of the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel Add (
         string name,
         Type elementType,
         IEnumerable channelData
)

Parameters

name
Name of the new channel.
elementType
Type of data to be contained in the new channel.
channelData
Initial data for the new channel. If null, the channel is filled with the default value for that type.

Return Value

The newly added vertex channel.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Clear Method

VertexChannelCollection.Clear Method

Removes all vertex channels from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Clear ()

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Contains Method

VertexChannelCollection.Contains Method

Determines whether the collection contains the specified vertex channel.

Expand image Overload List

Name | Description
VertexChannelCollection.Contains (String) | Determines whether the collection contains the specified vertex channel.
VertexChannelCollection.Contains (VertexChannel) | Determines whether the collection contains the specified vertex channel.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection.Contains Method (String)

VertexChannelCollection.Contains Method (String)
See Also
CollapseAll image

Determines whether the collection contains the specified vertex channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Contains (
         string name
)

Parameters

name
Name of the channel being searched for.

Return Value

true if the channel was found; false otherwise.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Contains Method (VertexChannel)

VertexChannelCollection.Contains Method (VertexChannel)
See Also
CollapseAll image

Determines whether the collection contains the specified vertex channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Contains (
         VertexChannel item
)

Parameters

item
Name of the channel being searched for.

Return Value

true if the channel was found; false otherwise.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.ConvertChannelContent Method

VertexChannelCollection.ConvertChannelContent Method

Converts a channel to another vector format.

Expand image Overload List

Name | Description
VertexChannelCollection.ConvertChannelContent (Int32) | Converts the channel, at the specified index, to another vector format.
VertexChannelCollection.ConvertChannelContent (String) | Converts the channel, specified by name to another vector format.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection.ConvertChannelContent Generic Method (Int32)

VertexChannelCollection.ConvertChannelContent Generic Method (Int32)
See Also
CollapseAll image

Converts the channel, at the specified index, to another vector format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel<TargetType> ConvertChannelContent<TargetType> (
         int index
)

Type Parameters

TargetType

Type of the target format. Can be one of the following:

  • Single
  • Vector2
  • Vector3
  • Vector4
  • IPackedVector

Parameters

index
Index of the channel to be converted.

Return Value

New channel in the specified format.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.ConvertChannelContent Generic Method (String)

VertexChannelCollection.ConvertChannelContent Generic Method (String)
See Also
CollapseAll image

Converts the channel, specified by name to another vector format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel<TargetType> ConvertChannelContent<TargetType> (
         string name
)

Type Parameters

TargetType

Type of the target format. Can be one of the following:

  • Single
  • Vector2
  • Vector3
  • Vector4
  • IPackedVector

Parameters

name
Name of the channel to be converted.

Return Value

New channel in the specified format.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Get Method

VertexChannelCollection.Get Method

Gets the vertex channel that matches the specified traits.

Expand image Overload List

Name | Description
VertexChannelCollection.Get (Int32) | Gets the vertex channel with the specified index and content type.
VertexChannelCollection.Get (String) | Gets the vertex channel with the specified name and content type.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection.Get Generic Method (Int32)

VertexChannelCollection.Get Generic Method (Int32)
See Also
CollapseAll image

Gets the vertex channel with the specified index and content type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel<T> Get<T> (
         int index
)

Type Parameters

T
Type of a vertex channel.

Parameters

index
Index of a vertex channel.

Return Value

The vertex channel.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Get Generic Method (String)

VertexChannelCollection.Get Generic Method (String)
See Also
CollapseAll image

Gets the vertex channel with the specified name and content type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel<T> Get<T> (
         string name
)

Type Parameters

T
Type of the vertex channel.

Parameters

name
Name of a vertex channel.

Return Value

The vertex channel.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.GetEnumerator Method

VertexChannelCollection.GetEnumerator Method

Gets an enumerator that iterates through the vertex channels of a collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IEnumerator<VertexChannel> GetEnumerator ()

Return Value

Enumerator for the collection.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.IndexOf Method

VertexChannelCollection.IndexOf Method

Determines the index of a vertex channel.

Expand image Overload List

Name | Description
VertexChannelCollection.IndexOf (String) | Determines the index of a vertex channel with the specified name.
VertexChannelCollection.IndexOf (VertexChannel) | Determines the index of the specified vertex channel.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection.IndexOf Method (String)

VertexChannelCollection.IndexOf Method (String)
See Also
CollapseAll image

Determines the index of a vertex channel with the specified name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int IndexOf (
         string name
)

Parameters

name
Name of the vertex channel being searched for.

Return Value

Index of the vertex channel.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.IndexOf Method (VertexChannel)

VertexChannelCollection.IndexOf Method (VertexChannel)
See Also
CollapseAll image

Determines the index of the specified vertex channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int IndexOf (
         VertexChannel item
)

Parameters

item
Vertex channel being searched for.

Return Value

Index of the vertex channel.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Insert Method

VertexChannelCollection.Insert Method

Inserts a new vertex channel into the collection.

Expand image Overload List

Name | Description
VertexChannelCollection.Insert (Int32, String, Generic IEnumerable) | Inserts a new vertex channel at the specified position.
VertexChannelCollection.Insert (Int32, String, Type, IEnumerable) | Inserts a new vertex channel at the specified position.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection.Insert Generic Method (Int32, String, Generic IEnumerable)

VertexChannelCollection.Insert Generic Method (Int32, String, Generic IEnumerable)
See Also
CollapseAll image

Inserts a new vertex channel at the specified position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel<ElementType> Insert<ElementType> (
         int index,
         string name,
         IEnumerable<ElementType> channelData
)

Type Parameters

ElementType
Type of the new channel.

Parameters

index
Index for channel insertion.
name
Name of the new channel.
channelData
The new channel.

Return Value

The inserted vertex channel.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Insert Method (Int32, String, Type, IEnumerable)

VertexChannelCollection.Insert Method (Int32, String, Type, IEnumerable)
See Also
CollapseAll image

Inserts a new vertex channel at the specified position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel Insert (
         int index,
         string name,
         Type elementType,
         IEnumerable channelData
)

Parameters

index
Index for channel insertion.
name
Name of the new channel.
elementType
Type of the new channel.
channelData
Initial data for the new channel. If null, it is filled with the default value.

Return Value

The inserted vertex channel.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Remove Method

VertexChannelCollection.Remove Method

Removes a specified vertex channel from the collection.

Expand image Overload List

Name | Description
VertexChannelCollection.Remove (String) | Removes the specified vertex channel from the collection.
VertexChannelCollection.Remove (VertexChannel) | Removes the specified vertex channel from the collection.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection.Remove Method (String)

VertexChannelCollection.Remove Method (String)
See Also
CollapseAll image

Removes the specified vertex channel from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Remove (
         string name
)

Parameters

name
Name of the vertex channel being removed.

Return Value

true if the channel was removed; false otherwise.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Remove Method (VertexChannel)

VertexChannelCollection.Remove Method (VertexChannel)
See Also
CollapseAll image

Removes the specified vertex channel from the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool Remove (
         VertexChannel item
)

Parameters

item
Name of the vertex channel being removed.

Return Value

true if the channel was removed; false otherwise.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.RemoveAt Method

VertexChannelCollection.RemoveAt Method

Removes the vertex channel at the specified index position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void RemoveAt (
         int index
)

Parameters

index
Index of the vertex channel being removed.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.Add Method

System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.Add Method
See Also
CollapseAll image

Adds a new vertex channel to the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.Add (
         VertexChannel item
)

Parameters

item
Vertex channel to be added.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.CopyTo Method

System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.CopyTo Method
See Also
CollapseAll image

Copies the elements of the collection to an array, starting at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.CopyTo (
         VertexChannel[] array,
         int arrayIndex
)

Parameters

array
The destination array.
arrayIndex
The index at which to begin copying elements.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.Generic.IList<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.Insert Method

System.Collections.Generic.IList<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.Insert Method
See Also
CollapseAll image

Inserts an item at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private void System.Collections.Generic.IList<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.Insert (
         int index,
         VertexChannel item
)

Parameters

index
The zero-based index at which item should be inserted.
item
The item to insert.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


System.Collections.IEnumerable.GetEnumerator Method

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through a collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Return Value

An object that can be used to iterate through the collection.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection Properties

VertexChannelCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | Gets the number of vertex channels in the collection.
Public Property | Item | Overloaded. Gets or sets a vertex channel from the collection.

Expand image See Also

Reference

VertexChannelCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection.Count Property

VertexChannelCollection.Count Property

Gets the number of vertex channels in the collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Count { get; }

Property Value

Number of vertex channels.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Item Property

VertexChannelCollection.Item Property

Gets or sets a vertex channel from the collection.

Expand image Overload List

Name | Description
VertexChannelCollection.Item (Int32) | Gets or sets the vertex channel at the specified index position.
VertexChannelCollection.Item (String) | Gets or sets the vertex channel with the specified name.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelCollection.Item Property (Int32)

VertexChannelCollection.Item Property (Int32)
See Also
CollapseAll image

Gets or sets the vertex channel at the specified index position.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel this [
         int index
] { get; set; }

Property Value

A vertex channel object.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.Item Property (String)

VertexChannelCollection.Item Property (String)
See Also
CollapseAll image

Gets or sets the vertex channel with the specified name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel this [
         string name
] { get; }

Property Value

A vertex channel object.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelCollection.System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.IsReadOnly Property

VertexChannelCollection.System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.IsReadOnly Property
See Also
CollapseAll image

Determines whether the collection is read-only.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
private bool System.Collections.Generic.ICollection<Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel>.IsReadOnly { get; }

Property Value

true if the collection is read-only; false otherwise.

Expand image See Also

Reference

VertexChannelCollection Class
VertexChannelCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames Class

VertexChannelNames Class
See Also Members
CollapseAll image

Provides properties for managing a collection of vertex channel names.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static class VertexChannelNames

Expand image Remarks

These vertex channel names can be passed to VertexChannelCollection.Add and looked up using the Name property of a specific vertex channel. The names are stored in the VertexChannel.Name property.

Expand image See Also

Reference

VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames Members

VertexChannelNames Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the VertexChannelNames type.

Expand image Public Methods

Name | Description
Binormal | Gets the name of a binormal vector channel with the specified index.
Color | Gets the name of a color channel with the specified index.
DecodeBaseName | Gets a channel base name stub from the encoded string format.
DecodeUsageIndex | Gets a channel usage index from the encoded format.
EncodeName | Overloaded. Combines a vertex string and usage index into an encoded string.
Normal | Overloaded. Gets the name of a normal channel.
Tangent | Gets the name of the tangent vector channel with the specified index.
TextureCoordinate | Gets the name of the texture coordinate channel with the specified index.
TryDecodeUsage | Gets a vertex declaration usage enumeration from the encoded string format.
Weights | Overloaded. Gets the name of an animation weights channel.

Expand image See Also

Reference

VertexChannelNames Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelNames Methods

VertexChannelNames Methods

Expand image Public Methods

Name | Description
Binormal | Gets the name of a binormal vector channel with the specified index.
Color | Gets the name of a color channel with the specified index.
DecodeBaseName | Gets a channel base name stub from the encoded string format.
DecodeUsageIndex | Gets a channel usage index from the encoded format.
EncodeName | Overloaded. Combines a vertex string and usage index into an encoded string.
Normal | Overloaded. Gets the name of a normal channel.
Tangent | Gets the name of the tangent vector channel with the specified index.
TextureCoordinate | Gets the name of the texture coordinate channel with the specified index.
TryDecodeUsage | Gets a vertex declaration usage enumeration from the encoded string format.
Weights | Overloaded. Gets the name of an animation weights channel.

Expand image See Also

Reference

VertexChannelNames Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelNames.Binormal Method

VertexChannelNames.Binormal Method

Gets the name of a binormal vector channel with the specified index.

This will typically contain Vector3 data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string Binormal (
         int usageIndex
)

Parameters

usageIndex
Zero-based index of the vector channel being retrieved.

Return Value

Name of the retrieved vector channel.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.Color Method

VertexChannelNames.Color Method

Gets the name of a color channel with the specified index.

This will typically contain Vector3 data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string Color (
         int usageIndex
)

Parameters

usageIndex
Zero-based index of the color channel being retrieved.

Return Value

Name of the retrieved color channel.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.DecodeBaseName Method

VertexChannelNames.DecodeBaseName Method

Gets a channel base name stub from the encoded string format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string DecodeBaseName (
         string encodedName
)

Parameters

encodedName
Encoded string to be decoded.

Return Value

Extracted base name.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.DecodeUsageIndex Method

VertexChannelNames.DecodeUsageIndex Method

Gets a channel usage index from the encoded format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static int DecodeUsageIndex (
         string encodedName
)

Parameters

encodedName
Encoded name to be decoded.

Return Value

Resulting channel usage index.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.EncodeName Method

VertexChannelNames.EncodeName Method

Combines a vertex string and usage index into an encoded string.

Expand image Overload List

Name | Description
VertexChannelNames.EncodeName (String, Int32) | Combines a channel name stub and usage index into a string name.
VertexChannelNames.EncodeName (VertexElementUsage, Int32) | Combines a vertex declaration usage and usage index into a string name.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelNames.EncodeName Method (String, Int32)

VertexChannelNames.EncodeName Method (String, Int32)
See Also
CollapseAll image

Combines a channel name stub and usage index into a string name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string EncodeName (
         string baseName,
         int usageIndex
)

Parameters

baseName
A channel base name stub.
usageIndex
A channel usage index.

Return Value

Resulting encoded name.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.EncodeName Method (VertexElementUsage, Int32)

VertexChannelNames.EncodeName Method (VertexElementUsage, Int32)
See Also
CollapseAll image

Combines a vertex declaration usage and usage index into a string name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string EncodeName (
         VertexElementUsage vertexElementUsage,
         int usageIndex
)

Parameters

vertexElementUsage
A vertex declaration.
usageIndex
An index for the vertex declaration.

Return Value

Resulting encoded name.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.Normal Method

VertexChannelNames.Normal Method

Gets the name of a normal channel.

This will typically contain Vector3 data.

Expand image Overload List

Name | Description
VertexChannelNames.Normal () | Gets the name of the primary normal channel.
VertexChannelNames.Normal (Int32) | Gets the name of the normal channel with the specified index.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelNames.Normal Method ()

VertexChannelNames.Normal Method ()
See Also
CollapseAll image

Gets the name of the primary normal channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string Normal ()

Return Value

Primary normal channel name.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.Normal Method (Int32)

VertexChannelNames.Normal Method (Int32)
See Also
CollapseAll image

Gets the name of the normal channel with the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string Normal (
         int usageIndex
)

Parameters

usageIndex
Zero-based index of the normal channel being retrieved.

Return Value

Normal channel at the specified index.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.Tangent Method

VertexChannelNames.Tangent Method

Gets the name of the tangent vector channel with the specified index.

This will typically contain Vector3 data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string Tangent (
         int usageIndex
)

Parameters

usageIndex
Zero-based index of the tangent vector channel being retrieved.

Return Value

Name of the retrieved tangent vector channel.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.TextureCoordinate Method

VertexChannelNames.TextureCoordinate Method

Gets the name of the texture coordinate channel with the specified index.

This will typically contain Vector3 data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string TextureCoordinate (
         int usageIndex
)

Parameters

usageIndex
Zero-based index of the texture coordinate channel being retrieved.

Return Value

Name of the retrieved texture coordinate channel.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.TryDecodeUsage Method

VertexChannelNames.TryDecodeUsage Method

Gets a vertex declaration usage enumeration from the encoded string format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static bool TryDecodeUsage (
         string encodedName,
         out VertexElementUsage usage
)

Parameters

encodedName
Encoded name of a vertex declaration.
usage
[OutAttribute] Value of the declaration usage for the vertex declaration.

Return Value

true if the encoded name maps to a VertexElementUsage enumeration value; false otherwise.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.Weights Method

VertexChannelNames.Weights Method

Gets the name of an animation weights channel.

This will typically contain data on the bone weights for a vertex channel. For more information, see BoneWeightCollection.

Expand image Overload List

Name | Description
VertexChannelNames.Weights () | Gets the name of the primary animation weights channel.
VertexChannelNames.Weights (Int32) | Gets the name of an animation weights channel at the specified index.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexChannelNames.Weights Method ()

VertexChannelNames.Weights Method ()
See Also
CollapseAll image

Gets the name of the primary animation weights channel.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string Weights ()

Return Value

Name of the primary animation weights channel.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexChannelNames.Weights Method (Int32)

VertexChannelNames.Weights Method (Int32)
See Also
CollapseAll image

Gets the name of an animation weights channel at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static string Weights (
         int usageIndex
)

Parameters

usageIndex
Index of the animation weight channel to be retrieved.

Return Value

Name of the retrieved animation weights channel.

Expand image See Also

Reference

VertexChannelNames Class
VertexChannelNames Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent Class

VertexContent Class
See Also Members
CollapseAll image

Provides methods and properties for maintaining the vertex data of a GeometryContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class VertexContent

Expand image Remarks

This class combines a collection of arbitrarily named data channels with a list of position indices that reference the Positions collection of the parent MeshContent.

Expand image See Also

Reference

VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent Members

VertexContent Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the VertexContent type.

Expand image Public Properties

 | Name | Description
Public Property | Channels | Gets the list of named vertex data channels in the VertexContent.
Public Property | PositionIndices | Gets the list of position indices.
Public Property | Positions | Gets position data from the parent mesh object.
Public Property | VertexCount | Number of vertices for the content.

Expand image Public Methods

 | Name | Description
Public Method | Add | Appends a new vertex index to the end of the PositionIndices collection.
Public Method | AddRange | Appends multiple vertex indices to the end of the PositionIndices collection.
Public Method | CreateVertexBuffer | Converts design-time vertex position and channel data into a vertex buffer format that a graphics device can recognize.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Insert | Inserts a new vertex index to the PositionIndices collection.
Public Method | InsertRange | Inserts multiple vertex indices to the PositionIndices collection.
Public Method | RemoveAt | Removes a vertex index from the specified location in both PositionIndices and VertexChannel<T>.
Public Method | RemoveRange | Removes a range of vertex indices from the specified location in both PositionIndices and VertexChannel<T>.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexContent Methods

VertexContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Add | Appends a new vertex index to the end of the PositionIndices collection.
Public Method | AddRange | Appends multiple vertex indices to the end of the PositionIndices collection.
Public Method | CreateVertexBuffer | Converts design-time vertex position and channel data into a vertex buffer format that a graphics device can recognize.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Insert | Inserts a new vertex index to the PositionIndices collection.
Public Method | InsertRange | Inserts multiple vertex indices to the PositionIndices collection.
Public Method | RemoveAt | Removes a vertex index from the specified location in both PositionIndices and VertexChannel<T>.
Public Method | RemoveRange | Removes a range of vertex indices from the specified location in both PositionIndices and VertexChannel<T>.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexContent.Add Method

VertexContent.Add Method

Appends a new vertex index to the end of the PositionIndices collection.

Other vertex channels will automatically be extended and the new indices populated with default values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Add (
         int positionIndex
)

Parameters

positionIndex
Index into the MeshContent.Positions member of the parent.

Return Value

Index of the new entry. This can be added to the Indices member of the parent.

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent.AddRange Method

VertexContent.AddRange Method

Appends multiple vertex indices to the end of the PositionIndices collection.

Other vertex channels will automatically be extended and the new indices populated with default values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void AddRange (
         IEnumerable<int> positionIndexCollection
)

Parameters

positionIndexCollection
Index into the Positions member of the parent.

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent.CreateVertexBuffer Method

VertexContent.CreateVertexBuffer Method

Converts design-time vertex position and channel data into a vertex buffer format that a graphics device can recognize.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexBufferContent CreateVertexBuffer ()

Return Value

A packed vertex buffer.

Expand image Exceptions

Exception type | Condition
InvalidContentException | One or more of the vertex channel types are invalid or an unrecognized name was passed to VertexElementUsage.

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent.Insert Method

VertexContent.Insert Method

Inserts a new vertex index to the PositionIndices collection.

Other vertex channels will automatically be extended and the new indices populated with default values.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Insert (
         int index,
         int positionIndex
)

Parameters

index
Vertex index to be inserted.
positionIndex
Position of new vertex index in the collection.

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent.InsertRange Method

VertexContent.InsertRange Method

Inserts multiple vertex indices to the PositionIndices collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void InsertRange (
         int index,
         IEnumerable<int> positionIndexCollection
)

Parameters

index
Vertex index to be inserted.
positionIndexCollection
Position of the first element of the inserted range in the collection.

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent.RemoveAt Method

VertexContent.RemoveAt Method

Removes a vertex index from the specified location in both PositionIndices and VertexChannel<T>.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void RemoveAt (
         int index
)

Parameters

index
Index of the vertex to be removed.

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent.RemoveRange Method

VertexContent.RemoveRange Method

Removes a range of vertex indices from the specified location in both PositionIndices and VertexChannel<T>.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void RemoveRange (
         int index,
         int count
)

Parameters

index
Index of the first vertex index to be removed.
count
Number of indices to remove.

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent Properties

VertexContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Channels | Gets the list of named vertex data channels in the VertexContent.
Public Property | PositionIndices | Gets the list of position indices.
Public Property | Positions | Gets position data from the parent mesh object.
Public Property | VertexCount | Number of vertices for the content.

Expand image See Also

Reference

VertexContent Class
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace


VertexContent.Channels Property

VertexContent.Channels Property

Gets the list of named vertex data channels in the VertexContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannelCollection Channels { get; }

Property Value

Collection of vertex data channels.

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent.PositionIndices Property

VertexContent.PositionIndices Property

Gets the list of position indices.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexChannel<int> PositionIndices { get; }

Property Value

Position of the position index being retrieved.

Expand image Remarks

This list adds a level of indirection between the actual triangle indices and the Positions member of the parent. This indirection preserves the topological vertex identity in cases where a single vertex position is used by triangles that straddle a discontinuity in some other data channel.

For example, the following code gets the position of the first vertex of the first triangle in a GeometryContent object:

parent.Positions[Vertices.PositionIndices[Indices[0]]]

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent.Positions Property

VertexContent.Positions Property

Gets position data from the parent mesh object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IndirectPositionCollection Positions { get; }

Property Value

Collection of vertex positions for the mesh.

Expand image Remarks

The collection returned from this call provides a virtualized view of the vertex positions for this batch. The collection uses the contents of the PositionIndices property to index into the parent Positions. This collection is read-only. If you need to modify any contained values, edit the PositionIndices or Positions members directly.

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexContent.VertexCount Property

VertexContent.VertexCount Property

Number of vertices for the content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int VertexCount { get; }

Property Value

Number of vertices.

Expand image See Also

Reference

VertexContent Class
VertexContent Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace
CollapseAll image

Provides base classes that represent processors used by the XNA Framework Content Pipeline when processing specific game asset types.

Expand image Classes

 | Name | Description
Public Class | CompiledEffectContent | Represents a compiled Effect.
Public Class | EffectProcessor | Processes a string representation to a platform-specific compiled effect.
Public Class | FontDescriptionProcessor | Provides methods to convert a font description class containing the name and size of a font into SpriteFontContent.
Public Class | FontTextureProcessor | Provides methods to convert a specially marked 2D bitmap into SpriteFontContent.
Public Class | MaterialProcessor | Builds the effects and textures of a MaterialContent object.
Public Class | ModelBoneContent | Stores design-time data for a ModelBone asset.
Public Class | ModelBoneContentCollection | A collection of ModelBoneContent objects.
Public Class | ModelContent | Stores design-time data for a Model asset.
Public Class | ModelMeshContent | Stores design-time data for a ModelMesh asset.
Public Class | ModelMeshContentCollection | A collection of ModelMeshContent objects.
Public Class | ModelMeshPartContent | Stores design-time data for a ModelMeshPart asset.
Public Class | ModelMeshPartContentCollection | Collection of ModelMeshPartContent objects.
Public Class | ModelProcessor | Processes a game asset mesh to a model content that is optimal for runtime.
Public Class | ModelTextureProcessor | Processes textures for 3D models.
Public Class | PassThroughProcessor | Provides an implementation of a no-operation processor that returns an unmodified copy of the input data.
Public Class | SongContent | Represents a processed Song object.
Public Class | SongProcessor | A custom song processor that processes an intermediate AudioContent type.
Public Class | SoundEffectContent | Represents a processed sound effect.
Public Class | SoundEffectProcessor | Provides a custom sound effect processor that processes an intermediate AudioContent type.
Public Class | SpriteFontContent | Provides methods and properties for managing a design-time SpriteFont Class holding packed font data.
Public Class | SpriteTextureProcessor | Processes textures for use as 2D sprites or user interface components.
Public Class | TextureProcessor | Provides methods for processing textures.
Public Class | VertexBufferContent | Provides methods and properties for managing a design-time vertex buffer that holds packed vertex data.
Public Class | VertexDeclarationContent | Provides methods and properties for maintaining the vertex declaration data of a VertexContent.
Public Class | VideoProcessor | Processes videos for playback within a game.

Expand image Enumerations

 | Name | Description
Public Enumeration | EffectProcessorDebugMode | Specifies how debugging of effects is to be supported in PIX.
Public Enumeration | MaterialProcessorDefaultEffect | Specifies the default effect type.
Public Enumeration | TextureProcessorOutputFormat | Specifies the target output (of type SurfaceFormat) of the texture processor.


CompiledEffectContent Class

CompiledEffectContent Class
See Also Members
CollapseAll image

Represents a compiled Effect.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class CompiledEffectContent : ContentItem

Expand image See Also

Reference

CompiledEffectContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CompiledEffectContent Members

CompiledEffectContent Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the CompiledEffectContent type.

Expand image Public Constructors

 | Name | Description
Public Method | CompiledEffectContent | Creates a new instance of the CompiledEffectContent class
 | CompiledEffectContent | Overloaded. Creates a new instance of the CompiledEffectContent class

Expand image Public Properties

 | Name | Description
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEffectCode | Retrieves the compiled byte code for this shader.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

CompiledEffectContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


CompiledEffectContent Constructor

CompiledEffectContent Constructor

Creates a new instance of the CompiledEffectContent class

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public CompiledEffectContent (
         byte[] effectCode
)

Parameters

effectCode
The compiled effect code.

Expand image See Also

Reference

CompiledEffectContent Class
CompiledEffectContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CompiledEffectContent Constructor

CompiledEffectContent Constructor

Creates a new instance of the CompiledEffectContent class

Expand image Overload List

Name Description

Expand image See Also

Reference

CompiledEffectContent Class
CompiledEffectContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


CompiledEffectContent Methods

CompiledEffectContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetEffectCode | Retrieves the compiled byte code for this shader.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

CompiledEffectContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


CompiledEffectContent.GetEffectCode Method

CompiledEffectContent.GetEffectCode Method

Retrieves the compiled byte code for this shader.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public byte[] GetEffectCode ()

Return Value

The compiled bytecode.

Expand image See Also

Reference

CompiledEffectContent Class
CompiledEffectContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectProcessor Class

EffectProcessor Class
See Also Members
CollapseAll image

Processes a string representation to a platform-specific compiled effect.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentProcessorAttribute]
public class EffectProcessor : ContentProcessor<EffectContent, CompiledEffectContent>

Expand image See Also

Reference

EffectProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectProcessor Members

EffectProcessor Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the EffectProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | EffectProcessor | Initializes a new instance of EffectProcessor.

Expand image Public Properties

 | Name | Description
Public Property | DebugMode | The debug mode for compiling effects.
Public Property | Defines | Define assignments for the effect.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes the string representation of the specified effect into a platform-specific binary format using the specified context.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


EffectProcessor Constructor

EffectProcessor Constructor

Initializes a new instance of EffectProcessor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public EffectProcessor ()

Expand image See Also

Reference

EffectProcessor Class
EffectProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectProcessor Methods

EffectProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes the string representation of the specified effect into a platform-specific binary format using the specified context.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

EffectProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


EffectProcessor.Process Method

EffectProcessor.Process Method

Processes the string representation of the specified effect into a platform-specific binary format using the specified context.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override CompiledEffectContent Process (
         EffectContent input,
         ContentProcessorContext context
)

Parameters

input
The effect string to be processed.
context
Context for the specified processor.

Return Value

A platform-specific compiled binary effect.

Expand image Remarks

If you get an error during processing, compilation stops immediately. The effect processor displays an error message. Once you fix the current error, it is possible you may get more errors on subsequent compilation attempts.

Note
When processing effects for the Xbox 360 platform, the following conditional compilation symbols are defined: XBOX and XBOX360. For more information, see Cross-Platform Conditional Compilation Symbols.

Expand image See Also

Reference

EffectProcessor Class
EffectProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectProcessor Properties

EffectProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | DebugMode | The debug mode for compiling effects.
Public Property | Defines | Define assignments for the effect.

Expand image See Also

Reference

EffectProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


EffectProcessor.DebugMode Property

EffectProcessor.DebugMode Property

The debug mode for compiling effects.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual EffectProcessorDebugMode DebugMode { get; set; }

Property Value

The debug mode to use when compiling effects.

Expand image See Also

Reference

EffectProcessor Class
EffectProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectProcessor.Defines Property

EffectProcessor.Defines Property

Define assignments for the effect.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual string Defines { get; set; }

Property Value

A list of define assignments delimited by semicolons.

Expand image See Also

Reference

EffectProcessor Class
EffectProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


EffectProcessorDebugMode Enumeration

EffectProcessorDebugMode Enumeration

Specifies how debugging of effects is to be supported in PIX.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public enum EffectProcessorDebugMode

Expand image Members

Member name | Value | Description
Auto | 0 | Enables effect debugging when built with Debug profile.
Debug | 1 | Enables effect debugging for all profiles. Will produce unoptimized shaders.
Optimize | 2 | Disables debugging for all profiles, produce optimized shaders.

Expand image See Also

Reference

Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescriptionProcessor Class

FontDescriptionProcessor Class
See Also Members
CollapseAll image

Provides methods to convert a font description class containing the name and size of a font into SpriteFontContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentProcessorAttribute]
public class FontDescriptionProcessor : ContentProcessor<FontDescription, SpriteFontContent>

Expand image See Also

Reference

FontDescriptionProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Tasks

How to: Extend the Font Description Processor to Support Additional Characters

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescriptionProcessor Members

FontDescriptionProcessor Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the FontDescriptionProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | FontDescriptionProcessor | Initializes a new instance of FontDescriptionProcessor.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Creates SpriteFontContent from a FontDescription object.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FontDescriptionProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


FontDescriptionProcessor Constructor

FontDescriptionProcessor Constructor

Initializes a new instance of FontDescriptionProcessor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public FontDescriptionProcessor ()

Expand image See Also

Reference

FontDescriptionProcessor Class
FontDescriptionProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontDescriptionProcessor Methods

FontDescriptionProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Creates SpriteFontContent from a FontDescription object.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FontDescriptionProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


FontDescriptionProcessor.Process Method

FontDescriptionProcessor.Process Method

Creates SpriteFontContent from a FontDescription object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override SpriteFontContent Process (
         FontDescription input,
         ContentProcessorContext context
)

Parameters

input
Description of the font to build.
context
Context for the specified processor.

Return Value

The font data.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | input is null.

Expand image See Also

Reference

FontDescriptionProcessor Class
FontDescriptionProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontTextureProcessor Class

FontTextureProcessor Class
See Also Members
CollapseAll image

Provides methods to convert a specially marked 2D bitmap into SpriteFontContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentProcessorAttribute]
public class FontTextureProcessor : ContentProcessor<Texture2DContent, SpriteFontContent>

Expand image Remarks

The FontTextureProcessor class transforms a specially formatted bitmap-font texture into a SpriteFontContent object that can be loaded at run time as a standard SpriteFont object.

A bitmap-font texture must not contain more than one glyph for any given character code point; otherwise, it would not be clear which to use.

You can create a bitmap-font texture in the appropriate format using almost any raster drawing program. Place all the characters of the font in order on the bitmap as follows:

Each character should be arranged on the bitmap in a grid ordered from upper left to lower right. Monochrome characters should use white for solid areas and black for transparent areas. To include multicolored characters, add an alpha channel to the bitmap and use that to control which parts of the character are solid. Fill the spaces between each character and around the edges of the grid with a specific magenta color having the value Red:255 Green:0 Blue:255 Alpha:255. The processor packs the characters together as tightly as possible, eliminating any wasted space in the original grid.

The following figure shows an example of this kind of font texture.

The default behavior of FontTextureProcessor is to expect the first character at the upper left corner of the grid to be a space character (ASCII and Unicode code 32), and the one beside it to be an exclamation point (ASCII and Unicode code 33), and the succeeding characters to appear in Unicode order for all the characters that the font contains.

You can support a different range and order of characters by writing a custom processor that extends FontTextureProcessor by overriding the GetCharacterForIndex method. For example, the code below creates a processor class that you could use to load a bitmap font texture containing the numeric digits from 1 to 9:

C#
[ContentProcessor]
public class MyFontTextureProcessor : FontTextureProcessor
{
   protected override char GetCharacterForIndex( int index )
   {
      return (char)('1' + index);
   }
}

Be sure to include the [ContentProcessor] attribute before the class declaration, as shown in this example.

Expand image See Also

Reference

FontTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontTextureProcessor Members

FontTextureProcessor Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the FontTextureProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | FontTextureProcessor | Initializes a new instance of FontTextureProcessor.

Expand image Public Properties

 | Name | Description
Public Property | FirstCharacter | Gets or sets the value of the First Character processor parameter.
Public Property | PremultiplyAlpha | Specifies whether alpha premultiply of font textures is enabled.
Public Property | TextureFormat | Gets or sets the output SurfaceFormat of textures.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Creates SpriteFontContent from a bitmap.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetCharacterForIndex | Maps a glyph index to a character.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FontTextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


FontTextureProcessor Constructor

FontTextureProcessor Constructor

Initializes a new instance of FontTextureProcessor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public FontTextureProcessor ()

Expand image See Also

Reference

FontTextureProcessor Class
FontTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontTextureProcessor Methods

FontTextureProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Creates SpriteFontContent from a bitmap.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | GetCharacterForIndex | Maps a glyph index to a character.
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

FontTextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


FontTextureProcessor.GetCharacterForIndex Method

FontTextureProcessor.GetCharacterForIndex Method

Maps a glyph index to a character.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual char GetCharacterForIndex (
         int index
)

Parameters

index
The glyph index. This is a zero-based index that corresponds to the position of the glyph in the original character. This value begins at the upper-left corner of the texture and increases when moving to the right and down.

Return Value

The character represented by the specified glyph index.

Expand image Exceptions

Exception type | Condition
ArgumentOutOfRangeException | index is out of the range of available characters.

Expand image Remarks

This method is designed to be overridden by a subclass of this processor. For example, if the original texture contains the characters A, B, and C, in that order, this method should return "A" when passed 0, "B" when passed 1, and "C" when passed 2. Subclasses of this processor may override this method to control which characters a bitmap font represents.

If not overridden, the default implementation of this function assumes a Unicode order of character code points starting at code point 32—the space character. In other words, it assumes that a character index of zero corresponds to a space character, a character index of 1 corresponds to an exclamation point ("!"), and so on.

A font texture must not contain more than one instance of any given character code point. For example, it must not contain two uppercase "A" characters. As a result, any implementation of this function should ensure that it cannot return the same character for two different indices.

Expand image See Also

Reference

FontTextureProcessor Class
FontTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontTextureProcessor.Process Method

FontTextureProcessor.Process Method

Creates SpriteFontContent from a bitmap.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override SpriteFontContent Process (
         Texture2DContent input,
         ContentProcessorContext context
)

Parameters

input
The bitmap data to convert to a font.
context
Context for the specified processor.

Return Value

The font data.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | input is null.
InvalidOperationException | A character cannot be mapped to a glyph index: it is already mapped to a glyph index.

Expand image Remarks

Each character should be arranged on the bitmap in a grid ordered from upper left to lower right. Monochrome characters should use white for solid areas and black for transparent areas. To include multicolored characters, add an alpha channel to the bitmap and use that to control which parts of the character are solid. Fill the spaces between each character and around the edges of the grid with a specific magenta color having the value Red:255 Green:0 Blue:255 Alpha:255. The processor packs the characters together as tightly as possible, eliminating any wasted space in the original grid.

Expand image See Also

Reference

FontTextureProcessor Class
FontTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontTextureProcessor Properties

FontTextureProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | FirstCharacter | Gets or sets the value of the First Character processor parameter.
Public Property | PremultiplyAlpha | Specifies whether alpha premultiply of font textures is enabled.
Public Property | TextureFormat | Gets or sets the output SurfaceFormat of textures.

Expand image See Also

Reference

FontTextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


FontTextureProcessor.FirstCharacter Property

FontTextureProcessor.FirstCharacter Property

Gets or sets the value of the First Character processor parameter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual char FirstCharacter { get; set; }

Property Value

The start character of the font texture being processed.

Expand image See Also

Reference

FontTextureProcessor Class
FontTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontTextureProcessor.PremultiplyAlpha Property

FontTextureProcessor.PremultiplyAlpha Property

Specifies whether alpha premultiply of font textures is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[DefaultValueAttribute(true)]
public virtual bool PremultiplyAlpha { get; set; }

Property Value

true if alpha premultiply is enabled; false otherwise.

Expand image See Also

Reference

FontTextureProcessor Class
FontTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


FontTextureProcessor.TextureFormat Property

FontTextureProcessor.TextureFormat Property

Gets or sets the output SurfaceFormat of textures.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual TextureProcessorOutputFormat TextureFormat { get; set; }

Property Value

The output SurfaceFormat of textures.

Expand image Remarks

Textures can be left unchanged from the source asset, converted to the Color format, or DXT compressed.

Expand image See Also

Reference

FontTextureProcessor Class
FontTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor Class

MaterialProcessor Class
See Also Members
CollapseAll image

Builds the effects and textures of a MaterialContent object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentProcessorAttribute]
public class MaterialProcessor : ContentProcessor<MaterialContent, MaterialContent>

Expand image See Also

Reference

MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor Members

MaterialProcessor Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the MaterialProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | MaterialProcessor | Initializes a new instance of the MaterialProcessor class.

Expand image Public Properties

 | Name | Description
Public Property | ColorKeyColor | Gets or sets the color value to replace with transparent black.
Public Property | ColorKeyEnabled | Specifies whether color keying of a texture is enabled.
Public Property | DefaultEffect | The default effect type for this instance of MaterialProcessor.
Public Property | GenerateMipmaps | Specifies if a full chain of mipmaps are generated from the source material. Existing mipmaps of the material are not replaced.
Public Property | PremultiplyTextureAlpha | Specifies whether alpha premultiply of textures is enabled.
Public Property | ResizeTexturesToPowerOfTwo | Specifies whether resizing of a material is enabled.
Public Property | TextureFormat | Specifies the texture format of output materials.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Builds the texture and effect content for the material.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | BuildEffect | Builds effect content.
Protected Method | BuildTexture | Builds texture content.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MaterialProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


MaterialProcessor Constructor

MaterialProcessor Constructor

Initializes a new instance of the MaterialProcessor class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MaterialProcessor ()

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor Methods

MaterialProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Builds the texture and effect content for the material.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | BuildEffect | Builds effect content.
Protected Method | BuildTexture | Builds texture content.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

MaterialProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


MaterialProcessor.BuildEffect Method

MaterialProcessor.BuildEffect Method

Builds effect content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual ExternalReference<CompiledEffectContent> BuildEffect (
         ExternalReference<EffectContent> effect,
         ContentProcessorContext context
)

Parameters

effect
An external reference to the effect content.
context
Context for the specified processor.

Return Value

A platform-specific compiled binary effect.

Expand image Remarks

If the input to process is of type EffectMaterialContent, this function will be called to request that the EffectContent be built. The EffectProcessor is used to process the EffectContent. Subclasses of MaterialProcessor can override this function to modify the parameters used to build EffectContent. For example, a different version of this function could request a different processor for the EffectContent.

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor.BuildTexture Method

MaterialProcessor.BuildTexture Method

Builds texture content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual ExternalReference<TextureContent> BuildTexture (
         string textureName,
         ExternalReference<TextureContent> texture,
         ContentProcessorContext context
)

Parameters

textureName
The name of the texture. This should correspond to the key used to store the texture in Textures.
texture
The asset to build. This should be a member of Textures.
context
Context for the specified processor.

Return Value

The built texture content.

Expand image Remarks

textureName can be used to determine which processor to use. For example, if a texture is being used as a normal map, the user may not want to use the ModelTextureProcessor on it, which compresses textures.

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor.Process Method

MaterialProcessor.Process Method

Builds the texture and effect content for the material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override MaterialContent Process (
         MaterialContent input,
         ContentProcessorContext context
)

Parameters

input
The material content to build.
context
Context for the specified processor.

Return Value

The built material.

Expand image Remarks

If the MaterialContent is of type EffectMaterialContent, a build is requested for Effect, and validation will be performed on the OpaqueData to ensure that all parameters are valid input to SetValue or SetValueTranspose. If the MaterialContent is a BasicMaterialContent, no validation will be performed on OpaqueData. Process requests builds for all textures in Textures, unless the MaterialContent is of type BasicMaterialContent, in which case a build will only be requested for DiffuseColor. The textures in Textures will be ignored.

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor Properties

MaterialProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | ColorKeyColor | Gets or sets the color value to replace with transparent black.
Public Property | ColorKeyEnabled | Specifies whether color keying of a texture is enabled.
Public Property | DefaultEffect | The default effect type for this instance of MaterialProcessor.
Public Property | GenerateMipmaps | Specifies if a full chain of mipmaps are generated from the source material. Existing mipmaps of the material are not replaced.
Public Property | PremultiplyTextureAlpha | Specifies whether alpha premultiply of textures is enabled.
Public Property | ResizeTexturesToPowerOfTwo | Specifies whether resizing of a material is enabled.
Public Property | TextureFormat | Specifies the texture format of output materials.

Expand image See Also

Reference

MaterialProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


MaterialProcessor.ColorKeyColor Property

MaterialProcessor.ColorKeyColor Property

Gets or sets the color value to replace with transparent black.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual Color ColorKeyColor { get; set; }

Property Value

Color value of the material to replace with transparent black.

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor.ColorKeyEnabled Property

MaterialProcessor.ColorKeyEnabled Property

Specifies whether color keying of a texture is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool ColorKeyEnabled { get; set; }

Property Value

true if color keying is enabled; false otherwise.

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor.DefaultEffect Property

MaterialProcessor.DefaultEffect Property

The default effect type for this instance of MaterialProcessor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual MaterialProcessorDefaultEffect DefaultEffect { get; set; }

Property Value

The default effect type.

Expand image Remarks

When MaterialProcessor is instantiated, DefaultEffect is set to default to BasicEffect Class.

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor.GenerateMipmaps Property

MaterialProcessor.GenerateMipmaps Property

Specifies if a full chain of mipmaps are generated from the source material. Existing mipmaps of the material are not replaced.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool GenerateMipmaps { get; set; }

Property Value

true if mipmap generation is enabled; false otherwise.

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor.PremultiplyTextureAlpha Property

MaterialProcessor.PremultiplyTextureAlpha Property

Specifies whether alpha premultiply of textures is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[DefaultValueAttribute(true)]
public virtual bool PremultiplyTextureAlpha { get; set; }

Property Value

true if alpha premultiply is enabled; false otherwise.

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor.ResizeTexturesToPowerOfTwo Property

MaterialProcessor.ResizeTexturesToPowerOfTwo Property

Specifies whether resizing of a material is enabled. Typically used to maximize compatability with a graphics card because many graphics cards do not support a material size that is not a power of two. If ResizeTexturesToPowerOfTwo is enabled, the material is resized to the next largest power of two.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool ResizeTexturesToPowerOfTwo { get; set; }

Property Value

true if resizing is enabled; false otherwise.

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessor.TextureFormat Property

MaterialProcessor.TextureFormat Property

Specifies the texture format of output materials. Materials can either be left unchanged from the source asset, converted to a corresponding Color, or compressed using the appropriate DXTCompressed format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual TextureProcessorOutputFormat TextureFormat { get; set; }

Property Value

The texture format of the output.

Expand image See Also

Reference

MaterialProcessor Class
MaterialProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


MaterialProcessorDefaultEffect Enumeration

MaterialProcessorDefaultEffect Enumeration

Specifies the default effect type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public enum MaterialProcessorDefaultEffect

Expand image Members

Member name | Value | Description
AlphaTestEffect | 4 | An AlphaTestEffect Class effect.
BasicEffect | 0 | An BasicEffect Class effect.
DualTextureEffect | 3 | An DualTextureEffect Class effect.
EnvironmentMapEffect | 2 | An EnvironmentMapEffect Class effect.
SkinnedEffect | 1 | An SkinnedEffect Class effect.

Expand image See Also

Reference

Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelBoneContent Class

ModelBoneContent Class
See Also Members
CollapseAll image

Stores design-time data for a ModelBone asset.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class ModelBoneContent

Expand image See Also

Reference

ModelBoneContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelBoneContent Members

ModelBoneContent Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the ModelBoneContent type.

Expand image Public Properties

 | Name | Description
Public Property | Children | Gets the children of this bone.
Public Property | Index | Gets the index of this bone in a ModelBoneContentCollection.
Public Property | Name | Gets the bone name.
Public Property | Parent | Gets the parent of this bone.
Public Property | Transform | Gets or sets the local transformation matrix for this bone.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelBoneContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelBoneContent Methods

ModelBoneContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelBoneContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelBoneContent Properties

ModelBoneContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Children | Gets the children of this bone.
Public Property | Index | Gets the index of this bone in a ModelBoneContentCollection.
Public Property | Name | Gets the bone name.
Public Property | Parent | Gets the parent of this bone.
Public Property | Transform | Gets or sets the local transformation matrix for this bone.

Expand image See Also

Reference

ModelBoneContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelBoneContent.Children Property

ModelBoneContent.Children Property

Gets the children of this bone.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ModelBoneContentCollection Children { get; set; }

Property Value

The children of this bone.

Expand image See Also

Reference

ModelBoneContent Class
ModelBoneContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelBoneContent.Index Property

ModelBoneContent.Index Property

Gets the index of this bone in a ModelBoneContentCollection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int Index { get; }

Property Value

The index of this bone in a ModelBoneContentCollection.

Expand image See Also

Reference

ModelBoneContent Class
ModelBoneContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelBoneContent.Name Property

ModelBoneContent.Name Property

Gets the bone name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The bone name.

Expand image See Also

Reference

ModelBoneContent Class
ModelBoneContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelBoneContent.Parent Property

ModelBoneContent.Parent Property

Gets the parent of this bone.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ModelBoneContent Parent { get; }

Property Value

The parent of this bone.

Expand image See Also

Reference

ModelBoneContent Class
ModelBoneContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelBoneContent.Transform Property

ModelBoneContent.Transform Property

Gets or sets the local transformation matrix for this bone.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Matrix Transform { get; set; }

Property Value

The local transformation matrix for this bone.

Expand image See Also

Reference

ModelBoneContent Class
ModelBoneContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelBoneContentCollection Class

ModelBoneContentCollection Class
See Also Members
CollapseAll image

A collection of ModelBoneContent objects.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class ModelBoneContentCollection : ReadOnlyCollection<ModelBoneContent>

Expand image See Also

Reference

ModelBoneContentCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelBoneContentCollection Members

ModelBoneContentCollection Members

The following tables list the members exposed by the ModelBoneContentCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from ReadOnlyCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelBoneContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelBoneContentCollection Methods

ModelBoneContentCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from ReadOnlyCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelBoneContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelBoneContentCollection Properties

ModelBoneContentCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

ModelBoneContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelContent Class

ModelContent Class
See Also Members
CollapseAll image

Stores design-time data for a Model asset.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class ModelContent

Expand image See Also

Reference

ModelContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelContent Members

ModelContent Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the ModelContent type.

Expand image Public Properties

 | Name | Description
Public Property | Bones | Gets the collection of bones that are referenced by this model.
Public Property | Meshes | Gets the collection of meshes that are associated with this model.
Public Property | Root | Gets the root bone of this model
Public Property | Tag | Gets a user defined tag object.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelContent Methods

ModelContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelContent Properties

ModelContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Bones | Gets the collection of bones that are referenced by this model.
Public Property | Meshes | Gets the collection of meshes that are associated with this model.
Public Property | Root | Gets the root bone of this model
Public Property | Tag | Gets a user defined tag object.

Expand image See Also

Reference

ModelContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelContent.Bones Property

ModelContent.Bones Property

Gets the collection of bones that are referenced by this model.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ModelBoneContentCollection Bones { get; }

Property Value

The collection of bones that are referenced by this model.

Expand image See Also

Reference

ModelContent Class
ModelContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelContent.Meshes Property

ModelContent.Meshes Property

Gets the collection of meshes that are associated with this model.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ModelMeshContentCollection Meshes { get; }

Property Value

The collection of meshes that are associated with this model.

Expand image See Also

Reference

ModelContent Class
ModelContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelContent.Root Property

ModelContent.Root Property

Gets the root bone of this model

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ModelBoneContent Root { get; }

Property Value

The root bone of this model.

Expand image See Also

Reference

ModelContent Class
ModelContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelContent.Tag Property

ModelContent.Tag Property

Gets a user defined tag object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Object Tag { get; set; }

Property Value

User-defined tag object.

Expand image See Also

Reference

ModelContent Class
ModelContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshContent Class

ModelMeshContent Class
See Also Members
CollapseAll image

Stores design-time data for a ModelMesh asset.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class ModelMeshContent

Expand image See Also

Reference

ModelMeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshContent Members

ModelMeshContent Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the ModelMeshContent type.

Expand image Public Properties

 | Name | Description
Public Property | BoundingSphere | Gets the bounding sphere for this mesh.
Public Property | MeshParts | Gets the children mesh parts associated with this mesh.
Public Property | Name | Gets the mesh name.
Public Property | ParentBone | Gets the parent bone.
Public Property | SourceMesh | Gets the MeshContent source object used when creating this class.
Public Property | Tag | Gets a user-defined tag object.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshContent Methods

ModelMeshContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshContent Properties

ModelMeshContent Properties

Expand image Public Properties

 | Name | Description
Public Property | BoundingSphere | Gets the bounding sphere for this mesh.
Public Property | MeshParts | Gets the children mesh parts associated with this mesh.
Public Property | Name | Gets the mesh name.
Public Property | ParentBone | Gets the parent bone.
Public Property | SourceMesh | Gets the MeshContent source object used when creating this class.
Public Property | Tag | Gets a user-defined tag object.

Expand image See Also

Reference

ModelMeshContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshContent.BoundingSphere Property

ModelMeshContent.BoundingSphere Property

Gets the bounding sphere for this mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public BoundingSphere BoundingSphere { get; }

Property Value

The bounding sphere for this mesh.

Expand image See Also

Reference

ModelMeshContent Class
ModelMeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshContent.MeshParts Property

ModelMeshContent.MeshParts Property

Gets the children mesh parts associated with this mesh.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ModelMeshPartContentCollection MeshParts { get; }

Property Value

The children mesh parts associated with this mesh.

Expand image See Also

Reference

ModelMeshContent Class
ModelMeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshContent.Name Property

ModelMeshContent.Name Property

Gets the mesh name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string Name { get; }

Property Value

The mesh name.

Expand image See Also

Reference

ModelMeshContent Class
ModelMeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshContent.ParentBone Property

ModelMeshContent.ParentBone Property

Gets the parent bone.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ModelBoneContent ParentBone { get; }

Property Value

The parent bone.

Expand image See Also

Reference

ModelMeshContent Class
ModelMeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshContent.SourceMesh Property

ModelMeshContent.SourceMesh Property

Gets the MeshContent source object used when creating this class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MeshContent SourceMesh { get; }

Property Value

The source mesh.

Expand image See Also

Reference

ModelMeshContent Class
ModelMeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshContent.Tag Property

ModelMeshContent.Tag Property

Gets a user-defined tag object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Object Tag { get; set; }

Property Value

User-defined tag object.

Expand image See Also

Reference

ModelMeshContent Class
ModelMeshContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshContentCollection Class

ModelMeshContentCollection Class
See Also Members
CollapseAll image

A collection of ModelMeshContent objects.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class ModelMeshContentCollection : ReadOnlyCollection<ModelMeshContent>

Expand image See Also

Reference

ModelMeshContentCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshContentCollection Members

ModelMeshContentCollection Members

The following tables list the members exposed by the ModelMeshContentCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from ReadOnlyCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshContentCollection Methods

ModelMeshContentCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from ReadOnlyCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshContentCollection Properties

ModelMeshContentCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

ModelMeshContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshPartContent Class

ModelMeshPartContent Class
See Also Members
CollapseAll image

Stores design-time data for a ModelMeshPart asset.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class ModelMeshPartContent

Expand image See Also

Reference

ModelMeshPartContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshPartContent Members

ModelMeshPartContent Members
See Also Properties
CollapseAll image

The following tables list the members exposed by the ModelMeshPartContent type.

Expand image Public Properties

 | Name | Description
Public Property | IndexBuffer | Gets the index buffer associated with this mesh part.
Public Property | Material | Gets the material of this mesh part.
Public Property | NumVertices | Gets the number of vertices used in this mesh part.
Public Property | PrimitiveCount | Gets the number of primitives to render for this mesh part.
Public Property | StartIndex | Gets the location in the index buffer at which to start reading vertices.
Public Property | Tag | Gets a user-defined tag object.
Public Property | VertexBuffer | Gets the vertex buffer associated with this mesh part.
Public Property | VertexOffset | Gets the offset, in bytes, from the first index of the of vertex buffer for this mesh part.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshPartContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshPartContent Methods

ModelMeshPartContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshPartContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshPartContent Properties

ModelMeshPartContent Properties

Expand image Public Properties

 | Name | Description
Public Property | IndexBuffer | Gets the index buffer associated with this mesh part.
Public Property | Material | Gets the material of this mesh part.
Public Property | NumVertices | Gets the number of vertices used in this mesh part.
Public Property | PrimitiveCount | Gets the number of primitives to render for this mesh part.
Public Property | StartIndex | Gets the location in the index buffer at which to start reading vertices.
Public Property | Tag | Gets a user-defined tag object.
Public Property | VertexBuffer | Gets the vertex buffer associated with this mesh part.
Public Property | VertexOffset | Gets the offset, in bytes, from the first index of the of vertex buffer for this mesh part.

Expand image See Also

Reference

ModelMeshPartContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshPartContent.IndexBuffer Property

ModelMeshPartContent.IndexBuffer Property

Gets the index buffer associated with this mesh part.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IndexCollection IndexBuffer { get; }

Property Value

The index buffer associated with this mesh part.

Expand image See Also

Reference

ModelMeshPartContent Class
ModelMeshPartContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshPartContent.Material Property

ModelMeshPartContent.Material Property

Gets the material of this mesh part.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public MaterialContent Material { get; set; }

Property Value

The material of this mesh part.

Expand image See Also

Reference

ModelMeshPartContent Class
ModelMeshPartContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshPartContent.NumVertices Property

ModelMeshPartContent.NumVertices Property

Gets the number of vertices used in this mesh part.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int NumVertices { get; }

Property Value

The number of vertices used in this mesh part.

Expand image See Also

Reference

ModelMeshPartContent Class
ModelMeshPartContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshPartContent.PrimitiveCount Property

ModelMeshPartContent.PrimitiveCount Property

Gets the number of primitives to render for this mesh part.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int PrimitiveCount { get; }

Property Value

The number of primitives in this mesh part.

Expand image See Also

Reference

ModelMeshPartContent Class
ModelMeshPartContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshPartContent.StartIndex Property

ModelMeshPartContent.StartIndex Property

Gets the location in the index buffer at which to start reading vertices.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int StartIndex { get; }

Property Value

The location in the index buffer at which to start reading vertices.

Expand image See Also

Reference

ModelMeshPartContent Class
ModelMeshPartContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshPartContent.Tag Property

ModelMeshPartContent.Tag Property

Gets a user-defined tag object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Object Tag { get; set; }

Property Value

A user-defined tag object.

Expand image See Also

Reference

ModelMeshPartContent Class
ModelMeshPartContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshPartContent.VertexBuffer Property

ModelMeshPartContent.VertexBuffer Property

Gets the vertex buffer associated with this mesh part.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexBufferContent VertexBuffer { get; }

Property Value

The vertex buffer associated with this mesh part.

Expand image See Also

Reference

ModelMeshPartContent Class
ModelMeshPartContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshPartContent.VertexOffset Property

ModelMeshPartContent.VertexOffset Property

Gets the offset, in bytes, from the first index of the of vertex buffer for this mesh part.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public int VertexOffset { get; }

Property Value

The offset, in bytes, from the first index of the of vertex buffer for this mesh part.

Expand image See Also

Reference

ModelMeshPartContent Class
ModelMeshPartContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshPartContentCollection Class

ModelMeshPartContentCollection Class
See Also Members
CollapseAll image

Collection of ModelMeshPartContent objects.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class ModelMeshPartContentCollection : ReadOnlyCollection<ModelMeshPartContent>

Expand image See Also

Reference

ModelMeshPartContentCollection Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelMeshPartContentCollection Members

ModelMeshPartContentCollection Members

The following tables list the members exposed by the ModelMeshPartContentCollection type.

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from ReadOnlyCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshPartContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshPartContentCollection Methods

ModelMeshPartContentCollection Methods

Expand image Public Methods

 | Name | Description
Public Method | Contains | (Inherited from ReadOnlyCollection.)
Public Method | CopyTo | (Inherited from ReadOnlyCollection.)
Public Method | Equals | (Inherited from Object.)
Public Method | GetEnumerator | (Inherited from ReadOnlyCollection.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | IndexOf | (Inherited from ReadOnlyCollection.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelMeshPartContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelMeshPartContentCollection Properties

ModelMeshPartContentCollection Properties

Expand image Public Properties

 | Name | Description
Public Property | Count | (Inherited from ReadOnlyCollection.)
Public Property | Item | (Inherited from ReadOnlyCollection.)

Expand image Protected Properties

 | Name | Description
Protected Property | Items | (Inherited from ReadOnlyCollection.)

Expand image See Also

Reference

ModelMeshPartContentCollection Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelProcessor Class

ModelProcessor Class
See Also Members
CollapseAll image

Processes a game asset mesh to a model content that is optimal for runtime.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class ModelProcessor : ContentProcessor<NodeContent, ModelContent>

Expand image See Also

Reference

ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor Members

ModelProcessor Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the ModelProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | ModelProcessor | Initializes a new instance of ModelProcessor.

Expand image Public Properties

 | Name | Description
Public Property | ColorKeyColor | Specifies the color used when color keying for a texture is enabled.
Public Property | ColorKeyEnabled | Specifies whether color keying of a model is enabled.
Public Property | DefaultEffect | The default effect type for this instance of ModelProcessor.
Public Property | GenerateMipmaps | Specifies whether a full chain of mipmaps is generated from the source material.
Public Property | GenerateTangentFrames | Gets or sets the value of the Generate Tangent Frames processor parameter.
Public Property | PremultiplyTextureAlpha | Specifies whether alpha premultiply of textures is enabled.
Public Property | PremultiplyVertexColors | Specifies if premultiply of vertex colors is enabled.
Public Property | ResizeTexturesToPowerOfTwo | Specifies whether resizing of textures are enabled.
Public Property | RotationX | Gets or sets the value of the X Axis Rotation processor parameter.
Public Property | RotationY | Gets or sets the value of the Y Axis Rotation processor parameter.
Public Property | RotationZ | Gets or sets the value of the Z Axis Rotation processor parameter.
Public Property | Scale | Gets or sets the value of the Scale processor parameter.
Public Property | SwapWindingOrder | Gets or sets the value of the Swap Winding Order processor parameter.
Public Property | TextureFormat | Specifies the texture format of output materials.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Converts mesh content to model content.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ConvertMaterial | Called by the framework when the MaterialContent property of a GeometryContent object is encountered in the input node collection.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | ProcessGeometryUsingMaterial | Processes all geometry using a specified material.
Protected Method | ProcessVertexChannel | Processes geometry content vertex channels at the specified index.

Expand image See Also

Reference

ModelProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelProcessor Constructor

ModelProcessor Constructor

Initializes a new instance of ModelProcessor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ModelProcessor ()

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor Methods

ModelProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Converts mesh content to model content.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | ConvertMaterial | Called by the framework when the MaterialContent property of a GeometryContent object is encountered in the input node collection.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | ProcessGeometryUsingMaterial | Processes all geometry using a specified material.
Protected Method | ProcessVertexChannel | Processes geometry content vertex channels at the specified index.

Expand image See Also

Reference

ModelProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelProcessor.ConvertMaterial Method

ModelProcessor.ConvertMaterial Method

Called by the framework when the MaterialContent property of a GeometryContent object is encountered in the input node collection.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual MaterialContent ConvertMaterial (
         MaterialContent material,
         ContentProcessorContext context
)

Parameters

material
The input material content.
context
Context for the specified processor.

Return Value

The converted material content.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.Process Method

ModelProcessor.Process Method

Converts mesh content to model content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override ModelContent Process (
         NodeContent input,
         ContentProcessorContext context
)

Parameters

input
The root node content.
context
Context for the specified processor.

Return Value

The model content.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.ProcessGeometryUsingMaterial Method

ModelProcessor.ProcessGeometryUsingMaterial Method

Processes all geometry using a specified material.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual void ProcessGeometryUsingMaterial (
         MaterialContent material,
         IEnumerable<GeometryContent> geometryCollection,
         ContentProcessorContext context
)

Parameters

material
A material used in the scene.
geometryCollection
A collection of all the geometry using the specified material.
context
Context for the specified processor.

Expand image Remarks

This function will be called for each material used by geometry in the input mesh, passing in a collection of all the geometry that is using the specified material. The default implementation replaces null materials with a default BasicMaterialContent, validates that the geometry contains texture coordinates if a BasicMaterialContent has a texture, and sets the VertexColorEnabled property depending on whether the geometry contains vertex color data.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.ProcessVertexChannel Method

ModelProcessor.ProcessVertexChannel Method

Processes geometry content vertex channels at the specified index.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual void ProcessVertexChannel (
         GeometryContent geometry,
         int vertexChannelIndex,
         ContentProcessorContext context
)

Parameters

geometry
The geometry content to process.
vertexChannelIndex
Index of the vertex channel to process.
context
Context for the specified processor.

Expand image Remarks

This function will be called for each VertexChannel of Vertices found in the input mesh. Subclasses of ModelProcessor can override ProcessVertexChannel to control how vertex data is processed. The default implementation converts VertexElementUsage.Color channels to Color format, and replaces Weights channels with a pair of VertexElementUsage.BlendIndices and VertexElementUsage.BlendIndices channels (using Byte4 format for the VertexElementUsage.BlendWeight, Color for the VertexElementUsage.BlendWeight, and discarding excess weights if there are more than four per vertex).

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor Properties

ModelProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | ColorKeyColor | Specifies the color used when color keying for a texture is enabled.
Public Property | ColorKeyEnabled | Specifies whether color keying of a model is enabled.
Public Property | DefaultEffect | The default effect type for this instance of ModelProcessor.
Public Property | GenerateMipmaps | Specifies whether a full chain of mipmaps is generated from the source material.
Public Property | GenerateTangentFrames | Gets or sets the value of the Generate Tangent Frames processor parameter.
Public Property | PremultiplyTextureAlpha | Specifies whether alpha premultiply of textures is enabled.
Public Property | PremultiplyVertexColors | Specifies if premultiply of vertex colors is enabled.
Public Property | ResizeTexturesToPowerOfTwo | Specifies whether resizing of textures are enabled.
Public Property | RotationX | Gets or sets the value of the X Axis Rotation processor parameter.
Public Property | RotationY | Gets or sets the value of the Y Axis Rotation processor parameter.
Public Property | RotationZ | Gets or sets the value of the Z Axis Rotation processor parameter.
Public Property | Scale | Gets or sets the value of the Scale processor parameter.
Public Property | SwapWindingOrder | Gets or sets the value of the Swap Winding Order processor parameter.
Public Property | TextureFormat | Specifies the texture format of output materials.

Expand image Remarks

For more information about creating or setting processor parameters, see Parameterized Processors.

Expand image See Also

Reference

ModelProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelProcessor.ColorKeyColor Property

ModelProcessor.ColorKeyColor Property

Specifies the color used when color keying for a texture is enabled. When color keying, all pixels of a specified color are replaced with transparent black.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual Color ColorKeyColor { get; set; }

Property Value

Color value of the material to replace with transparent black.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.ColorKeyEnabled Property

ModelProcessor.ColorKeyEnabled Property

Specifies whether color keying of a model is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool ColorKeyEnabled { get; set; }

Property Value

true if color keying is enabled; false otherwise.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.DefaultEffect Property

ModelProcessor.DefaultEffect Property

The default effect type for this instance of ModelProcessor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual MaterialProcessorDefaultEffect DefaultEffect { get; set; }

Property Value

The default effect type.

Expand image Remarks

When ModelProcessor is instantiated, DefaultEffect is set to default to BasicEffect Class.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.GenerateMipmaps Property

ModelProcessor.GenerateMipmaps Property

Specifies whether a full chain of mipmaps is generated from the source material. Existing mipmaps of the material are not replaced.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool GenerateMipmaps { get; set; }

Property Value

true if mipmap generation is enabled; false otherwise.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.GenerateTangentFrames Property

ModelProcessor.GenerateTangentFrames Property

Gets or sets the value of the Generate Tangent Frames processor parameter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool GenerateTangentFrames { get; set; }

Property Value

true if binormals and tangents should be generated if none are found; otherwise false.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.PremultiplyTextureAlpha Property

ModelProcessor.PremultiplyTextureAlpha Property

Specifies whether alpha premultiply of textures is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[DefaultValueAttribute(true)]
public virtual bool PremultiplyTextureAlpha { get; set; }

Property Value

true if alpha premultiply is enabled; false otherwise.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.PremultiplyVertexColors Property

ModelProcessor.PremultiplyVertexColors Property

Specifies if premultiply of vertex colors is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[DefaultValueAttribute(true)]
public virtual bool PremultiplyVertexColors { get; set; }

Property Value

Returns true if premultiply of vertex colors is enabled; returns false otherwise.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.ResizeTexturesToPowerOfTwo Property

ModelProcessor.ResizeTexturesToPowerOfTwo Property

Specifies whether resizing of textures are enabled. Typically used to maximize compatability with a graphics card because many graphics cards do not support a material size that is not a power of two. If ResizeTexturesToPowerOfTwo is enabled, textures are resized to the next largest power of two.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool ResizeTexturesToPowerOfTwo { get; set; }

Property Value

true if resizing is enabled; false otherwise.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.RotationX Property

ModelProcessor.RotationX Property

Gets or sets the value of the X Axis Rotation processor parameter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual float RotationX { get; set; }

Property Value

The amount of rotation, in degrees, around the X axis.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.RotationY Property

ModelProcessor.RotationY Property

Gets or sets the value of the Y Axis Rotation processor parameter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual float RotationY { get; set; }

Property Value

The amount of rotation, in degrees, around the X axis.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.RotationZ Property

ModelProcessor.RotationZ Property

Gets or sets the value of the Z Axis Rotation processor parameter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual float RotationZ { get; set; }

Property Value

The amount of rotation, in degrees, around the Z axis.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.Scale Property

ModelProcessor.Scale Property

Gets or sets the value of the Scale processor parameter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual float Scale { get; set; }

Property Value

The scaling factor to be applied.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.SwapWindingOrder Property

ModelProcessor.SwapWindingOrder Property

Gets or sets the value of the Swap Winding Order processor parameter.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool SwapWindingOrder { get; set; }

Property Value

true if the winding order of the model should be swapped; otherwise false. This is useful for models that appear to be drawn inside-out.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelProcessor.TextureFormat Property

ModelProcessor.TextureFormat Property

Specifies the texture format of output materials. Materials can either be left unchanged from the source asset, converted to a corresponding Color, or compressed using the appropriate DXTCompressed format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual TextureProcessorOutputFormat TextureFormat { get; set; }

Property Value

The texture format of the output.

Expand image See Also

Reference

ModelProcessor Class
ModelProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelTextureProcessor Class

ModelTextureProcessor Class
See Also Members
CollapseAll image

Processes textures for 3D models.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentProcessorAttribute]
public class ModelTextureProcessor : TextureProcessor

Expand image See Also

Reference

ModelTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelTextureProcessor Members

ModelTextureProcessor Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the ModelTextureProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | ModelTextureProcessor | Initializes a new instance of the ModelTextureProcessor class.

Expand image Public Properties

 | Name | Description
Public Property | ColorKeyColor | Specifies the color used when color keying for a texture is enabled.
Public Property | ColorKeyEnabled | Specifies whether color keying of the texture is enabled.
Public Property | GenerateMipmaps | Specifies if a full chain of mipmaps are generated from the source material.
Public Property | PremultiplyAlpha | (Inherited from TextureProcessor.)
Public Property | ResizeToPowerOfTwo | Specifies whether resizing of textures are enabled.
Public Property | TextureFormat | Specifies the texture format of output materials.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes a texture.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelTextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelTextureProcessor Constructor

ModelTextureProcessor Constructor

Initializes a new instance of the ModelTextureProcessor class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ModelTextureProcessor ()

Expand image See Also

Reference

ModelTextureProcessor Class
ModelTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelTextureProcessor Methods

ModelTextureProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes a texture.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ModelTextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelTextureProcessor.Process Method

ModelTextureProcessor.Process Method

Processes a texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override TextureContent Process (
         TextureContent input,
         ContentProcessorContext context
)

Parameters

input
The texture content to process.
context
Context for the specified processor.

Return Value

The processed texture content.

Expand image Remarks

Process performs color keying, replacing magenta pixels (red=255, green=0, blue=255, alpha=255) with transparent black (rgb=0, alpha=0), generates mipmaps if they are not already present, and compresses the texture into either Dxt1 or Dxt5 format, depending on whether it contains any fractional alpha values.

Expand image See Also

Reference

ModelTextureProcessor Class
ModelTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelTextureProcessor Properties

ModelTextureProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | ColorKeyColor | Specifies the color used when color keying for a texture is enabled.
Public Property | ColorKeyEnabled | Specifies whether color keying of the texture is enabled.
Public Property | GenerateMipmaps | Specifies if a full chain of mipmaps are generated from the source material.
Public Property | PremultiplyAlpha | (Inherited from TextureProcessor.)
Public Property | ResizeToPowerOfTwo | Specifies whether resizing of textures are enabled.
Public Property | TextureFormat | Specifies the texture format of output materials.

Expand image See Also

Reference

ModelTextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


ModelTextureProcessor.ColorKeyColor Property

ModelTextureProcessor.ColorKeyColor Property

Specifies the color used when color keying for a texture is enabled. When color keying, all pixels of a specified color are replaced with transparent black.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override Color ColorKeyColor { get; }

Property Value

Color value of the material to replace with transparent black.

Expand image See Also

Reference

ModelTextureProcessor Class
ModelTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelTextureProcessor.ColorKeyEnabled Property

ModelTextureProcessor.ColorKeyEnabled Property

Specifies whether color keying of the texture is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool ColorKeyEnabled { get; }

Property Value

true if color keying is enabled; false otherwise.

Expand image See Also

Reference

ModelTextureProcessor Class
ModelTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelTextureProcessor.GenerateMipmaps Property

ModelTextureProcessor.GenerateMipmaps Property

Specifies if a full chain of mipmaps are generated from the source material. Existing mipmaps of the material are not replaced.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool GenerateMipmaps { get; }

Property Value

true if mipmap generation is enabled; false otherwise.

Expand image See Also

Reference

ModelTextureProcessor Class
ModelTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelTextureProcessor.ResizeToPowerOfTwo Property

ModelTextureProcessor.ResizeToPowerOfTwo Property

Specifies whether resizing of textures are enabled. Typically used to maximize compatability with a graphics card because many graphics cards do not support a material size that is not a power of two. If ResizeToPowerOfTwo is enabled, textures are resized to the next largest power of two.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool ResizeToPowerOfTwo { get; }

Property Value

true if resizing is enabled; false otherwise.

Expand image See Also

Reference

ModelTextureProcessor Class
ModelTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ModelTextureProcessor.TextureFormat Property

ModelTextureProcessor.TextureFormat Property

Specifies the texture format of output materials. Materials can either be left unchanged from the source asset, converted to a corresponding Color, or compressed using the appropriate DXTCompressed format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override TextureProcessorOutputFormat TextureFormat { get; }

Property Value

The texture format of the output.

Expand image See Also

Reference

ModelTextureProcessor Class
ModelTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PassThroughProcessor Class

PassThroughProcessor Class
See Also Members
CollapseAll image

Provides an implementation of a no-operation processor that returns an unmodified copy of the input data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentProcessorAttribute]
public class PassThroughProcessor : ContentProcessor<Object, Object>

Expand image Remarks

PassThroughProcessor is useful when the importer is already producing data in a game ready format. This can occur after importing textures from DDS files that have been formatted using an external tool, or when deserializing game logic data from XML using the intermediate XML importer.

Expand image See Also

Reference

PassThroughProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PassThroughProcessor Members

PassThroughProcessor Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the PassThroughProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | PassThroughProcessor | Initializes a new instance of the PassThroughProcessor class.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | No-operation process that simply returns the input argument.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PassThroughProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


PassThroughProcessor Constructor

PassThroughProcessor Constructor

Initializes a new instance of the PassThroughProcessor class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public PassThroughProcessor ()

Expand image See Also

Reference

PassThroughProcessor Class
PassThroughProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


PassThroughProcessor Methods

PassThroughProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | No-operation process that simply returns the input argument.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

PassThroughProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


PassThroughProcessor.Process Method

PassThroughProcessor.Process Method

No-operation process that simply returns the input argument.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override Object Process (
         Object input,
         ContentProcessorContext context
)

Parameters

input
The input argument.
context
Context for the specified processor.

Return Value

The unmodified input argument.

Expand image See Also

Reference

PassThroughProcessor Class
PassThroughProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SongContent Class

SongContent Class
See Also Members
CollapseAll image

Represents a processed Song object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class SongContent

Expand image See Also

Reference

SongContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SongContent Members

SongContent Members

The following tables list the members exposed by the SongContent type.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SongContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SongContent Methods

SongContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SongContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SongProcessor Class

SongProcessor Class
See Also Members
CollapseAll image

A custom song processor that processes an intermediate AudioContent type. This type encapsulates the source audio content, producing a Song type that can be used in the game.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class SongProcessor : ContentProcessor<AudioContent, SongContent>

Expand image See Also

Reference

SongProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SongProcessor Members

SongProcessor Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the SongProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | SongProcessor | Initializes a new instance of SongProcessor.

Expand image Public Properties

 | Name | Description
Public Property | Quality | Gets or sets the target format quality of the audio content.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Builds the content for the source audio.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SongProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SongProcessor Constructor

SongProcessor Constructor

Initializes a new instance of SongProcessor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public SongProcessor ()

Expand image See Also

Reference

SongProcessor Class
SongProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SongProcessor Methods

SongProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Builds the content for the source audio.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SongProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SongProcessor.Process Method

SongProcessor.Process Method

Builds the content for the source audio.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override SongContent Process (
         AudioContent input,
         ContentProcessorContext context
)

Parameters

input
The audio content to build.
context
Context for the specified processor.

Return Value

The built audio.

Expand image See Also

Reference

SongProcessor Class
SongProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SongProcessor Properties

SongProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | Quality | Gets or sets the target format quality of the audio content.

Expand image See Also

Reference

SongProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SongProcessor.Quality Property

SongProcessor.Quality Property

Gets or sets the target format quality of the audio content.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ConversionQuality Quality { get; set; }

Property Value

The ConversionQuality of this audio data.

Expand image See Also

Reference

SongProcessor Class
SongProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SoundEffectContent Class

SoundEffectContent Class
See Also Members
CollapseAll image

Represents a processed sound effect.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class SoundEffectContent

Expand image See Also

Reference

SoundEffectContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SoundEffectContent Members

SoundEffectContent Members

The following tables list the members exposed by the SoundEffectContent type.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SoundEffectContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SoundEffectContent Methods

SoundEffectContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SoundEffectContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SoundEffectProcessor Class

SoundEffectProcessor Class
See Also Members
CollapseAll image

Provides a custom sound effect processor that processes an intermediate AudioContent type. This type encapsulates the source audio content, producing a SoundEffect type that can be used in the game.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class SoundEffectProcessor : ContentProcessor<AudioContent, SoundEffectContent>

Expand image See Also

Reference

SoundEffectProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SoundEffectProcessor Members

SoundEffectProcessor Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the SoundEffectProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | SoundEffectProcessor | Initializes a new instance of SoundEffectProcessor.

Expand image Public Properties

 | Name | Description
Public Property | Quality | Gets or sets the target format quality of the sound effect.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Builds the content for the source audio.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SoundEffectProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SoundEffectProcessor Constructor

SoundEffectProcessor Constructor

Initializes a new instance of SoundEffectProcessor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public SoundEffectProcessor ()

Expand image See Also

Reference

SoundEffectProcessor Class
SoundEffectProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SoundEffectProcessor Methods

SoundEffectProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Builds the content for the source audio.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SoundEffectProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SoundEffectProcessor.Process Method

SoundEffectProcessor.Process Method

Builds the content for the source audio.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override SoundEffectContent Process (
         AudioContent input,
         ContentProcessorContext context
)

Parameters

input
The audio content to build.
context
Context for the specified processor.

Return Value

The built sound effect.

Expand image See Also

Reference

SoundEffectProcessor Class
SoundEffectProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SoundEffectProcessor Properties

SoundEffectProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | Quality | Gets or sets the target format quality of the sound effect.

Expand image See Also

Reference

SoundEffectProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SoundEffectProcessor.Quality Property

SoundEffectProcessor.Quality Property

Gets or sets the target format quality of the sound effect.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ConversionQuality Quality { get; set; }

Property Value

The ConversionQuality of the sound effect data.

Expand image See Also

Reference

SoundEffectProcessor Class
SoundEffectProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SpriteFontContent Class

SpriteFontContent Class
See Also Members
CollapseAll image

Provides methods and properties for managing a design-time SpriteFont Class holding packed font data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class SpriteFontContent

Expand image Remarks

This class is the output of the built-in font processors, FontDescriptionProcessor and FontTextureProcessor.

Expand image See Also

Reference

FontDescriptionProcessor Class
FontTextureProcessor Class
SpriteFontContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SpriteFontContent Members

SpriteFontContent Members

The following tables list the members exposed by the SpriteFontContent type.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SpriteFontContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SpriteFontContent Methods

SpriteFontContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SpriteFontContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SpriteTextureProcessor Class

SpriteTextureProcessor Class
See Also Members
CollapseAll image

Processes textures for use as 2D sprites or user interface components.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentProcessorAttribute]
public class SpriteTextureProcessor : TextureProcessor

Expand image See Also

Reference

SpriteTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SpriteTextureProcessor Members

SpriteTextureProcessor Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the SpriteTextureProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | SpriteTextureProcessor | Initializes a new instance of the SpriteTextureProcessor class.

Expand image Public Properties

 | Name | Description
Public Property | ColorKeyColor | Specifies the color used when color keying for a texture is enabled.
Public Property | ColorKeyEnabled | Specifies whether color keying of the texture is enabled.
Public Property | GenerateMipmaps | Specifies if a full chain of mipmaps are generated from the source material.
Public Property | PremultiplyAlpha | (Inherited from TextureProcessor.)
Public Property | ResizeToPowerOfTwo | Specifies whether resizing of textures are enabled.
Public Property | TextureFormat | Specifies the texture format of output materials.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes a texture for use as 2D sprites or user interface components.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SpriteTextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SpriteTextureProcessor Constructor

SpriteTextureProcessor Constructor

Initializes a new instance of the SpriteTextureProcessor class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public SpriteTextureProcessor ()

Expand image See Also

Reference

SpriteTextureProcessor Class
SpriteTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SpriteTextureProcessor Methods

SpriteTextureProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes a texture for use as 2D sprites or user interface components.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

SpriteTextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SpriteTextureProcessor.Process Method

SpriteTextureProcessor.Process Method

Processes a texture for use as 2D sprites or user interface components.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override TextureContent Process (
         TextureContent input,
         ContentProcessorContext context
)

Parameters

input
The input texture content.
context
Context for the specified processor.

Return Value

The converted texture content.

Expand image Remarks

Process converts textures to 32 bit color format, and performs color keying, replacing magenta pixels (red=255, green=0, blue=255, alpha=255) with transparent black (rgb=0, alpha=0).

Expand image See Also

Reference

SpriteTextureProcessor Class
SpriteTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SpriteTextureProcessor Properties

SpriteTextureProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | ColorKeyColor | Specifies the color used when color keying for a texture is enabled.
Public Property | ColorKeyEnabled | Specifies whether color keying of the texture is enabled.
Public Property | GenerateMipmaps | Specifies if a full chain of mipmaps are generated from the source material.
Public Property | PremultiplyAlpha | (Inherited from TextureProcessor.)
Public Property | ResizeToPowerOfTwo | Specifies whether resizing of textures are enabled.
Public Property | TextureFormat | Specifies the texture format of output materials.

Expand image See Also

Reference

SpriteTextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


SpriteTextureProcessor.ColorKeyColor Property

SpriteTextureProcessor.ColorKeyColor Property

Specifies the color used when color keying for a texture is enabled. When color keying, all pixels of a specified color are replaced with transparent black.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override Color ColorKeyColor { get; }

Property Value

Color value of the material to replace with transparent black.

Expand image See Also

Reference

SpriteTextureProcessor Class
SpriteTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SpriteTextureProcessor.ColorKeyEnabled Property

SpriteTextureProcessor.ColorKeyEnabled Property

Specifies whether color keying of the texture is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool ColorKeyEnabled { get; }

Property Value

true if color keying is enabled; false otherwise.

Expand image See Also

Reference

SpriteTextureProcessor Class
SpriteTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SpriteTextureProcessor.GenerateMipmaps Property

SpriteTextureProcessor.GenerateMipmaps Property

Specifies if a full chain of mipmaps are generated from the source material. Existing mipmaps of the material are not replaced.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool GenerateMipmaps { get; }

Property Value

true if mipmap generation is enabled; false otherwise.

Expand image See Also

Reference

SpriteTextureProcessor Class
SpriteTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SpriteTextureProcessor.ResizeToPowerOfTwo Property

SpriteTextureProcessor.ResizeToPowerOfTwo Property

Specifies whether resizing of textures are enabled. Typically used to maximize compatability with a graphics card because many graphics cards do not support a material size that is not a power of two. If ResizeToPowerOfTwo is enabled, textures are resized to the next largest power of two.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[BrowsableAttribute(false)]
public override bool ResizeToPowerOfTwo { get; }

Property Value

true if resizing is enabled; false otherwise.

Expand image See Also

Reference

SpriteTextureProcessor Class
SpriteTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


SpriteTextureProcessor.TextureFormat Property

SpriteTextureProcessor.TextureFormat Property

Specifies the texture format of output materials. Materials can either be left unchanged from the source asset, converted to a corresponding Color, or compressed using the appropriate DXTCompressed format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override TextureProcessorOutputFormat TextureFormat { get; }

Property Value

The texture format of the output.

Expand image See Also

Reference

SpriteTextureProcessor Class
SpriteTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureProcessor Class

TextureProcessor Class
See Also Members
CollapseAll image

Provides methods for processing textures.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[ContentProcessorAttribute]
public class TextureProcessor : ContentProcessor<TextureContent, TextureContent>

Expand image See Also

Reference

TextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureProcessor Members

TextureProcessor Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the TextureProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | TextureProcessor | Initializes a new instance of the TextureProcessor class.

Expand image Public Properties

 | Name | Description
Public Property | ColorKeyColor | Specifies the color used when color keying for a texture is enabled.
Public Property | ColorKeyEnabled | Specifies whether color keying of a texture is enabled.
Public Property | GenerateMipmaps | Specifies if a full chain of mipmaps are generated from the source texture.
Public Property | PremultiplyAlpha | Specifies whether alpha premultiply of textures is enabled.
Public Property | ResizeToPowerOfTwo | Specifies whether resizing of a texture is enabled.
Public Property | TextureFormat | Specifies the texture format of outputmaterials.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes a texture.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


TextureProcessor Constructor

TextureProcessor Constructor

Initializes a new instance of the TextureProcessor class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TextureProcessor ()

Expand image See Also

Reference

TextureProcessor Class
TextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureProcessor Methods

TextureProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes a texture.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

TextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


TextureProcessor.Process Method

TextureProcessor.Process Method

Processes a texture.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override TextureContent Process (
         TextureContent input,
         ContentProcessorContext context
)

Parameters

input
The texture content to process.
context
Context for the specified processor.

Return Value

The converted texture content.

Expand image Remarks

Process generates mipmaps if they are not already present, but leaves the texture in the same format as the input data. This is suitable for use with DDS files that have already been converted to an appropriate format.

Expand image See Also

Reference

TextureProcessor Class
TextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureProcessor Properties

TextureProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | ColorKeyColor | Specifies the color used when color keying for a texture is enabled.
Public Property | ColorKeyEnabled | Specifies whether color keying of a texture is enabled.
Public Property | GenerateMipmaps | Specifies if a full chain of mipmaps are generated from the source texture.
Public Property | PremultiplyAlpha | Specifies whether alpha premultiply of textures is enabled.
Public Property | ResizeToPowerOfTwo | Specifies whether resizing of a texture is enabled.
Public Property | TextureFormat | Specifies the texture format of outputmaterials.

Expand image See Also

Reference

TextureProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


TextureProcessor.ColorKeyColor Property

TextureProcessor.ColorKeyColor Property

Specifies the color used when color keying for a texture is enabled. When color keying, all pixels of a specified color are replaced with transparent black.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual Color ColorKeyColor { get; set; }

Property Value

The color used when a texture is color keyed.

Expand image See Also

Reference

TextureProcessor Class
TextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureProcessor.ColorKeyEnabled Property

TextureProcessor.ColorKeyEnabled Property

Specifies whether color keying of a texture is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool ColorKeyEnabled { get; set; }

Property Value

true if color keying is enabled; false otherwise.

Expand image See Also

Reference

TextureProcessor Class
TextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureProcessor.GenerateMipmaps Property

TextureProcessor.GenerateMipmaps Property

Specifies if a full chain of mipmaps are generated from the source texture. Existing mipmaps of the texture are not replaced.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool GenerateMipmaps { get; set; }

Property Value

true if mipmap generation is enabled; false otherwise.

Expand image See Also

Reference

TextureProcessor Class
TextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureProcessor.PremultiplyAlpha Property

TextureProcessor.PremultiplyAlpha Property

Specifies whether alpha premultiply of textures is enabled.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[DefaultValueAttribute(true)]
public virtual bool PremultiplyAlpha { get; set; }

Property Value

true if alpha premultiply is enabled; false otherwise.

Expand image See Also

Reference

TextureProcessor Class
TextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureProcessor.ResizeToPowerOfTwo Property

TextureProcessor.ResizeToPowerOfTwo Property

Specifies whether resizing of a texture is enabled. Typically used to maximize compatability with a graphics card because many graphics cards do not support a texture size that is not a power of two. If ResizeToPowerOfTwo is enabled, the texture is resized to the next largest power of two.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool ResizeToPowerOfTwo { get; set; }

Property Value

true if resizing is enabled; false otherwise.

Expand image See Also

Reference

TextureProcessor Class
TextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureProcessor.TextureFormat Property

TextureProcessor.TextureFormat Property

Specifies the texture format of outputmaterials. Materials can either be left unchanged from the source asset, converted to a corresponding Color, or compressed using the appropriate DXTCompressed format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual TextureProcessorOutputFormat TextureFormat { get; set; }

Property Value

The texture format of the output.

Expand image See Also

Reference

TextureProcessor Class
TextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


TextureProcessorOutputFormat Enumeration

TextureProcessorOutputFormat Enumeration

Specifies the target output (of type SurfaceFormat) of the texture processor. Used by TextureProcessor.TextureFormat.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public enum TextureProcessorOutputFormat

Expand image Members

Member name | Description
Color | The SurfaceFormat value, of the input TextureContent object, is converted to Color by the processor. Typically used for 2D graphics and overlays.
DxtCompressed | The SurfaceFormat value, of the input TextureContent object, is converted to an appropriate DXT compression by the processor. If the input texture contains fractional alpha values, it is converted to DXT5 format (8 bits per texel); otherwise it is converted to DXT1 (4 bits per texel). This conversion reduces the resource's size on the graphics card. Typically used for 3D textures such as 3D model textures.
NoChange | The SurfaceFormat value, of the input TextureContent object, is not changed by the processor. Typically used for textures processed by an external tool.

Expand image See Also

Reference

Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexBufferContent Class

VertexBufferContent Class
See Also Members
CollapseAll image

Provides methods and properties for managing a design-time vertex buffer that holds packed vertex data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class VertexBufferContent : ContentItem

Expand image Remarks

This type directly corresponds to the runtime VertexBuffer class, and when a VertexBufferContent object is passed to the content compiler, the vertex data deserializes directly into a VertexBuffer at runtime. VertexBufferContent objects are not directly created by importers. The preferred method is to store vertex data in the more flexible VertexContent class.

Expand image See Also

Reference

VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexBufferContent Members

VertexBufferContent Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the VertexBufferContent type.

Expand image Public Constructors

 | Name | Description
Public Method | VertexBufferContent | Overloaded. Initializes a new instance of VertexBufferContent.

Expand image Public Properties

 | Name | Description
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | VertexData | Gets the array containing the raw bytes of the packed vertex data.
Public Property | VertexDeclaration | Gets the associated VertexDeclarationContent object.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
 | SizeOf | Gets the size of the specified type, in bytes.
Public Method | ToString | (Inherited from Object.)
Public Method | Write | Overloaded. Writes additional data into the vertex buffer.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexBufferContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VertexBufferContent Constructor

VertexBufferContent Constructor

Initializes a new instance of VertexBufferContent.

Expand image Overload List

Name | Description
VertexBufferContent () | Initializes a new instance of VertexBufferContent.
VertexBufferContent (Int32) | Initializes a new instance of VertexBufferContent of the specified size.

Expand image See Also

Reference

VertexBufferContent Class
VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VertexBufferContent Constructor ()

VertexBufferContent Constructor ()
See Also
CollapseAll image

Initializes a new instance of VertexBufferContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexBufferContent ()

Expand image See Also

Reference

VertexBufferContent Class
VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexBufferContent Constructor (Int32)

VertexBufferContent Constructor (Int32)
See Also
CollapseAll image

Initializes a new instance of VertexBufferContent of the specified size.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexBufferContent (
         int size
)

Parameters

size
The size of the vertex buffer content, in bytes.

Expand image See Also

Reference

VertexBufferContent Class
VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexBufferContent Methods

VertexBufferContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
 | SizeOf | Gets the size of the specified type, in bytes.
Public Method | ToString | (Inherited from Object.)
Public Method | Write | Overloaded. Writes additional data into the vertex buffer.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexBufferContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VertexBufferContent.SizeOf Method

VertexBufferContent.SizeOf Method

Gets the size of the specified type, in bytes.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static int SizeOf (
         Type type
)

Parameters

type
The type.

Return Value

The size of the specified type, in bytes.

Expand image Remarks

Call this method to compute offset parameters for the Write method. If the specified data type cannot be packed into a vertex buffer—for example, if type is not a valid value type—a NotSupportedException is thrown.

Expand image See Also

Reference

VertexBufferContent Class
VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexBufferContent.Write Method

VertexBufferContent.Write Method

Writes additional data into the vertex buffer.

Expand image Overload List

Name | Description
VertexBufferContent.Write (Int32, Int32, Generic IEnumerable) | Writes additional data into the vertex buffer.
VertexBufferContent.Write (Int32, Int32, Type, IEnumerable) | Writes additional data into the vertex buffer.

Expand image See Also

Reference

VertexBufferContent Class
VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VertexBufferContent.Write Generic Method (Int32, Int32, Generic IEnumerable)

VertexBufferContent.Write Generic Method (Int32, Int32, Generic IEnumerable)
See Also
CollapseAll image

Writes additional data into the vertex buffer. Writing begins at the specified byte offset, and each value is spaced according to the specified stride value (in bytes).

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Write<T> (
         int offset,
         int stride,
         IEnumerable<T> data
)

Type Parameters

T
Type being written.

Parameters

offset
Offset to begin writing at.
stride
Stride of the data being written, in bytes.
data
Enumerated collection of data.

Expand image Remarks

This method automatically grows the vertex buffer if an attempt is made to write past the buffer end. Write throws NotSupportedException if the specified data type cannot be packed into a vertex buffer. For example, if data is not a valid value type.

Use this method to interleave vertex data channels into a single buffer. This can be done by passing the total vertex size as the stride and suitable smaller offsets for each channel. You can also concatenate entire vertex buffers by passing the length of the vertex as the offset, 1 as the stride, and the vertex data as the data parameter.

Expand image See Also

Reference

VertexBufferContent Class
VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexBufferContent.Write Method (Int32, Int32, Type, IEnumerable)

VertexBufferContent.Write Method (Int32, Int32, Type, IEnumerable)
See Also
CollapseAll image

Writes additional data into the vertex buffer. Writing begins at the specified byte offset, and each value is spaced according to the specified stride value (in bytes).

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Write (
         int offset,
         int stride,
         Type dataType,
         IEnumerable data
)

Parameters

offset
Offset at which to begin writing.
stride
Stride of the data being written, in bytes.
dataType
The type of data to be written.
data
The data to write.

Expand image Remarks

This method automatically grows the vertex buffer if an attempt is made to write past the buffer end. Write throws NotSupportedException if the specified data type cannot be packed into a vertex buffer. For example, if data is not a valid value type.

Use this method to interleave vertex data channels into a single buffer. This can be done by passing the total vertex size as the stride and suitable smaller offsets for each channel. You can also concatenate entire vertex buffers by passing the length of the vertex as the offset, 1 as the stride, and the vertex data as the data parameter.

Expand image See Also

Reference

VertexBufferContent Class
VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexBufferContent Properties

VertexBufferContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | VertexData | Gets the array containing the raw bytes of the packed vertex data.
Public Property | VertexDeclaration | Gets the associated VertexDeclarationContent object.

Expand image See Also

Reference

VertexBufferContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VertexBufferContent.VertexData Property

VertexBufferContent.VertexData Property

Gets the array containing the raw bytes of the packed vertex data. Use this method to get and set the contents of the vertex buffer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public byte[] VertexData { get; }

Property Value

Raw data of the packed vertex data.

Expand image See Also

Reference

VertexBufferContent Class
VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexBufferContent.VertexDeclaration Property

VertexBufferContent.VertexDeclaration Property

Gets the associated VertexDeclarationContent object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexDeclarationContent VertexDeclaration { get; set; }

Property Value

The associated VertexDeclarationContent object.

Expand image See Also

Reference

VertexBufferContent Class
VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexDeclarationContent Class

VertexDeclarationContent Class
See Also Members
CollapseAll image

Provides methods and properties for maintaining the vertex declaration data of a VertexContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class VertexDeclarationContent : ContentItem

Expand image See Also

Reference

VertexDeclarationContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexDeclarationContent Members

VertexDeclarationContent Members
See Also Constructors Properties
CollapseAll image

The following tables list the members exposed by the VertexDeclarationContent type.

Expand image Public Constructors

 | Name | Description
Public Method | VertexDeclarationContent | Initializes a new instance of VertexDeclarationContent.

Expand image Public Properties

 | Name | Description
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | VertexElements | Gets the VertexElement object of the vertex declaration.
Public Property | VertexStride | The number of bytes from one vertex to the next.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexDeclarationContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VertexDeclarationContent Constructor

VertexDeclarationContent Constructor

Initializes a new instance of VertexDeclarationContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VertexDeclarationContent ()

Expand image See Also

Reference

VertexDeclarationContent Class
VertexDeclarationContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexDeclarationContent Methods

VertexDeclarationContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VertexDeclarationContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VertexDeclarationContent Properties

VertexDeclarationContent Properties

Expand image Public Properties

 | Name | Description
Public Property | Identity | (Inherited from ContentItem.)
Public Property | Name | (Inherited from ContentItem.)
Public Property | OpaqueData | (Inherited from ContentItem.)
Public Property | VertexElements | Gets the VertexElement object of the vertex declaration.
Public Property | VertexStride | The number of bytes from one vertex to the next.

Expand image See Also

Reference

VertexDeclarationContent Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VertexDeclarationContent.VertexElements Property

VertexDeclarationContent.VertexElements Property

Gets the VertexElement object of the vertex declaration.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Collection<VertexElement> VertexElements { get; }

Property Value

The VertexElement object of the vertex declaration.

Expand image See Also

Reference

VertexDeclarationContent Class
VertexDeclarationContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VertexDeclarationContent.VertexStride Property

VertexDeclarationContent.VertexStride Property

The number of bytes from one vertex to the next.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Nullable<int> VertexStride { get; set; }

Property Value

The stride (in bytes).

Expand image See Also

Reference

VertexDeclarationContent Class
VertexDeclarationContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoProcessor Class

VideoProcessor Class
See Also Members
CollapseAll image

Processes videos for playback within a game.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class VideoProcessor : ContentProcessor<VideoContent, VideoContent>

Expand image See Also

Reference

VideoProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoProcessor Members

VideoProcessor Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the VideoProcessor type.

Expand image Public Constructors

 | Name | Description
Public Method | VideoProcessor | Initializes a new instance of VideoProcessor.

Expand image Public Properties

 | Name | Description
Public Property | VideoSoundtrackType | Gets or sets the VideoSoundtrackType for this video.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes a video.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VideoProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VideoProcessor Constructor

VideoProcessor Constructor

Initializes a new instance of VideoProcessor.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VideoProcessor ()

Expand image See Also

Reference

VideoProcessor Class
VideoProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoProcessor Methods

VideoProcessor Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Process | Processes a video.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

VideoProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VideoProcessor.Process Method

VideoProcessor.Process Method

Processes a video.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override VideoContent Process (
         VideoContent input,
         ContentProcessorContext context
)

Parameters

input
The video content to process.
context
Context for the processor.

Return Value

The converted video content.

Expand image See Also

Reference

VideoProcessor Class
VideoProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


VideoProcessor Properties

VideoProcessor Properties

Expand image Public Properties

 | Name | Description
Public Property | VideoSoundtrackType | Gets or sets the VideoSoundtrackType for this video.

Expand image See Also

Reference

VideoProcessor Class
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace


VideoProcessor.VideoSoundtrackType Property

VideoProcessor.VideoSoundtrackType Property

Gets or sets the VideoSoundtrackType for this video.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public VideoSoundtrackType VideoSoundtrackType { get; set; }

Property Value

The new VideoSoundtrackType for the video.

Expand image See Also

Reference

VideoProcessor Class
VideoProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace
CollapseAll image

Provides base classes that represent compilers and writers used by the XNA Framework Content Pipeline when processing specific game asset types.

Expand image Classes

 | Name | Description
Public Class | ContentCompiler | Provides methods for writing compiled binary format.
Public Class | ContentTypeWriter | Provides a generic implementation of ContentTypeWriter methods and properties for compiling a specific managed type into a binary format.
Public Class | ContentTypeWriter | Provides methods and properties for compiling a specific managed type into a binary format.
Public Class | ContentTypeWriterAttribute | Identifies the components of a type writer.
Public Class | ContentWriter | Provides an implementation for many of the ContentCompiler methods including compilation, state tracking for shared resources and creation of the header type manifest.


ContentCompiler Class

ContentCompiler Class
See Also Members
CollapseAll image

Provides methods for writing compiled binary format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class ContentCompiler

Expand image See Also

Reference

ContentCompiler Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentCompiler Members

ContentCompiler Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the ContentCompiler type.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetTypeWriter | Retrieves the worker writer for the specified type.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentCompiler Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentCompiler Methods

ContentCompiler Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetTypeWriter | Retrieves the worker writer for the specified type.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentCompiler Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentCompiler.GetTypeWriter Method

ContentCompiler.GetTypeWriter Method

Retrieves the worker writer for the specified type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentTypeWriter GetTypeWriter (
         Type type
)

Parameters

type
The type.

Return Value

The worker writer.

Expand image Remarks

This should be called from the ContentTypeWriter.Initialize method.

Expand image See Also

Reference

Initialize
ContentCompiler Class
ContentCompiler Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter Class

ContentTypeWriter Class
See Also Members
CollapseAll image

Provides methods and properties for compiling a specific managed type into a binary format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class ContentTypeWriter

Expand image See Also

Reference

ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter Members

ContentTypeWriter Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the ContentTypeWriter type.

Expand image Protected Constructors

 | Name | Description
Protected Method | ContentTypeWriter | Initializes a new instance of the ContentTypeWriter class.

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | Determines if deserialization into an existing object is possible.
Public Property | TargetType | Gets the type handled by this compiler component.
Public Property | TypeVersion | Gets a format version number for this type.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetRuntimeReader | Gets the assembly qualified name of the runtime loader for this type.
Public Method | GetRuntimeType | Gets the assembly qualified name of the runtime target type.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | Initialize | Retrieves and caches nested type writers and allows for reflection over the target data type.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | ShouldCompressContent | Indicates whether a given type of content should be compressed.
Protected Method | Write | Compiles an object into binary format.

Expand image See Also

Reference

ContentTypeWriter Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentTypeWriter Constructor

ContentTypeWriter Constructor

Initializes a new instance of the ContentTypeWriter class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ContentTypeWriter (
         Type targetType
)

Parameters

targetType
The target type the ContentTypeWriter.

Expand image Exceptions

Exception type | Condition
ArgumentException
  • Cannot serialize type targetType. Pointers and references are not supported.
  • targetType cannot be serialized because not all the generic type parameters have been specified.
ArgumentNullException | targetType is null.

Expand image See Also

Reference

ContentTypeWriter Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter Methods

ContentTypeWriter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetRuntimeReader | Gets the assembly qualified name of the runtime loader for this type.
Public Method | GetRuntimeType | Gets the assembly qualified name of the runtime target type.
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | Initialize | Retrieves and caches nested type writers and allows for reflection over the target data type.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | ShouldCompressContent | Indicates whether a given type of content should be compressed.
Protected Method | Write | Compiles an object into binary format.

Expand image See Also

Reference

ContentTypeWriter Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentTypeWriter.GetRuntimeReader Method

ContentTypeWriter.GetRuntimeReader Method

Gets the assembly qualified name of the runtime loader for this type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract string GetRuntimeReader (
         TargetPlatform targetPlatform
)

Parameters

targetPlatform
Name of the platform.

Return Value

Name of the runtime loader.

Expand image See Also

Reference

ContentTypeWriter Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter.GetRuntimeType Method

ContentTypeWriter.GetRuntimeType Method

Gets the assembly qualified name of the runtime target type. The runtime target type often matches the design time type, but may differ.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual string GetRuntimeType (
         TargetPlatform targetPlatform
)

Parameters

targetPlatform
The target platform.

Return Value

The qualified name.

Expand image See Also

Reference

ContentTypeWriter Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter.Initialize Method

ContentTypeWriter.Initialize Method

Retrieves and caches nested type writers and allows for reflection over the target data type. Called by the framework at creation time.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected virtual void Initialize (
         ContentCompiler compiler
)

Parameters

compiler
The content compiler.

Expand image See Also

Reference

ContentTypeWriter Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter.ShouldCompressContent Method

ContentTypeWriter.ShouldCompressContent Method

Indicates whether a given type of content should be compressed.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal virtual bool ShouldCompressContent (
         TargetPlatform targetPlatform,
         Object value
)

Parameters

targetPlatform
The target platform of the content build.
value
The object about to be serialized, or null if a collection of objects is to be serialized.

Return Value

true if the content of the requested type should be compressed; false otherwise.

Expand image Remarks

This base class implementation of this method always returns true. It should be overridden to return false if there would be little or no useful reduction in size of the content type's data from a general-purpose lossless compression algorithm.

The implementations for Song Class and SoundEffect Class data return false because data for these content types is already in compressed form.

Expand image See Also

Reference

ContentTypeWriter Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter.Write Method

ContentTypeWriter.Write Method

Compiles an object into binary format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal abstract void Write (
         ContentWriter output,
         Object value
)

Parameters

output
The content writer serializing the value.
value
The resultant object.

Expand image See Also

Reference

ContentTypeWriter Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter Properties

ContentTypeWriter Properties

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | Determines if deserialization into an existing object is possible.
Public Property | TargetType | Gets the type handled by this compiler component.
Public Property | TypeVersion | Gets a format version number for this type.

Expand image See Also

Reference

ContentTypeWriter Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentTypeWriter.CanDeserializeIntoExistingObject Property

ContentTypeWriter.CanDeserializeIntoExistingObject Property

Determines if deserialization into an existing object is possible.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool CanDeserializeIntoExistingObject { get; }

Property Value

true if the object can be deserialized into; false otherwise.

Expand image See Also

Reference

ContentTypeWriter Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter.TargetType Property

ContentTypeWriter.TargetType Property

Gets the type handled by this compiler component.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Type TargetType { get; }

Property Value

The type handled by this compiler component.

Expand image See Also

Reference

ContentTypeWriter Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter.TypeVersion Property

ContentTypeWriter.TypeVersion Property

Gets a format version number for this type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual int TypeVersion { get; }

Property Value

A format version number for this type.

Expand image See Also

Reference

ContentTypeWriter Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter Generic Class

ContentTypeWriter Generic Class
See Also Members
CollapseAll image

Provides a generic implementation of ContentTypeWriter methods and properties for compiling a specific managed type into a binary format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class ContentTypeWriter<T> : ContentTypeWriter

Expand image Remarks

This is a generic implementation of ContentTypeWriter and, therefore, can handle strongly typed content data.

Expand image See Also

Reference

ContentTypeWriter
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter Members

ContentTypeWriter Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the ContentTypeWriter type.

Expand image Protected Constructors

 | Name | Description
Protected Method | ContentTypeWriter | Initializes a new instance of the ContentTypeWriter class.

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | (Inherited from ContentTypeWriter.)
Public Property | TargetType | (Inherited from ContentTypeWriter.)
Public Property | TypeVersion | (Inherited from ContentTypeWriter.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetRuntimeReader | (Inherited from ContentTypeWriter.)
Public Method | GetRuntimeType | (Inherited from ContentTypeWriter.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Write | Overloaded. Compiles a strongly typed object into binary format.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | Initialize | (Inherited from ContentTypeWriter.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeWriter Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentTypeWriter Constructor

ContentTypeWriter Constructor

Initializes a new instance of the ContentTypeWriter class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ContentTypeWriter ()

Expand image See Also

Reference

ContentTypeWriter Generic Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter Methods

ContentTypeWriter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetRuntimeReader | (Inherited from ContentTypeWriter.)
Public Method | GetRuntimeType | (Inherited from ContentTypeWriter.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | Write | Overloaded. Compiles a strongly typed object into binary format.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | Initialize | (Inherited from ContentTypeWriter.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeWriter Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentTypeWriter.Write Method

ContentTypeWriter.Write Method

Compiles a strongly typed object into binary format.

Expand image Overload List

Name | Description
ContentTypeWriter.Write (ContentWriter, Object) | Compiles a strongly typed object into binary format.
ContentTypeWriter.Write (ContentWriter, T) | Compiles a strongly typed object into binary format.

Expand image See Also

Reference

ContentTypeWriter Generic Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentTypeWriter.Write Method (ContentWriter, Object)

ContentTypeWriter.Write Method (ContentWriter, Object)
See Also
CollapseAll image

Compiles a strongly typed object into binary format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal override void Write (
         ContentWriter output,
         Object value
)

Parameters

output
The content writer serializing the value.
value
The value to write.

Expand image See Also

Reference

ContentTypeWriter Generic Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter.Write Method (ContentWriter, T)

ContentTypeWriter.Write Method (ContentWriter, T)
See Also
CollapseAll image

Compiles a strongly typed object into binary format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal abstract void Write (
         ContentWriter output,
         T value
)

Parameters

output
The content writer serializing the value.
value
The value to write.

Expand image See Also

Reference

ContentTypeWriter Generic Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriter Properties

ContentTypeWriter Properties

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | (Inherited from ContentTypeWriter.)
Public Property | TargetType | (Inherited from ContentTypeWriter.)
Public Property | TypeVersion | (Inherited from ContentTypeWriter.)

Expand image See Also

Reference

ContentTypeWriter Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentTypeWriterAttribute Class

ContentTypeWriterAttribute Class
See Also Members
CollapseAll image

Identifies the components of a type writer. Custom content writers must apply this attribute to their class as well as extend the ContentTypeWriter class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[AttributeUsageAttribute(4)]
public sealed class ContentTypeWriterAttribute : Attribute

Expand image See Also

Reference

ContentTypeWriterAttribute Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriterAttribute Members

ContentTypeWriterAttribute Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the ContentTypeWriterAttribute type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentTypeWriterAttribute | Initializes a new instance of the ContentTypeWriterAttribute class.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeWriterAttribute Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentTypeWriterAttribute Constructor

ContentTypeWriterAttribute Constructor

Initializes a new instance of the ContentTypeWriterAttribute class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentTypeWriterAttribute ()

Expand image See Also

Reference

ContentTypeWriterAttribute Class
ContentTypeWriterAttribute Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeWriterAttribute Methods

ContentTypeWriterAttribute Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeWriterAttribute Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentTypeWriterAttribute Properties

ContentTypeWriterAttribute Properties

Expand image See Also

Reference

ContentTypeWriterAttribute Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentWriter Class

ContentWriter Class
See Also Members
CollapseAll image

Provides an implementation for many of the ContentCompiler methods including compilation, state tracking for shared resources and creation of the header type manifest.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class ContentWriter : BinaryWriter

Expand image Remarks

A new ContentWriter is constructed for each compilation operation.

Expand image See Also

Reference

ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter Members

ContentWriter Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the ContentWriter type.

Expand image Protected Fields

 | Name | Description
Protected Field | OutStream | (Inherited from BinaryWriter.)

Expand image Public Properties

 | Name | Description
Public Property | BaseStream | (Inherited from BinaryWriter.)
Public Property | TargetPlatform | Gets the content build target platform.
Public Property | TargetProfile | Gets or sets the target graphics profile.

Expand image Public Methods

 | Name | Description
Public Method | Close | (Inherited from BinaryWriter.)
Public Method | Equals | (Inherited from Object.)
Public Method | Flush | (Inherited from BinaryWriter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Seek | (Inherited from BinaryWriter.)
Public Method | ToString | (Inherited from Object.)
Public Method | Write | Overloaded. Writes a value.
Public Method | WriteExternalReference | Writes the name of an external file to the output binary.
Public Method | WriteObject | Overloaded. Writes a single object preceded by a type identifier to the output binary.
Public Method | WriteRawObject | Overloaded. Writes a single object to the output binary as an instance of the specified type.
Public Method | WriteSharedResource | Adds a shared reference to the output binary and records the object to be serialized later.

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | Releases the resources used by the Dispose class.
Protected Method | Dispose | (Inherited from BinaryWriter.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | Write7BitEncodedInt | (Inherited from BinaryWriter.)

Expand image See Also

Reference

ContentWriter Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentWriter Fields

ContentWriter Fields

Expand image Protected Fields

 | Name | Description
Protected Field | OutStream | (Inherited from BinaryWriter.)

Expand image See Also

Reference

ContentWriter Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentWriter Methods

ContentWriter Methods

Expand image Public Methods

 | Name | Description
Public Method | Close | (Inherited from BinaryWriter.)
Public Method | Equals | (Inherited from Object.)
Public Method | Flush | (Inherited from BinaryWriter.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | Seek | (Inherited from BinaryWriter.)
Public Method | ToString | (Inherited from Object.)
Public Method | Write | Overloaded. Writes a value.
Public Method | WriteExternalReference | Writes the name of an external file to the output binary.
Public Method | WriteObject | Overloaded. Writes a single object preceded by a type identifier to the output binary.
Public Method | WriteRawObject | Overloaded. Writes a single object to the output binary as an instance of the specified type.
Public Method | WriteSharedResource | Adds a shared reference to the output binary and records the object to be serialized later.

Expand image Protected Methods

 | Name | Description
Protected Method | Dispose | Releases the resources used by the Dispose class.
Protected Method | Dispose | (Inherited from BinaryWriter.)
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | Write7BitEncodedInt | (Inherited from BinaryWriter.)

Expand image See Also

Reference

ContentWriter Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentWriter.Dispose Method

ContentWriter.Dispose Method

Releases the resources used by the Dispose class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected override void Dispose (
         bool disposing
)

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.Write Method

ContentWriter.Write Method

Writes a value.

Expand image Overload List

Name | Description
ContentWriter.Write (Color) | Writes a Color value.
ContentWriter.Write (Matrix) | Writes a Matrix value.
ContentWriter.Write (Quaternion) | Writes a Quaternion value.
ContentWriter.Write (Vector2) | Writes a Vector2 value.
ContentWriter.Write (Vector3) | Writes a Vector3 value.
ContentWriter.Write (Vector4) | Writes a Vector4 value.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentWriter.Write Method (Color)

ContentWriter.Write Method (Color)
See Also
CollapseAll image

Writes a Color value.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Write (
         Color value
)

Parameters

value
Value of a color using Red, Green, Blue, and Alpha values to write.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.Write Method (Matrix)

ContentWriter.Write Method (Matrix)
See Also
CollapseAll image

Writes a Matrix value.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Write (
         Matrix value
)

Parameters

value
Value to write.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.Write Method (Quaternion)

ContentWriter.Write Method (Quaternion)
See Also
CollapseAll image

Writes a Quaternion value.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Write (
         Quaternion value
)

Parameters

value
Value to write.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.Write Method (Vector2)

ContentWriter.Write Method (Vector2)
See Also
CollapseAll image

Writes a Vector2 value.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Write (
         Vector2 value
)

Parameters

value
Value to write.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.Write Method (Vector3)

ContentWriter.Write Method (Vector3)
See Also
CollapseAll image

Writes a Vector3 value.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Write (
         Vector3 value
)

Parameters

value
Value to write.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.Write Method (Vector4)

ContentWriter.Write Method (Vector4)
See Also
CollapseAll image

Writes a Vector4 value.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void Write (
         Vector4 value
)

Parameters

value
Value to write.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.WriteExternalReference Generic Method

ContentWriter.WriteExternalReference Generic Method

Writes the name of an external file to the output binary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteExternalReference<T> (
         ExternalReference<T> reference
)

Type Parameters

T
The type of reference.

Parameters

reference
External reference to a data file for the content item.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.WriteObject Method

ContentWriter.WriteObject Method

Writes a single object preceded by a type identifier to the output binary.

Expand image Overload List

Name | Description
ContentWriter.WriteObject (T) | Writes a single object preceded by a type identifier to the output binary.
ContentWriter.WriteObject (T, ContentTypeWriter) | Writes a single object to the output binary, using the specified type hint and writer worker.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentWriter.WriteObject Generic Method (T)

ContentWriter.WriteObject Generic Method (T)
See Also
CollapseAll image

Writes a single object preceded by a type identifier to the output binary.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteObject<T> (
         T value
)

Type Parameters

T
The type of value.

Parameters

value
The value to write.

Expand image Remarks

This method can be called recursively with a null value.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.WriteObject Generic Method (T, ContentTypeWriter)

ContentWriter.WriteObject Generic Method (T, ContentTypeWriter)
See Also
CollapseAll image

Writes a single object to the output binary, using the specified type hint and writer worker.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteObject<T> (
         T value,
         ContentTypeWriter typeWriter
)

Type Parameters

T
The type of value.

Parameters

value
The value to write.
typeWriter
The content type writer.

Expand image Remarks

The type hint should be retrieved from the Initialize method of the ContentTypeWriter that is calling WriteObject, by calling GetTypeWriter and passing it the type of the field used to hold the value being serialized. If the hint type is a sealed value type (which cannot be null or hold a polymorphic object instance) this method skips writing the usual type identifier.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.WriteRawObject Method

ContentWriter.WriteRawObject Method

Writes a single object to the output binary as an instance of the specified type.

Expand image Overload List

Name | Description
ContentWriter.WriteRawObject (T) | Writes a single object to the output binary as an instance of the specified type.
ContentWriter.WriteRawObject (T, ContentTypeWriter) | Writes a single object to the output binary using the specified writer worker.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentWriter.WriteRawObject Generic Method (T)

ContentWriter.WriteRawObject Generic Method (T)
See Also
CollapseAll image

Writes a single object to the output binary as an instance of the specified type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteRawObject<T> (
         T value
)

Type Parameters

T
The type of value.

Parameters

value
The value to write.

Expand image Remarks

If you specify a base class of the actual object value only data from this base type will be written. This method does not write any type identifier so it cannot support null or polymorphic values, and the reader must specify an identical type while loading the compiled data.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.WriteRawObject Generic Method (T, ContentTypeWriter)

ContentWriter.WriteRawObject Generic Method (T, ContentTypeWriter)
See Also
CollapseAll image

Writes a single object to the output binary using the specified writer worker.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteRawObject<T> (
         T value,
         ContentTypeWriter typeWriter
)

Type Parameters

T
The type of value.

Parameters

value
The value to write.
typeWriter
The writer worker. This should be looked up from the Initialize method of the ContentTypeWriter that is calling WriteRawObject, by calling GetTypeWriter.

Expand image Remarks

WriteRawObject does not write any type identifier, so it cannot support null or polymorphic values, and the reader must specify an identical type while loading the compiled data.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.WriteSharedResource Generic Method

ContentWriter.WriteSharedResource Generic Method

Adds a shared reference to the output binary and records the object to be serialized later.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteSharedResource<T> (
         T value
)

Type Parameters

T
The type of value.

Parameters

value
The object to record.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter Properties

ContentWriter Properties

Expand image Public Properties

 | Name | Description
Public Property | BaseStream | (Inherited from BinaryWriter.)
Public Property | TargetPlatform | Gets the content build target platform.
Public Property | TargetProfile | Gets or sets the target graphics profile.

Expand image See Also

Reference

ContentWriter Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace


ContentWriter.TargetPlatform Property

ContentWriter.TargetPlatform Property

Gets the content build target platform.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public TargetPlatform TargetPlatform { get; }

Property Value

The content build target platform.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentWriter.TargetProfile Property

ContentWriter.TargetProfile Property

Gets or sets the target graphics profile.

This should be one of the values of the GraphicsProfile Enumeration enumeration.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public GraphicsProfile TargetProfile { get; }

Property Value

Target graphics profile of the content build. For a list of possible values, see GraphicsProfile Enumeration.

Expand image See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace
CollapseAll image

Provides base classes that represent the creation and writing of intermediate content for game asset types processed by the XNA Framework Content Pipeline.

Expand image Classes

 | Name | Description
Public Class | ContentTypeSerializer | Provides a generic implementation of ContentTypeSerializer methods and properties for serializing and deserializing a specific managed type.
Public Class | ContentTypeSerializer | Provides methods for serializing and deserializing a specific managed type.
Public Class | ContentTypeSerializerAttribute | Identifies type serializer components.
Public Class | IntermediateReader | Provides an implementation of many of the methods of IntermediateSerializer. Deserializes and tracks state for shared resources and external references.
Public Class | IntermediateSerializer | Provides methods for reading and writing XNA intermediate XML format.
Public Class | IntermediateWriter | Provides an implementation of many of the methods of IntermediateSerializer including serialization and state tracking for shared resources and external references.

Expand image Delegates

 | Name | Description
Public Delegate | ContentTypeSerializer.ChildCallback | Callback delegate for the ScanChildren method.


ContentTypeSerializer Class

ContentTypeSerializer Class
See Also Members
CollapseAll image

Provides methods for serializing and deserializing a specific managed type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class ContentTypeSerializer

Expand image See Also

Reference

ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer Members

ContentTypeSerializer Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the ContentTypeSerializer type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentTypeSerializer | Overloaded. Initializes a new instance of the ContentTypeSerializer class.

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | Gets a value indicating whether this component may load data into an existing object or if it must it construct a new instance of the object before loading the data.
Public Property | TargetType | Gets the type handled by this serializer component.
Public Property | XmlTypeName | Gets a short-form XML name for the target type, or null if there is none.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ObjectIsEmpty | Queries whether an object contains data to be serialized.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Deserialize | Deserializes an object from intermediate XML format.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | Initialize | Retrieves and caches any nested type serializers and allows reflection over the target data type.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | ScanChildren | Examines the children of the specified object, passing each to a callback delegate.
Protected Method | Serialize | Serializes an object to intermediate XML format.

Expand image See Also

Reference

ContentTypeSerializer Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer Constructor

ContentTypeSerializer Constructor

Initializes a new instance of the ContentTypeSerializer class.

Expand image Overload List

Name | Description
ContentTypeSerializer (Type) | Initializes a new instance of the ContentTypeSerializer class for serializing the specified type.
ContentTypeSerializer (Type, String) | Initializes a new instance of the ContentTypeSerializer class for serializing the specified type using the specified XML shortcut name.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer Constructor (Type)

ContentTypeSerializer Constructor (Type)
See Also
CollapseAll image

Initializes a new instance of the ContentTypeSerializer class for serializing the specified type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ContentTypeSerializer (
         Type targetType
)

Parameters

targetType
The target type.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | targetType is null.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer Constructor (Type, String)

ContentTypeSerializer Constructor (Type, String)
See Also
CollapseAll image

Initializes a new instance of the ContentTypeSerializer class for serializing the specified type using the specified XML shortcut name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ContentTypeSerializer (
         Type targetType,
         string xmlTypeName
)

Parameters

targetType
The target type.
xmlTypeName
The XML shortcut name.

Expand image Exceptions

Exception type | Condition
ArgumentNullException | targetType is null.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer Methods

ContentTypeSerializer Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ObjectIsEmpty | Queries whether an object contains data to be serialized.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Deserialize | Deserializes an object from intermediate XML format.
Protected Method | Finalize | (Inherited from Object.)
Protected Method | Initialize | Retrieves and caches any nested type serializers and allows reflection over the target data type.
Protected Method | MemberwiseClone | (Inherited from Object.)
Protected Method | ScanChildren | Examines the children of the specified object, passing each to a callback delegate.
Protected Method | Serialize | Serializes an object to intermediate XML format.

Expand image See Also

Reference

ContentTypeSerializer Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer.Deserialize Method

ContentTypeSerializer.Deserialize Method

Deserializes an object from intermediate XML format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal abstract Object Deserialize (
         IntermediateReader input,
         ContentSerializerAttribute format,
         Object existingInstance
)

Parameters

input
Location of the intermediate XML and various deserialization helpers.
format
Specifies the intermediate source XML format.
existingInstance
The object containing the received data, or null if the deserializer should construct a new instance.

Return Value

The resultant object.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.Initialize Method

ContentTypeSerializer.Initialize Method

Retrieves and caches any nested type serializers and allows reflection over the target data type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal virtual void Initialize (
         IntermediateSerializer serializer
)

Parameters

serializer
The content serializer.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.ObjectIsEmpty Method

ContentTypeSerializer.ObjectIsEmpty Method

Queries whether an object contains data to be serialized.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool ObjectIsEmpty (
         Object value
)

Parameters

value
The object to query.

Return Value

true if value contains data to be serialized; false otherwise.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.ScanChildren Method

ContentTypeSerializer.ScanChildren Method

Examines the children of the specified object, passing each to a callback delegate.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal virtual void ScanChildren (
         IntermediateSerializer serializer,
         ChildCallback callback,
         Object value
)

Parameters

serializer
The content serializer.
callback
The method to be called for each examined child.
value
The object whose children are being scanned.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.Serialize Method

ContentTypeSerializer.Serialize Method

Serializes an object to intermediate XML format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal abstract void Serialize (
         IntermediateWriter output,
         Object value,
         ContentSerializerAttribute format
)

Parameters

output
Specifies the intermediate XML location, and provides various serialization helpers.
value
The object to be serialized.
format
Specifies the content format for this object.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer Properties

ContentTypeSerializer Properties

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | Gets a value indicating whether this component may load data into an existing object or if it must it construct a new instance of the object before loading the data.
Public Property | TargetType | Gets the type handled by this serializer component.
Public Property | XmlTypeName | Gets a short-form XML name for the target type, or null if there is none.

Expand image See Also

Reference

ContentTypeSerializer Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer.CanDeserializeIntoExistingObject Property

ContentTypeSerializer.CanDeserializeIntoExistingObject Property
See Also
CollapseAll image

Gets a value indicating whether this component may load data into an existing object or if it must it construct a new instance of the object before loading the data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool CanDeserializeIntoExistingObject { get; }

Property Value

true if this component can load data into an existing object; false if a new instance of the object must be constructed.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.TargetType Property

ContentTypeSerializer.TargetType Property

Gets the type handled by this serializer component.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Type TargetType { get; }

Property Value

The type handled by this serializer component.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.XmlTypeName Property

ContentTypeSerializer.XmlTypeName Property

Gets a short-form XML name for the target type, or null if there is none.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string XmlTypeName { get; }

Property Value

A short-form XML name for the target type, or null if there is none.

Expand image See Also

Reference

ContentTypeSerializer Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer Generic Class

ContentTypeSerializer Generic Class
See Also Members
CollapseAll image

Provides a generic implementation of ContentTypeSerializer methods and properties for serializing and deserializing a specific managed type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public abstract class ContentTypeSerializer<T> : ContentTypeSerializer

Expand image Remarks

This is a generic implementation of ContentTypeSerializer and, therefore, can handle strongly typed content data.

Expand image See Also

Reference

ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer Members

ContentTypeSerializer Members
See Also Constructors Methods
CollapseAll image

The following tables list the members exposed by the ContentTypeSerializer type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentTypeSerializer | Overloaded. Initializes a new instance of the ContentTypeSerializer class.

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | (Inherited from ContentTypeSerializer.)
Public Property | TargetType | (Inherited from ContentTypeSerializer.)
Public Property | XmlTypeName | (Inherited from ContentTypeSerializer.)

Expand image Public Methods

 | Name | Description
Public Method | Deserialize | Overloaded. Deserializes an object from intermediate XML format.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ObjectIsEmpty | Overloaded. Queries whether an object contains data to be serialized.
Public Method | ScanChildren | Overloaded. Examines the children of the specified object, passing each to a callback delegate.
Public Method | Serialize | Overloaded. Serializes an object to intermediate XML format.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeSerializer Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer Constructor

ContentTypeSerializer Constructor

Initializes a new instance of the ContentTypeSerializer class.

Expand image Overload List

Name | Description
ContentTypeSerializer () | Initializes a new instance of the ContentTypeSerializer class.
ContentTypeSerializer (String) | Initializes a new instance of the ContentTypeSerializer class using the specified XML shortcut name.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer Constructor ()

ContentTypeSerializer Constructor ()
See Also
CollapseAll image

Initializes a new instance of the ContentTypeSerializer class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ContentTypeSerializer ()

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer Constructor (String)

ContentTypeSerializer Constructor (String)
See Also
CollapseAll image

Initializes a new instance of the ContentTypeSerializer class using the specified XML shortcut name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected ContentTypeSerializer (
         string xmlTypeName
)

Parameters

xmlTypeName
The XML shortcut name.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer Methods

ContentTypeSerializer Methods

Expand image Public Methods

 | Name | Description
Public Method | Deserialize | Overloaded. Deserializes an object from intermediate XML format.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ObjectIsEmpty | Overloaded. Queries whether an object contains data to be serialized.
Public Method | ScanChildren | Overloaded. Examines the children of the specified object, passing each to a callback delegate.
Public Method | Serialize | Overloaded. Serializes an object to intermediate XML format.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeSerializer Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer.Deserialize Method

ContentTypeSerializer.Deserialize Method

Deserializes an object from intermediate XML format.

Expand image Overload List

Name | Description
ContentTypeSerializer.Deserialize (IntermediateReader, ContentSerializerAttribute, Object) | Deserializes an object from intermediate XML format.
ContentTypeSerializer.Deserialize (IntermediateReader, ContentSerializerAttribute, T) | Deserializes a strongly typed object from intermediate XML format.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer.Deserialize Method (IntermediateReader, ContentSerializerAttribute, Object)

ContentTypeSerializer.Deserialize Method (IntermediateReader, ContentSerializerAttribute, Object)
See Also
CollapseAll image

Deserializes an object from intermediate XML format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal override Object Deserialize (
         IntermediateReader input,
         ContentSerializerAttribute format,
         Object existingInstance
)

Parameters

input
Location of the intermediate XML and various deserialization helpers.
format
Specifies the intermediate source XML format.
existingInstance
The object containing the received data, or null if the deserializer should construct a new instance.

Return Value

The object after deserialization.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.Deserialize Method (IntermediateReader, ContentSerializerAttribute, T)

ContentTypeSerializer.Deserialize Method (IntermediateReader, ContentSerializerAttribute, T)
See Also
CollapseAll image

Deserializes a strongly typed object from intermediate XML format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal abstract T Deserialize (
         IntermediateReader input,
         ContentSerializerAttribute format,
         T existingInstance
)

Parameters

input
Location of the intermediate XML and various deserialization helpers.
format
Specifies the intermediate source XML format.
existingInstance
The strongly typed object containing the received data, or null if the deserializer should construct a new instance.

Return Value

The object type of the deserialized object.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.ObjectIsEmpty Method

ContentTypeSerializer.ObjectIsEmpty Method

Queries whether an object contains data to be serialized.

Expand image Overload List

Name | Description
ContentTypeSerializer.ObjectIsEmpty (Object) | Queries whether a strongly-typed object contains data to be serialized.
ContentTypeSerializer.ObjectIsEmpty (T) | Queries whether an object contains data to be serialized.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer.ObjectIsEmpty Method (Object)

ContentTypeSerializer.ObjectIsEmpty Method (Object)
See Also
CollapseAll image

Queries whether a strongly-typed object contains data to be serialized.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool ObjectIsEmpty (
         Object value
)

Parameters

value
The object to query.

Return Value

true if value contains data to be serialized; false otherwise.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.ObjectIsEmpty Method (T)

ContentTypeSerializer.ObjectIsEmpty Method (T)
See Also
CollapseAll image

Queries whether an object contains data to be serialized.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public virtual bool ObjectIsEmpty (
         T value
)

Parameters

value
The object to query.

Return Value

true if value contains data to be serialized; false otherwise.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.ScanChildren Method

ContentTypeSerializer.ScanChildren Method

Examines the children of the specified object, passing each to a callback delegate.

Expand image Overload List

Name | Description
ContentTypeSerializer.ScanChildren (IntermediateSerializer, ChildCallback, Object) | Examines the children of the specified object, passing each to a callback delegate.
ContentTypeSerializer.ScanChildren (IntermediateSerializer, ChildCallback, T) | Examines the children of the specified object, passing each to a callback delegate.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer.ScanChildren Method (IntermediateSerializer, ChildCallback, Object)

ContentTypeSerializer.ScanChildren Method (IntermediateSerializer, ChildCallback, Object)
See Also
CollapseAll image

Examines the children of the specified object, passing each to a callback delegate.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal override void ScanChildren (
         IntermediateSerializer serializer,
         ChildCallback callback,
         Object value
)

Parameters

serializer
The content serializer.
callback
The method to be called for each examined child.
value
The object whose children are being scanned.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.ScanChildren Method (IntermediateSerializer, ChildCallback, T)

ContentTypeSerializer.ScanChildren Method (IntermediateSerializer, ChildCallback, T)
See Also
CollapseAll image

Examines the children of the specified object, passing each to a callback delegate.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal virtual void ScanChildren (
         IntermediateSerializer serializer,
         ChildCallback callback,
         T value
)

Parameters

serializer
The content serializer.
callback
The method to be called for each examined child.
value
The strongly typed object whose children are being scanned.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.Serialize Method

ContentTypeSerializer.Serialize Method

Serializes an object to intermediate XML format.

Expand image Overload List

Name | Description
ContentTypeSerializer.Serialize (IntermediateWriter, Object, ContentSerializerAttribute) | Serializes an object to intermediate XML format.
ContentTypeSerializer.Serialize (IntermediateWriter, T, ContentSerializerAttribute) | Serializes an object to intermediate XML format.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer.Serialize Method (IntermediateWriter, Object, ContentSerializerAttribute)

ContentTypeSerializer.Serialize Method (IntermediateWriter, Object, ContentSerializerAttribute)
See Also
CollapseAll image

Serializes an object to intermediate XML format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal override void Serialize (
         IntermediateWriter output,
         Object value,
         ContentSerializerAttribute format
)

Parameters

output
Specifies the intermediate XML location, and provides various serialization helpers.
value
The object to be serialized.
format
Specifies the content format for this object.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer.Serialize Method (IntermediateWriter, T, ContentSerializerAttribute)

ContentTypeSerializer.Serialize Method (IntermediateWriter, T, ContentSerializerAttribute)
See Also
CollapseAll image

Serializes an object to intermediate XML format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal abstract void Serialize (
         IntermediateWriter output,
         T value,
         ContentSerializerAttribute format
)

Parameters

output
Specifies the intermediate XML location, and provides various serialization helpers.
value
The strongly typed object to be serialized.
format
Specifies the content format for this object.

Expand image See Also

Reference

ContentTypeSerializer Generic Class
ContentTypeSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializer Properties

ContentTypeSerializer Properties

Expand image Public Properties

 | Name | Description
Public Property | CanDeserializeIntoExistingObject | (Inherited from ContentTypeSerializer.)
Public Property | TargetType | (Inherited from ContentTypeSerializer.)
Public Property | XmlTypeName | (Inherited from ContentTypeSerializer.)

Expand image See Also

Reference

ContentTypeSerializer Generic Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializer.ChildCallback Delegate

ContentTypeSerializer.ChildCallback Delegate

Callback delegate for the ScanChildren method.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
protected internal delegate void ContentTypeSerializer.ChildCallback (
         ContentTypeSerializer typeSerializer,
         Object value
)

Parameters

typeSerializer
The serializer component used to read or write the child object.
value
The child object currently being scanned.

Expand image See Also

Reference

Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializerAttribute Class

ContentTypeSerializerAttribute Class
See Also Members
CollapseAll image

Identifies type serializer components.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[AttributeUsageAttribute(4)]
public sealed class ContentTypeSerializerAttribute : Attribute

Expand image Remarks

All custom serializers must decorate their class with this attribute, as well as extend the ContentTypeSerializer class.

Expand image See Also

Reference

ContentTypeSerializer
ContentTypeSerializerAttribute Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializerAttribute Members

ContentTypeSerializerAttribute Members
See Also Constructors
CollapseAll image

The following tables list the members exposed by the ContentTypeSerializerAttribute type.

Expand image Public Constructors

 | Name | Description
Public Method | ContentTypeSerializerAttribute | Initializes a new isntance of the ContentTypeSerializerAttribute class.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeSerializerAttribute Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializerAttribute Constructor

ContentTypeSerializerAttribute Constructor

Initializes a new isntance of the ContentTypeSerializerAttribute class.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentTypeSerializerAttribute ()

Expand image See Also

Reference

ContentTypeSerializerAttribute Class
ContentTypeSerializerAttribute Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


ContentTypeSerializerAttribute Methods

ContentTypeSerializerAttribute Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Attribute.)
Public Method | GetHashCode | (Inherited from Attribute.)
Public Method | GetType | (Inherited from Object.)
Public Method | Match | (Inherited from Attribute.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

ContentTypeSerializerAttribute Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


ContentTypeSerializerAttribute Properties

ContentTypeSerializerAttribute Properties

Expand image See Also

Reference

ContentTypeSerializerAttribute Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateReader Class

IntermediateReader Class
See Also Members
CollapseAll image

Provides an implementation of many of the methods of IntermediateSerializer. Deserializes and tracks state for shared resources and external references.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class IntermediateReader

Expand image Remarks

A new instance of IntermediateReader is constructed for each deserialize operation.

Expand image See Also

Reference

IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader Members

IntermediateReader Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the IntermediateReader type.

Expand image Public Properties

 | Name | Description
Public Property | Serializer | Gets the parent serializer.
Public Property | Xml | Gets the XML input stream.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveToElement | Moves to the specified element if the element name exists.
Public Method | ReadExternalReference | Reads an external reference ID and records it for subsequent operations.
Public Method | ReadObject | Overloaded. Reads a single object from the input XML stream.
Public Method | ReadRawObject | Overloaded. Reads a single object from the input XML stream.
Public Method | ReadSharedResource | Reads a shared resource ID and records it for subsequent operations.
Public Method | ReadTypeName | Reads and decodes a type descriptor from the XML input stream.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

IntermediateReader Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateReader Methods

IntermediateReader Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | MoveToElement | Moves to the specified element if the element name exists.
Public Method | ReadExternalReference | Reads an external reference ID and records it for subsequent operations.
Public Method | ReadObject | Overloaded. Reads a single object from the input XML stream.
Public Method | ReadRawObject | Overloaded. Reads a single object from the input XML stream.
Public Method | ReadSharedResource | Reads a shared resource ID and records it for subsequent operations.
Public Method | ReadTypeName | Reads and decodes a type descriptor from the XML input stream.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

IntermediateReader Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateReader.MoveToElement Method

IntermediateReader.MoveToElement Method

Moves to the specified element if the element name exists.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool MoveToElement (
         string elementName
)

Parameters

elementName
The element name.

Return Value

true if the specified element exists and the move was successful; false otherwise.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadExternalReference Generic Method

IntermediateReader.ReadExternalReference Generic Method

Reads an external reference ID and records it for subsequent operations.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void ReadExternalReference<T> (
         ExternalReference<T> existingInstance
)

Type Parameters

T
The type of existingInstance.

Parameters

existingInstance
The object receiving the data, or null if a new instance of the object should be created.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadObject Method

IntermediateReader.ReadObject Method

Reads a single object from the input XML stream.

Expand image Overload List

Name | Description
IntermediateReader.ReadObject (ContentSerializerAttribute) | Reads a single object from the input XML stream.
IntermediateReader.ReadObject (ContentSerializerAttribute, ContentTypeSerializer) | Reads a single object from the input XML stream, using the specified type hint.
IntermediateReader.ReadObject (ContentSerializerAttribute, ContentTypeSerializer, T) | Reads a single object from the input XML stream using the specified type hint, optionally specifying an existing instance to receive the data.
IntermediateReader.ReadObject (ContentSerializerAttribute, T) | Reads a single object from the input XML stream, optionally specifying an existing instance to receive the data.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateReader.ReadObject Generic Method (ContentSerializerAttribute)

IntermediateReader.ReadObject Generic Method (ContentSerializerAttribute)
See Also
CollapseAll image

Reads a single object from the input XML stream.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T ReadObject<T> (
         ContentSerializerAttribute format
)

Type Parameters

T
The type of object read.

Parameters

format
The format expected by the type serializer.

Return Value

The object.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadObject Generic Method (ContentSerializerAttribute, ContentTypeSerializer)

IntermediateReader.ReadObject Generic Method (ContentSerializerAttribute, ContentTypeSerializer)
See Also
CollapseAll image

Reads a single object from the input XML stream, using the specified type hint.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T ReadObject<T> (
         ContentSerializerAttribute format,
         ContentTypeSerializer typeSerializer
)

Type Parameters

T
The type of object read.

Parameters

format
The format of the XML.
typeSerializer
The type serializer.

Return Value

The object.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadObject Generic Method (ContentSerializerAttribute, ContentTypeSerializer, T)

IntermediateReader.ReadObject Generic Method (ContentSerializerAttribute, ContentTypeSerializer, T)
See Also
CollapseAll image

Reads a single object from the input XML stream using the specified type hint, optionally specifying an existing instance to receive the data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T ReadObject<T> (
         ContentSerializerAttribute format,
         ContentTypeSerializer typeSerializer,
         T existingInstance
)

Type Parameters

T
The type of object read.

Parameters

format
The format of the XML.
typeSerializer
The type serializer.
existingInstance
The object receiving the data, or null if a new instance should be created.

Return Value

The object

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadObject Generic Method (ContentSerializerAttribute, T)

IntermediateReader.ReadObject Generic Method (ContentSerializerAttribute, T)
See Also
CollapseAll image

Reads a single object from the input XML stream, optionally specifying an existing instance to receive the data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T ReadObject<T> (
         ContentSerializerAttribute format,
         T existingInstance
)

Type Parameters

T
The type of object read.

Parameters

format
The format expected by the type serializer.
existingInstance
The object receiving the data, or null if a new instance should be created.

Return Value

The object.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadRawObject Method

IntermediateReader.ReadRawObject Method

Reads a single object from the input XML stream.

Expand image Overload List

Name | Description
IntermediateReader.ReadRawObject (ContentSerializerAttribute) | Reads a single object from the input XML stream as an instance of the specified type, optionally specifying an existing instance to receive the data.
IntermediateReader.ReadRawObject (ContentSerializerAttribute, ContentTypeSerializer) | Reads a single object from the input XML stream as an instance of the specified type using the specified type hint.
IntermediateReader.ReadRawObject (ContentSerializerAttribute, ContentTypeSerializer, T) | Reads a single object from the input XML stream as an instance of the specified type using the specified type hint, optionally specifying an existing instance to receive the data.
IntermediateReader.ReadRawObject (ContentSerializerAttribute, T) | Reads a single object from the input XML stream, as an instance of the specified type.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateReader.ReadRawObject Generic Method (ContentSerializerAttribute)

IntermediateReader.ReadRawObject Generic Method (ContentSerializerAttribute)
See Also
CollapseAll image

Reads a single object from the input XML stream as an instance of the specified type, optionally specifying an existing instance to receive the data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T ReadRawObject<T> (
         ContentSerializerAttribute format
)

Type Parameters

T
The type of object to read.

Parameters

format
The format of the XML.

Return Value

The object.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadRawObject Generic Method (ContentSerializerAttribute, ContentTypeSerializer)

IntermediateReader.ReadRawObject Generic Method (ContentSerializerAttribute, ContentTypeSerializer)
See Also
CollapseAll image

Reads a single object from the input XML stream as an instance of the specified type using the specified type hint.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T ReadRawObject<T> (
         ContentSerializerAttribute format,
         ContentTypeSerializer typeSerializer
)

Type Parameters

T
The type of object to read.

Parameters

format
The format of the XML.
typeSerializer
The type serializer.

Return Value

The object.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadRawObject Generic Method (ContentSerializerAttribute, ContentTypeSerializer, T)

IntermediateReader.ReadRawObject Generic Method (ContentSerializerAttribute, ContentTypeSerializer, T)
See Also
CollapseAll image

Reads a single object from the input XML stream as an instance of the specified type using the specified type hint, optionally specifying an existing instance to receive the data.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T ReadRawObject<T> (
         ContentSerializerAttribute format,
         ContentTypeSerializer typeSerializer,
         T existingInstance
)

Type Parameters

T
The type of object to read.

Parameters

format
The format of the XML.
typeSerializer
The type serializer.
existingInstance
The object receiving the data, or null if a new instance should be created.

Return Value

The object.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadRawObject Generic Method (ContentSerializerAttribute, T)

IntermediateReader.ReadRawObject Generic Method (ContentSerializerAttribute, T)
See Also
CollapseAll image

Reads a single object from the input XML stream, as an instance of the specified type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public T ReadRawObject<T> (
         ContentSerializerAttribute format,
         T existingInstance
)

Type Parameters

T
The type of object to read.

Parameters

format
The object.
existingInstance
The object receiving the data, or null if a new instance should be created.

Return Value

The type of object read.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadSharedResource Generic Method

IntermediateReader.ReadSharedResource Generic Method

Reads a shared resource ID and records it for subsequent operations.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void ReadSharedResource<T> (
         ContentSerializerAttribute format,
         Action<T> fixup
)

Type Parameters

T
The type to read.

Parameters

format
The format of the XML.
fixup
The fixup operation to perform.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.ReadTypeName Method

IntermediateReader.ReadTypeName Method

Reads and decodes a type descriptor from the XML input stream.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public Type ReadTypeName ()

Return Value

The type descriptor.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader Properties

IntermediateReader Properties

Expand image Public Properties

 | Name | Description
Public Property | Serializer | Gets the parent serializer.
Public Property | Xml | Gets the XML input stream.

Expand image See Also

Reference

IntermediateReader Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateReader.Serializer Property

IntermediateReader.Serializer Property

Gets the parent serializer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IntermediateSerializer Serializer { get; }

Property Value

The parent serializer.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateReader.Xml Property

IntermediateReader.Xml Property

Gets the XML input stream.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public XmlReader Xml { get; }

Property Value

The XML input stream.

Expand image See Also

Reference

IntermediateReader Class
IntermediateReader Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateSerializer Class

IntermediateSerializer Class
See Also Members
CollapseAll image

Provides methods for reading and writing XNA intermediate XML format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class IntermediateSerializer

Expand image See Also

Reference

IntermediateSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateSerializer Members

IntermediateSerializer Members
See Also Methods
CollapseAll image

The following tables list the members exposed by the IntermediateSerializer type.

Expand image Public Methods

 | Name | Description
 | Deserialize | Deserializes an intermediate XML file into a managed object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetTypeSerializer | Retrieves the worker serializer for a specified type.
 | Serialize | Serializes an object into an intermediate XML file.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

IntermediateSerializer Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateSerializer Methods

IntermediateSerializer Methods

Expand image Public Methods

 | Name | Description
 | Deserialize | Deserializes an intermediate XML file into a managed object.
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | GetTypeSerializer | Retrieves the worker serializer for a specified type.
 | Serialize | Serializes an object into an intermediate XML file.
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

IntermediateSerializer Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateSerializer.Deserialize Generic Method

IntermediateSerializer.Deserialize Generic Method

Deserializes an intermediate XML file into a managed object.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static T Deserialize<T> (
         XmlReader input,
         string referenceRelocationPath
)

Type Parameters

T
The type to deserialize.

Parameters

input
Intermediate XML file.
referenceRelocationPath
Final name of the output file used to relative encode external reference filenames.

Return Value

The deserialized type.

Expand image See Also

Reference

IntermediateSerializer Class
IntermediateSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateSerializer.GetTypeSerializer Method

IntermediateSerializer.GetTypeSerializer Method

Retrieves the worker serializer for a specified type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ContentTypeSerializer GetTypeSerializer (
         Type type
)

Parameters

type
The type.

Return Value

The worker serializer

Expand image See Also

Reference

IntermediateSerializer Class
IntermediateSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateSerializer.Serialize Generic Method

IntermediateSerializer.Serialize Generic Method

Serializes an object into an intermediate XML file.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public static void Serialize<T> (
         XmlWriter output,
         T value,
         string referenceRelocationPath
)

Type Parameters

T
The type of value.

Parameters

output
The output XML stream.
value
The object to be serialized.
referenceRelocationPath
Final name of the output file, used to relative encode external reference filenames.

Expand image See Also

Reference

IntermediateSerializer Class
IntermediateSerializer Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateWriter Class

IntermediateWriter Class
See Also Members
CollapseAll image

Provides an implementation of many of the methods of IntermediateSerializer including serialization and state tracking for shared resources and external references.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public sealed class IntermediateWriter

Expand image Remarks

A new instance of IntermediateWriter is constructed for each serialize operation.

Expand image See Also

Reference

IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateWriter Members

IntermediateWriter Members
See Also Methods Properties
CollapseAll image

The following tables list the members exposed by the IntermediateWriter type.

Expand image Public Properties

 | Name | Description
Public Property | Serializer | Gets the parent serializer.
Public Property | Xml | Gets the XML output stream.

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | WriteExternalReference | Adds an external reference to the output XML, and records the filename to be serialized later.
Public Method | WriteObject | Overloaded. Writes a single object to the output XML stream.
Public Method | WriteRawObject | Overloaded. Writes a single object to the output XML stream.
Public Method | WriteSharedResource | Adds a shared reference to the output XML and records the object to be serialized later.
Public Method | WriteTypeName | Writes a managed type descriptor to the XML output stream.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

IntermediateWriter Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateWriter Methods

IntermediateWriter Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)
Public Method | WriteExternalReference | Adds an external reference to the output XML, and records the filename to be serialized later.
Public Method | WriteObject | Overloaded. Writes a single object to the output XML stream.
Public Method | WriteRawObject | Overloaded. Writes a single object to the output XML stream.
Public Method | WriteSharedResource | Adds a shared reference to the output XML and records the object to be serialized later.
Public Method | WriteTypeName | Writes a managed type descriptor to the XML output stream.

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

IntermediateWriter Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateWriter.WriteExternalReference Generic Method

IntermediateWriter.WriteExternalReference Generic Method

Adds an external reference to the output XML, and records the filename to be serialized later.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteExternalReference<T> (
         ExternalReference<T> value
)

Type Parameters

T
The type of external reference to add.

Parameters

value
The external reference to add.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateWriter.WriteObject Method

IntermediateWriter.WriteObject Method

Writes a single object to the output XML stream.

Expand image Overload List

Name | Description
IntermediateWriter.WriteObject (T, ContentSerializerAttribute) | Writes a single object to the output XML stream.
IntermediateWriter.WriteObject (T, ContentSerializerAttribute, ContentTypeSerializer) | Writes a single object to the output XML stream, using the specified type hint.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateWriter.WriteObject Generic Method (T, ContentSerializerAttribute)

IntermediateWriter.WriteObject Generic Method (T, ContentSerializerAttribute)
See Also
CollapseAll image

Writes a single object to the output XML stream.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteObject<T> (
         T value,
         ContentSerializerAttribute format
)

Type Parameters

T
The type of value to write.

Parameters

value
The value to write.
format
The format of the XML.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateWriter.WriteObject Generic Method (T, ContentSerializerAttribute, ContentTypeSerializer)

IntermediateWriter.WriteObject Generic Method (T, ContentSerializerAttribute, ContentTypeSerializer)
See Also
CollapseAll image

Writes a single object to the output XML stream, using the specified type hint.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteObject<T> (
         T value,
         ContentSerializerAttribute format,
         ContentTypeSerializer typeSerializer
)

Type Parameters

T
The type of value to write.

Parameters

value
The value to write.
format
The format of the XML.
typeSerializer
The type serializer.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateWriter.WriteRawObject Method

IntermediateWriter.WriteRawObject Method

Writes a single object to the output XML stream.

Expand image Overload List

Name | Description
IntermediateWriter.WriteRawObject (T, ContentSerializerAttribute) | Writes a single object to the output XML stream using the specified serializer worker.
IntermediateWriter.WriteRawObject (T, ContentSerializerAttribute, ContentTypeSerializer) | Writes a single object to the output XML stream as an instance of the specified type.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateWriter.WriteRawObject Generic Method (T, ContentSerializerAttribute)

IntermediateWriter.WriteRawObject Generic Method (T, ContentSerializerAttribute)
See Also
CollapseAll image

Writes a single object to the output XML stream using the specified serializer worker.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteRawObject<T> (
         T value,
         ContentSerializerAttribute format
)

Type Parameters

T
The type of value to write.

Parameters

value
The value to write.
format
The format of the XML.

Expand image Remarks

This method does not write any type identifier, so it cannot support null or polymorphic values and the reader must specify an identical type while deserializing.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateWriter.WriteRawObject Generic Method (T, ContentSerializerAttribute, ContentTypeSerializer)

IntermediateWriter.WriteRawObject Generic Method (T, ContentSerializerAttribute, ContentTypeSerializer)
See Also
CollapseAll image

Writes a single object to the output XML stream as an instance of the specified type.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteRawObject<T> (
         T value,
         ContentSerializerAttribute format,
         ContentTypeSerializer typeSerializer
)

Type Parameters

T
The type of value to write.

Parameters

value
The value to write.
format
The format of the XML.
typeSerializer
The type serializer.

Expand image Remarks

If you specify a base class of the actual object value, only data from this base type will be written. This method does not write any type identifier, so it cannot support null or polymorphic values and the reader must specify an identical type while deserializing.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateWriter.WriteSharedResource Generic Method

IntermediateWriter.WriteSharedResource Generic Method

Adds a shared reference to the output XML and records the object to be serialized later.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteSharedResource<T> (
         T value,
         ContentSerializerAttribute format
)

Type Parameters

T
The type of value to write.

Parameters

value
The value to write.
format
The format of the XML.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateWriter.WriteTypeName Method

IntermediateWriter.WriteTypeName Method

Writes a managed type descriptor to the XML output stream.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public void WriteTypeName (
         Type type
)

Parameters

type
The type.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateWriter Properties

IntermediateWriter Properties

Expand image Public Properties

 | Name | Description
Public Property | Serializer | Gets the parent serializer.
Public Property | Xml | Gets the XML output stream.

Expand image See Also

Reference

IntermediateWriter Class
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace


IntermediateWriter.Serializer Property

IntermediateWriter.Serializer Property

Gets the parent serializer.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public IntermediateSerializer Serializer { get; }

Property Value

The parent serializer.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


IntermediateWriter.Xml Property

IntermediateWriter.Xml Property

Gets the XML output stream.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public XmlWriter Xml { get; }

Property Value

The XML output stream.

Expand image See Also

Reference

IntermediateWriter Class
IntermediateWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Provides support for importing and processing game assets into the binary format that is used by the content loader of a game project.

Expand image Classes

 | Name | Description
Public Class | BuildContent | Provides methods and properties for importing and processing game assets into a binary format.
Public Class | BuildXact | An MSBuild task that provides incremental build capabilities for XACT projects.
Public Class | CleanContent | An MSBuild task for deleting all the intermediate and output files that were created by a previous Content Pipeline build operation.
Public Class | GetLastOutputs | Provides methods and properties for getting the names of all output content files from the content pipeline's cache file.


BuildContent Class

BuildContent Class
See Also Members
CollapseAll image

Provides methods and properties for importing and processing game assets into a binary format.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class BuildContent : Task

Expand image Remarks

BuildContent represents a specific MSBuild task, exposing the complete functionality of the XNA Framework Content Pipeline. This task takes a list of source asset files and the appropriate assemblies (implementing the importer and processor components) as input. After processing, the intermediate result is compiled into a binary format recognized by the game content loader.

Expand image See Also

Reference

BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent Members

BuildContent Members
See Also Constructors Fields Methods Properties
CollapseAll image

The following tables list the members exposed by the BuildContent type.

Expand image Public Constructors

 | Name | Description
Public Method | BuildContent | Initializes a new instance of BuildContent.

Expand image Public Fields

 | Name | Description
Public Field | CancelEventNameFormat | The format specifier for the named event used to cancel the build.

Expand image Public Properties

 | Name | Description
Public Property | BuildConfiguration | Gets or sets the content build configuration name.
Public Property | BuildEngine | (Inherited from Task.)
Public Property | BuildEngine2 | (Inherited from Task.)
Public Property | BuildEngine3 | (Inherited from Task.)
Public Property | CompressContent | Gets or sets the content compression flag.
Public Property | HostObject | (Inherited from Task.)
Public Property | IntermediateDirectory | Gets or sets the directory for storing temporary build files.
Public Property | IntermediateFiles | Gets all file names produced by the build, regardless of any incremental optimizations.
Public Property | Log | (Inherited from Task.)
Public Property | LoggerRootDirectory | Gets or sets the base reference path used when reporting errors during the content build process.
Public Property | OutputContentFiles | Gets all file names produced by the build, regardless of any incremental optimizations.
Public Property | OutputDirectory | Gets or sets the output directory for the final build results.
Public Property | PipelineAssemblies | Gets or sets the names of assemblies that provide Importer<T> or ContentProcessor<T> components for use by the build.
Public Property | PipelineAssemblyDependencies | Gets or sets the dependencies of the pipeline assemblies.
Public Property | RebuildAll | Gets or sets the force rebuild flag.
Public Property | RebuiltContentFiles | Gets the list of file names modified by an incremental rebuild.
Public Property | RootDirectory | Gets or sets the base path for the entire content build process.
Public Property | SourceAssets | Gets or sets the source asset files to be built.
Public Property | TargetPlatform | Gets or sets the content build target platform.
Public Property | TargetProfile | Gets or sets the target graphics profile.

Expand image Protected Properties

 | Name | Description
Protected Property | HelpKeywordPrefix | (Inherited from Task.)
Protected Property | TaskResources | (Inherited from Task.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | Execute | Executes the related build task.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BuildContent Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


BuildContent Fields

BuildContent Fields

Expand image Public Fields

 | Name | Description
Public Field | CancelEventNameFormat | The format specifier for the named event used to cancel the build.

Expand image See Also

Reference

BuildContent Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


BuildContent.CancelEventNameFormat Field

BuildContent.CancelEventNameFormat Field

The format specifier for the named event used to cancel the build.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public const string CancelEventNameFormat

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent Constructor

BuildContent Constructor

Initializes a new instance of BuildContent.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public BuildContent ()

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent Methods

BuildContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | Execute | Executes the related build task.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BuildContent Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


BuildContent.Execute Method

BuildContent.Execute Method

Executes the related build task.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool Execute ()

Return Value

true if the task completed successfully; false otherwise.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent Properties

BuildContent Properties

Expand image Public Properties

 | Name | Description
Public Property | BuildConfiguration | Gets or sets the content build configuration name.
Public Property | BuildEngine | (Inherited from Task.)
Public Property | BuildEngine2 | (Inherited from Task.)
Public Property | BuildEngine3 | (Inherited from Task.)
Public Property | CompressContent | Gets or sets the content compression flag.
Public Property | HostObject | (Inherited from Task.)
Public Property | IntermediateDirectory | Gets or sets the directory for storing temporary build files.
Public Property | IntermediateFiles | Gets all file names produced by the build, regardless of any incremental optimizations.
Public Property | Log | (Inherited from Task.)
Public Property | LoggerRootDirectory | Gets or sets the base reference path used when reporting errors during the content build process.
Public Property | OutputContentFiles | Gets all file names produced by the build, regardless of any incremental optimizations.
Public Property | OutputDirectory | Gets or sets the output directory for the final build results.
Public Property | PipelineAssemblies | Gets or sets the names of assemblies that provide Importer<T> or ContentProcessor<T> components for use by the build.
Public Property | PipelineAssemblyDependencies | Gets or sets the dependencies of the pipeline assemblies.
Public Property | RebuildAll | Gets or sets the force rebuild flag.
Public Property | RebuiltContentFiles | Gets the list of file names modified by an incremental rebuild.
Public Property | RootDirectory | Gets or sets the base path for the entire content build process.
Public Property | SourceAssets | Gets or sets the source asset files to be built.
Public Property | TargetPlatform | Gets or sets the content build target platform.
Public Property | TargetProfile | Gets or sets the target graphics profile.

Expand image Protected Properties

 | Name | Description
Protected Property | HelpKeywordPrefix | (Inherited from Task.)
Protected Property | TaskResources | (Inherited from Task.)

Expand image See Also

Reference

BuildContent Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


BuildContent.BuildConfiguration Property

BuildContent.BuildConfiguration Property

Gets or sets the content build configuration name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string BuildConfiguration { get; set; }

Property Value

Name of the configuration.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.CompressContent Property

BuildContent.CompressContent Property

Gets or sets the content compression flag.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool CompressContent { get; set; }

Property Value

If true, all content types that permit compression will be compressed when built (the default). If false, no content will be compressed.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.IntermediateDirectory Property

BuildContent.IntermediateDirectory Property

Gets or sets the directory for storing temporary build files.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string IntermediateDirectory { get; set; }

Property Value

Directory containing the intermediate build files.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.IntermediateFiles Property

BuildContent.IntermediateFiles Property

Gets all file names produced by the build, regardless of any incremental optimizations. This list can be used as input for a subsequent pack file generator task.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[OutputAttribute]
public ITaskItem[] IntermediateFiles { get; }

Property Value

Array of file names produced by the content build.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.LoggerRootDirectory Property

BuildContent.LoggerRootDirectory Property

Gets or sets the base reference path used when reporting errors during the content build process.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string LoggerRootDirectory { get; set; }

Property Value

Current name of the base directory or the value to be set.

Expand image Remarks

When building XNA content, all errors are displayed in the Error List Window of Visual Studio. Along with the data that triggered the error, the Error List displays the path and filename where the offending data was encountered.

By default, the path of the offending file that is reported in the Error List is always expressed as relative to the location of the project file that references it.

When set, the LoggerRootDirectory property specifies an explicit base path for error reporting that overrides the default operation. All offending files reported in the Error List will be expressed as relative to the base path set in LoggerRootDirectory.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.OutputContentFiles Property

BuildContent.OutputContentFiles Property

Gets all file names produced by the build, regardless of any incremental optimizations. This list can be used as input for a subsequent pack file generator task.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[OutputAttribute]
public ITaskItem[] OutputContentFiles { get; }

Property Value

Array of file names produced by the content build.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.OutputDirectory Property

BuildContent.OutputDirectory Property

Gets or sets the output directory for the final build results.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string OutputDirectory { get; set; }

Property Value

Output directory for final build result files

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.PipelineAssemblies Property

BuildContent.PipelineAssemblies Property

Gets or sets the names of assemblies that provide Importer<T> or ContentProcessor<T> components for use by the build.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public ITaskItem[] PipelineAssemblies { get; set; }

Property Value

Current pipeline assemblies or the values to be set.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.PipelineAssemblyDependencies Property

BuildContent.PipelineAssemblyDependencies Property

Gets or sets the dependencies of the pipeline assemblies.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public ITaskItem[] PipelineAssemblyDependencies { get; set; }

Property Value

Array of content build dependencies.

Expand image Remarks

Any dependencies must be loaded by the task. In addition, these dependencies won't be searched for ContentImporter or ContentProcessor components.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.RebuildAll Property

BuildContent.RebuildAll Property

Gets or sets the force rebuild flag.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool RebuildAll { get; set; }

Property Value

Current value of the force rebuild flag.

If true, all content is rebuilt (even when incremental checks indicate everything is up to date). The default value is false.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.RebuiltContentFiles Property

BuildContent.RebuiltContentFiles Property

Gets the list of file names modified by an incremental rebuild. This list is suitable for passing to a subsequent incremental deploy or reload notification task.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[OutputAttribute]
public ITaskItem[] RebuiltContentFiles { get; }

Property Value

Array of file names modified by an incremental rebuild.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.RootDirectory Property

BuildContent.RootDirectory Property

Gets or sets the base path for the entire content build process.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string RootDirectory { get; set; }

Property Value

Base path of the content build process.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.SourceAssets Property

BuildContent.SourceAssets Property

Gets or sets the source asset files to be built.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public ITaskItem[] SourceAssets { get; set; }

Property Value

Current source asset files to be built or the values to be set.

Expand image Remarks

This task list can be decorated with the following metadata attributes.

Attribute Name | Description
Name | Final name of the compiled asset. This value is passed to the runtime content loader. If you omit this value, it defaults to the source file name with no extension.
Importer | Importer used to read the source asset. If you omit this value, the importer is deduced from the source file extension.
Processor | Content processor used to convert the asset data. If you omit this value, data passes through the pipeline with no custom processing.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.TargetPlatform Property

BuildContent.TargetPlatform Property

Gets or sets the content build target platform.

This should be one of the values of the TargetPlatform Enumeration enumeration.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public string TargetPlatform { get; set; }

Property Value

Target of the content build. For a list of possible values, see TargetPlatform Enumeration.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildContent.TargetProfile Property

BuildContent.TargetProfile Property

Gets or sets the target graphics profile.

This should be one of the values of the GraphicsProfile Enumeration enumeration.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public string TargetProfile { get; set; }

Property Value

Target graphics profile of the content build. For a list of possible values, see GraphicsProfile Enumeration.

Expand image See Also

Reference

BuildContent Class
BuildContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact Class

BuildXact Class
See Also Members
CollapseAll image

An MSBuild task that provides incremental build capabilities for XACT projects.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class BuildXact : Task

Expand image See Also

Reference

BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact Members

BuildXact Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the BuildXact type.

Expand image Public Constructors

 | Name | Description
Public Method | BuildXact | Initializes a new instance of BuildXact.

Expand image Public Properties

 | Name | Description
Public Property | BuildConfiguration | Gets or sets the content build configuration name.
Public Property | BuildEngine | (Inherited from Task.)
Public Property | BuildEngine2 | (Inherited from Task.)
Public Property | BuildEngine3 | (Inherited from Task.)
Public Property | HostObject | (Inherited from Task.)
Public Property | IntermediateDirectory | Gets or sets the directory for storing temporary build files.
Public Property | IntermediateFiles | Gets the names of the intermediate files used internally by the build.
Public Property | Log | (Inherited from Task.)
Public Property | LoggerRootDirectory | Gets or sets the base reference path used when reporting errors during the content build process.
Public Property | OutputDirectory | Gets or sets the directory for the final build results.
Public Property | OutputXactFiles | Gets the names of all files produced by the build, regardless of any incremental optimizations.
Public Property | RebuildAll | Gets or sets the force rebuild flag.
Public Property | RebuiltXactFiles | Gets the names of files modified by an incremental rebuild.
Public Property | RootDirectory | Gets or sets the base directory for the entire content build process.
Public Property | TargetPlatform | Gets or sets the content build target platform.
Public Property | TargetProfile | Gets or sets the target graphics profile.
Public Property | XactProjects | Gets or sets the XACT project files to be built.
Public Property | XnaFrameworkVersion | Gets or sets XNA framework version, used to determine the xactbld3.exe path.

Expand image Protected Properties

 | Name | Description
Protected Property | HelpKeywordPrefix | (Inherited from Task.)
Protected Property | TaskResources | (Inherited from Task.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | Execute | Executes the BuildXact task.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BuildXact Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


BuildXact Constructor

BuildXact Constructor

Initializes a new instance of BuildXact.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public BuildXact ()

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact Methods

BuildXact Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | Execute | Executes the BuildXact task.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

BuildXact Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


BuildXact.Execute Method

BuildXact.Execute Method

Executes the BuildXact task.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool Execute ()

Return Value

true to begin execution of the task; otherwise false.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact Properties

BuildXact Properties

Expand image Public Properties

 | Name | Description
Public Property | BuildConfiguration | Gets or sets the content build configuration name.
Public Property | BuildEngine | (Inherited from Task.)
Public Property | BuildEngine2 | (Inherited from Task.)
Public Property | BuildEngine3 | (Inherited from Task.)
Public Property | HostObject | (Inherited from Task.)
Public Property | IntermediateDirectory | Gets or sets the directory for storing temporary build files.
Public Property | IntermediateFiles | Gets the names of the intermediate files used internally by the build.
Public Property | Log | (Inherited from Task.)
Public Property | LoggerRootDirectory | Gets or sets the base reference path used when reporting errors during the content build process.
Public Property | OutputDirectory | Gets or sets the directory for the final build results.
Public Property | OutputXactFiles | Gets the names of all files produced by the build, regardless of any incremental optimizations.
Public Property | RebuildAll | Gets or sets the force rebuild flag.
Public Property | RebuiltXactFiles | Gets the names of files modified by an incremental rebuild.
Public Property | RootDirectory | Gets or sets the base directory for the entire content build process.
Public Property | TargetPlatform | Gets or sets the content build target platform.
Public Property | TargetProfile | Gets or sets the target graphics profile.
Public Property | XactProjects | Gets or sets the XACT project files to be built.
Public Property | XnaFrameworkVersion | Gets or sets XNA framework version, used to determine the xactbld3.exe path.

Expand image Protected Properties

 | Name | Description
Protected Property | HelpKeywordPrefix | (Inherited from Task.)
Protected Property | TaskResources | (Inherited from Task.)

Expand image See Also

Reference

BuildXact Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


BuildXact.BuildConfiguration Property

BuildXact.BuildConfiguration Property

Gets or sets the content build configuration name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string BuildConfiguration { get; set; }

Property Value

Current name of the build configuration or the value to be set.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.IntermediateDirectory Property

BuildXact.IntermediateDirectory Property

Gets or sets the directory for storing temporary build files.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public string IntermediateDirectory { get; set; }

Property Value

Current directory for temporary build files or the value to be set.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.IntermediateFiles Property

BuildXact.IntermediateFiles Property

Gets the names of the intermediate files used internally by the build.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[OutputAttribute]
public ITaskItem[] IntermediateFiles { get; }

Property Value

Intermediate file names produced by the build.

Expand image Remarks

When combined with OutputXactFiles, this property gives the complete list of generated files that should be removed by a Clean build operation.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.LoggerRootDirectory Property

BuildXact.LoggerRootDirectory Property

Gets or sets the base reference path used when reporting errors during the content build process.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string LoggerRootDirectory { get; set; }

Property Value

Current name of the base directory or the value to be set.

Expand image Remarks

When building XACT content, all errors are displayed in the Error List Window of Visual Studio. Along with the data that triggered the error, the Error List displays the path and filename where the offending data was encountered.

By default, the path of the offending file that is reported in the Error List is always expressed as relative to the location of the project file that references it.

When set, the LoggerRootDirectory property specifies an explicit base path for error reporting that overrides the default operation. All offending files reported in the Error List will be expressed as relative to the base path set in LoggerRootDirectory.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.OutputDirectory Property

BuildXact.OutputDirectory Property

Gets or sets the directory for the final build results.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public string OutputDirectory { get; set; }

Property Value

Current directory for the final build results or the value to be set.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.OutputXactFiles Property

BuildXact.OutputXactFiles Property

Gets the names of all files produced by the build, regardless of any incremental optimizations.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[OutputAttribute]
public ITaskItem[] OutputXactFiles { get; }

Property Value

File names produced by the build or the value to be set.

Expand image Remarks

Pass this property value to a subsequent packfile generator task or combine with the IntermediateFiles property to get a complete list of generated files that should be removed by a Clean build operation.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.RebuildAll Property

BuildXact.RebuildAll Property

Gets or sets the force rebuild flag.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public bool RebuildAll { get; set; }

Property Value

If true, all XACT target files are rebuilt; otherwise only modified files are rebuilt. Default value is false.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.RebuiltXactFiles Property

BuildXact.RebuiltXactFiles Property

Gets the names of files modified by an incremental rebuild.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[OutputAttribute]
public ITaskItem[] RebuiltXactFiles { get; }

Property Value

File names modified by an incremental build.

Expand image Remarks

Optimize your deploy or reload process by passing the current value of RebuiltXactFiles to a subsequent incremental deploy or reload notification task.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.RootDirectory Property

BuildXact.RootDirectory Property

Gets or sets the base directory for the entire content build process.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string RootDirectory { get; set; }

Property Value

Current name of the base directory or the value to be set.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.TargetPlatform Property

BuildXact.TargetPlatform Property

Gets or sets the content build target platform.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public string TargetPlatform { get; set; }

Property Value

Current platform or the value to be set. Can be one of the following values: Windows or Xbox360

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.TargetProfile Property

BuildXact.TargetProfile Property

Gets or sets the target graphics profile.

This should be one of the values of the GraphicsProfile Enumeration enumeration.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public string TargetProfile { get; set; }

Property Value

Target graphics profile of the content build. For a list of possible values, see GraphicsProfile Enumeration.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.XactProjects Property

BuildXact.XactProjects Property

Gets or sets the XACT project files to be built.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public ITaskItem[] XactProjects { get; set; }

Property Value

Current XACT project files to be built or value to be set.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


BuildXact.XnaFrameworkVersion Property

BuildXact.XnaFrameworkVersion Property

Gets or sets XNA framework version, used to determine the xactbld3.exe path.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public string XnaFrameworkVersion { get; set; }

Property Value

Version of the XNA framework or the value to be set. Currently, 1.0 is the only valid value.

Expand image See Also

Reference

BuildXact Class
BuildXact Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CleanContent Class

CleanContent Class
See Also Members
CollapseAll image

An MSBuild task for deleting all the intermediate and output files that were created by a previous Content Pipeline build operation.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class CleanContent : Task

Expand image See Also

Reference

CleanContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CleanContent Members

CleanContent Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the CleanContent type.

Expand image Public Constructors

 | Name | Description
Public Method | CleanContent | Instantiates a new instance of this MSBuild task for deleting all the intermediate and output files that were created by a previous Content Pipeline build operation.

Expand image Public Properties

 | Name | Description
Public Property | BuildConfiguration | Gets or sets the content build configuration name.
Public Property | BuildEngine | (Inherited from Task.)
Public Property | BuildEngine2 | (Inherited from Task.)
Public Property | BuildEngine3 | (Inherited from Task.)
Public Property | HostObject | (Inherited from Task.)
Public Property | IntermediateDirectory | Gets or sets the directory for storing temporary build files.
Public Property | Log | (Inherited from Task.)
Public Property | OutputDirectory | Gets or sets the output directory for the final build results.
Public Property | RootDirectory | Gets or sets the base path for the entire content build process.
Public Property | TargetPlatform | Gets or sets the content build target platform.
Public Property | TargetProfile | Gets or sets the target graphics profile.

Expand image Protected Properties

 | Name | Description
Protected Property | HelpKeywordPrefix | (Inherited from Task.)
Protected Property | TaskResources | (Inherited from Task.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | Execute | Removes all intermediate and output files that were created by a previous Content Pipeline build operation.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

CleanContent Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


CleanContent Constructor

CleanContent Constructor

Instantiates a new instance of this MSBuild task for deleting all the intermediate and output files that were created by a previous Content Pipeline build operation.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public CleanContent ()

Expand image See Also

Reference

CleanContent Class
CleanContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CleanContent Methods

CleanContent Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | Execute | Removes all intermediate and output files that were created by a previous Content Pipeline build operation.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

CleanContent Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


CleanContent.Execute Method

CleanContent.Execute Method

Removes all intermediate and output files that were created by a previous Content Pipeline build operation.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool Execute ()

Return Value

true if errors were logged; false otherwise.

Expand image See Also

Reference

CleanContent Class
CleanContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CleanContent Properties

CleanContent Properties

Expand image Public Properties

 | Name | Description
Public Property | BuildConfiguration | Gets or sets the content build configuration name.
Public Property | BuildEngine | (Inherited from Task.)
Public Property | BuildEngine2 | (Inherited from Task.)
Public Property | BuildEngine3 | (Inherited from Task.)
Public Property | HostObject | (Inherited from Task.)
Public Property | IntermediateDirectory | Gets or sets the directory for storing temporary build files.
Public Property | Log | (Inherited from Task.)
Public Property | OutputDirectory | Gets or sets the output directory for the final build results.
Public Property | RootDirectory | Gets or sets the base path for the entire content build process.
Public Property | TargetPlatform | Gets or sets the content build target platform.
Public Property | TargetProfile | Gets or sets the target graphics profile.

Expand image Protected Properties

 | Name | Description
Protected Property | HelpKeywordPrefix | (Inherited from Task.)
Protected Property | TaskResources | (Inherited from Task.)

Expand image See Also

Reference

CleanContent Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


CleanContent.BuildConfiguration Property

CleanContent.BuildConfiguration Property

Gets or sets the content build configuration name.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string BuildConfiguration { get; set; }

Property Value

The content build configuration name.

Expand image See Also

Reference

CleanContent Class
CleanContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CleanContent.IntermediateDirectory Property

CleanContent.IntermediateDirectory Property

Gets or sets the directory for storing temporary build files.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string IntermediateDirectory { get; set; }

Property Value

The directory for storing temporary build files.

Expand image See Also

Reference

CleanContent Class
CleanContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CleanContent.OutputDirectory Property

CleanContent.OutputDirectory Property

Gets or sets the output directory for the final build results.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string OutputDirectory { get; set; }

Property Value

The output directory for the final build results.

Expand image See Also

Reference

CleanContent Class
CleanContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CleanContent.RootDirectory Property

CleanContent.RootDirectory Property

Gets or sets the base path for the entire content build process.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public string RootDirectory { get; set; }

Property Value

The base path for the entire content build process.

Expand image See Also

Reference

CleanContent Class
CleanContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CleanContent.TargetPlatform Property

CleanContent.TargetPlatform Property

Gets or sets the content build target platform.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public string TargetPlatform { get; set; }

Property Value

The content build target platform.

Expand image See Also

Reference

CleanContent Class
CleanContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


CleanContent.TargetProfile Property

CleanContent.TargetProfile Property

Gets or sets the target graphics profile.

This should be one of the values of the GraphicsProfile Enumeration enumeration.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public string TargetProfile { get; set; }

Property Value

Target graphics profile of the content build. For a list of possible values, see GraphicsProfile Enumeration.

Expand image See Also

Reference

CleanContent Class
CleanContent Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GetLastOutputs Class

GetLastOutputs Class
See Also Members
CollapseAll image

Provides methods and properties for getting the names of all output content files from the content pipeline's cache file.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public class GetLastOutputs : Task

Expand image See Also

Reference

GetLastOutputs Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GetLastOutputs Members

GetLastOutputs Members
See Also Constructors Methods Properties
CollapseAll image

The following tables list the members exposed by the GetLastOutputs type.

Expand image Public Constructors

 | Name | Description
Public Method | GetLastOutputs | Creates a new instance of GetLastOutputs.

Expand image Public Properties

 | Name | Description
Public Property | BuildEngine | (Inherited from Task.)
Public Property | BuildEngine2 | (Inherited from Task.)
Public Property | BuildEngine3 | (Inherited from Task.)
Public Property | HostObject | (Inherited from Task.)
Public Property | IntermediateDirectory | Gets or sets the directory containing the cache file to be retrieved.
Public Property | Log | (Inherited from Task.)
Public Property | OutputContentFiles | Gets the names of the output content files.

Expand image Protected Properties

 | Name | Description
Protected Property | HelpKeywordPrefix | (Inherited from Task.)
Protected Property | TaskResources | (Inherited from Task.)

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | Execute | Executes the related task using MSBuild.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GetLastOutputs Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


GetLastOutputs Constructor

GetLastOutputs Constructor

Creates a new instance of GetLastOutputs.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public GetLastOutputs ()

Expand image See Also

Reference

GetLastOutputs Class
GetLastOutputs Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GetLastOutputs Methods

GetLastOutputs Methods

Expand image Public Methods

 | Name | Description
Public Method | Equals | (Inherited from Object.)
Public Method | Execute | Executes the related task using MSBuild.
Public Method | GetHashCode | (Inherited from Object.)
Public Method | GetType | (Inherited from Object.)
Public Method | ToString | (Inherited from Object.)

Expand image Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from Object.)
Protected Method | MemberwiseClone | (Inherited from Object.)

Expand image See Also

Reference

GetLastOutputs Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


GetLastOutputs.Execute Method

GetLastOutputs.Execute Method

Executes the related task using MSBuild.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
public override bool Execute ()

Return Value

true if the task completed successfully; false otherwise.

Expand image See Also

Reference

GetLastOutputs Class
GetLastOutputs Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GetLastOutputs Properties

GetLastOutputs Properties

Expand image Public Properties

 | Name | Description
Public Property | BuildEngine | (Inherited from Task.)
Public Property | BuildEngine2 | (Inherited from Task.)
Public Property | BuildEngine3 | (Inherited from Task.)
Public Property | HostObject | (Inherited from Task.)
Public Property | IntermediateDirectory | Gets or sets the directory containing the cache file to be retrieved.
Public Property | Log | (Inherited from Task.)
Public Property | OutputContentFiles | Gets the names of the output content files.

Expand image Protected Properties

 | Name | Description
Protected Property | HelpKeywordPrefix | (Inherited from Task.)
Protected Property | TaskResources | (Inherited from Task.)

Expand image See Also

Reference

GetLastOutputs Class
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace


GetLastOutputs.IntermediateDirectory Property

GetLastOutputs.IntermediateDirectory Property

Gets or sets the directory containing the cache file to be retrieved.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[RequiredAttribute]
public string IntermediateDirectory { get; set; }

Property Value

Path of the retrieved cache file.

Expand image See Also

Reference

GetLastOutputs Class
GetLastOutputs Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


GetLastOutputs.OutputContentFiles Property

GetLastOutputs.OutputContentFiles Property

Gets the names of the output content files. This information may be out of date if a recent build was not completed. The collection is empty if there were no outputs or no cached information was found.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Tasks
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Expand image Syntax

C#
[OutputAttribute]
public ITaskItem[] OutputContentFiles { get; }

Property Value

Collection of cache file names.

Expand image See Also

Reference

GetLastOutputs Class
GetLastOutputs Members
Microsoft.Xna.Framework.Content.Pipeline.Tasks Namespace

Expand image Platforms

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.


XNA Creators Club Online Web Site

XNA Creators Club Online Web Site

Are you ready to take your game development to the next level? Come join the community of game creators at the XNA Creators Club Online Web site. Learn, share, and explore with fellow XNA Creators Club members. Just point your browser to the following address:

http://creators.xna.com

What's Inside

As a member of the XNA Creators Club, you can download:

  • Educational samples and tutorials
  • Technical articles
  • Starter kits
  • Minigames
  • Utilities
  • Partner offers

Content is updated regularly, so there is always something new.

Community Forums

Signing up on the XNA Creators Club Online Web site gives you access to the XNA Creators Club Online Forums, where you can interact with other creators. Find the answers to your questions, and share your knowledge with others.

Ready to Join?

The community is waiting for you at the XNA Creators Club Online Web site. Joining is free and easy, so sign up today.

Visit the XNA Creators Club Online Web Site.


Copyright Notice

Copyright Notice

Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in examples herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2010 Microsoft Corporation. All rights reserved.

Microsoft, XNA, Xbox, Xbox 360, Xbox LIVE, Zune, Direct3D, DirectMusic, DirectSound, DirectX, Visual C#, Visual C++, Visual Studio .NET, Win32, Windows, Windows Mobile, Windows Phone, and Windows Vista are either registered trademarks or trademarks of the Microsoft group of companies.

All other trademarks are property of their respective owners.